Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130446
b: refs/heads/master
c: 05986e2
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jan 30, 2009
1 parent 567db13 commit 9db032a
Show file tree
Hide file tree
Showing 58 changed files with 821 additions and 455 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: de2cf591bc876f7a63809d8955855ab074588c30
refs/heads/master: 05986e264ee638b6b6151aea89c9f191278c30f1
24 changes: 22 additions & 2 deletions trunk/Documentation/cgroups/memcg_test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Memory Resource Controller(Memcg) Implementation Memo.
Last Updated: 2008/12/15
Base Kernel Version: based on 2.6.28-rc8-mm.
Last Updated: 2009/1/19
Base Kernel Version: based on 2.6.29-rc2.

Because VM is getting complex (one of reasons is memcg...), memcg's behavior
is complex. This is a document for memcg's internal behavior.
Expand Down Expand Up @@ -340,3 +340,23 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
# mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices

and do task move, mkdir, rmdir etc...under this.

9.7 swapoff.
Besides management of swap is one of complicated parts of memcg,
call path of swap-in at swapoff is not same as usual swap-in path..
It's worth to be tested explicitly.

For example, test like following is good.
(Shell-A)
# mount -t cgroup none /cgroup -t memory
# mkdir /cgroup/test
# echo 40M > /cgroup/test/memory.limit_in_bytes
# echo 0 > /cgroup/test/tasks
Run malloc(100M) program under this. You'll see 60M of swaps.
(Shell-B)
# move all tasks in /cgroup/test to /cgroup
# /sbin/swapoff -a
# rmdir /test/cgroup
# kill malloc task.

Of course, tmpfs v.s. swapoff test should be tested, too.
28 changes: 28 additions & 0 deletions trunk/Documentation/filesystems/proc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2027,6 +2027,34 @@ increase the likelihood of this process being killed by the oom-killer. Valid
values are in the range -16 to +15, plus the special value -17, which disables
oom-killing altogether for this process.

The process to be killed in an out-of-memory situation is selected among all others
based on its badness score. This value equals the original memory size of the process
and is then updated according to its CPU time (utime + stime) and the
run time (uptime - start time). The longer it runs the smaller is the score.
Badness score is divided by the square root of the CPU time and then by
the double square root of the run time.

Swapped out tasks are killed first. Half of each child's memory size is added to
the parent's score if they do not share the same memory. Thus forking servers
are the prime candidates to be killed. Having only one 'hungry' child will make
parent less preferable than the child.

/proc/<pid>/oom_score shows process' current badness score.

The following heuristics are then applied:
* if the task was reniced, its score doubles
* superuser or direct hardware access tasks (CAP_SYS_ADMIN, CAP_SYS_RESOURCE
or CAP_SYS_RAWIO) have their score divided by 4
* if oom condition happened in one cpuset and checked task does not belong
to it, its score is divided by 8
* the resulting score is multiplied by two to the power of oom_adj, i.e.
points <<= oom_adj when it is positive and
points >>= -(oom_adj) otherwise

The task with the highest badness score is then selected and its children
are killed, process itself will be killed in an OOM situation when it does
not have children or some of them disabled oom like described above.

2.13 /proc/<pid>/oom_score - Display current oom-killer score
-------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/lguest/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This creates the demonstration utility "lguest" which runs a Linux guest.
CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include -I../../arch/x86/include
CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include -I../../arch/x86/include -U_FORTIFY_SOURCE
LDLIBS:=-lz

all: lguest
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/alpha/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config ALPHA
select HAVE_AOUT
select HAVE_IDE
select HAVE_OPROFILE
select HAVE_SYSCALL_WRAPPERS
help
The Alpha is a 64-bit general-purpose processor designed and
marketed by the Digital Equipment Corporation of blessed memory,
Expand Down
17 changes: 6 additions & 11 deletions trunk/arch/alpha/include/asm/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@

/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
function loaded the GP, so this could fail in modules. */
static inline void ATTRIB_NORET __BUG(const char *file, int line)
{
__asm__ __volatile__(
"call_pal %0 # bugchk\n\t"
".long %1\n\t.8byte %2"
: : "i" (PAL_bugchk), "i"(line), "i"(file));
for ( ; ; )
;
}

#define BUG() __BUG(__FILE__, __LINE__)
#define BUG() { \
__asm__ __volatile__( \
"call_pal %0 # bugchk\n\t" \
".long %1\n\t.8byte %2" \
: : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \
for ( ; ; ); }

#define HAVE_ARCH_BUG
#endif
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/alpha/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#else /* no PCI - no IOMMU. */

#include <asm/io.h> /* for virt_to_phys() */

struct scatterlist;
void *dma_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t gfp);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ sys_execve:
osf_sigprocmask:
.prologue 0
mov $sp, $18
jmp $31, do_osf_sigprocmask
jmp $31, sys_osf_sigprocmask
.end osf_sigprocmask

.align 4
Expand Down
Loading

0 comments on commit 9db032a

Please sign in to comment.