Commenting out out_of_memory() function in __alloc_pages()
Commenting out out_of_memory() function in __alloc_pages()
am 07.07.2006 11:46:37 von abum
This is a multi-part message in MIME format.
------=_NextPart_000_0024_01C6A1D8.57723C30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Hi,
I am getting the Out of memory.
To circumvent the problem, I have commented the call to "out_of_memory(),
and replaced "goto restart" with "goto nopage".
At "nopage:" lable I have added a call to "schedule()" and then "return
NULL" after "schedule()".
I tried the modified kernel with a test application, the test application is
mallocing memory in a loop. Unlike as expected the process gets killed. On
second run of the same application I am getting the page allocation failure
as expected but subsequently the system hangs.
I am attaching the test application and the log herewith.
I am getting this exception with kernel 2.6.13. With kernel
2.4.19-rmka7-pxa1 there was no problem.
Why its so? What can I do to alleviate the OOM problem?
Thanks in anticipation and regards,
Abu.
------=_NextPart_000_0024_01C6A1D8.57723C30
Content-Type: text/plain;
name="mail_oom_test_6.TXT"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="mail_oom_test_6.TXT"
sh-3.00# ./test1=07
OOM Test: Counter =3D 0
.....
OOM Test: Counter =3D 6635
, OOM: Out of Memory would have been called....<4>test1: page allocation =
failure. order:0, mode:0xd2=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:2=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:1=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 588kB (0kB HighMem)=0A=
=0DActive:2178 inactive:230 dirty:0 writeback:0 unstable:0 free:147 =
slab:367 mapped:2178 pagetables:43=0A=
=0DDMA free:588kB min:512kB low:640kB high:768kB active:8712kB =
inactive:920kB present:16384kB pages_scanned:4851 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 9*4kB 3*8kB 1*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 588kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D218 free pages=0A=
=0D625 reserved pages=0A=
=0D367 slab pages=0A=
=0D0 pages shared=0A=
=0D0 pages swap cached=0A=
=0DVM: killing process test1=0A=
=0DKilled
sh-3.00# ./test1
OOM Test: Counter =3D 0
.....
OOM Test: Counter =3D 6416
, OOM: Out of Memory would have been called....<4>test1: page allocation =
failure. order:0, mode:0x201d0=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:2=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:1=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 672kB (0kB HighMem)=0A=
=0DActive:2187 inactive:170 dirty:0 writeback:0 unstable:0 free:168 =
slab:365 mapped:2125 pagetables:43=0A=
=0DDMA free:672kB min:512kB low:640kB high:768kB active:8748kB =
inactive:680kB present:16384kB pages_scanned:2939 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 28*4kB 6*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 672kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D239 free pages=0A=
=0D625 reserved pages=0A=
=0D365 slab pages=0A=
=0D13 pages shared=0A=
=0D0 pages swap cached=0A=
=0DError -5 while decompressing!=0A=
=0Dc01e42f4(2388)->c0754000(4096)=0A=
=0DError -3 while decompressing!=0A=
=0Dc01e4c48(2531)->c0caf000(4096)=0A=
=0DError -3 while decompressing!=0A=
=0Dc01e562b(2643)->c0914000(4096)=0A=
=0D, OOM: Out of Memory would have been called....<4>test1: page =
allocation failure. order:0, mode:0x201d2=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:3=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:1=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 600kB (0kB HighMem)=0A=
=0DActive:2267 inactive:113 dirty:0 writeback:0 unstable:0 free:150 =
slab:365 mapped:2125 pagetables:43=0A=
=0DDMA free:600kB min:512kB low:640kB high:768kB active:9068kB =
inactive:452kB present:16384kB pages_scanned:222 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 22*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 600kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D222 free pages=0A=
=0D625 reserved pages=0A=
=0D365 slab pages=0A=
=0D13 pages shared=0A=
=0D0 pages swap cached=0A=
=0D, OOM: Out of Memory would have been called....<4>init: page =
allocation failure. order:0, mode:0x201d0=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:3=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:1=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 696kB (0kB HighMem)=0A=
=0DActive:2220 inactive:136 dirty:0 writeback:0 unstable:0 free:174 =
slab:365 mapped:2125 pagetables:43=0A=
=0DDMA free:696kB min:512kB low:640kB high:768kB active:8880kB =
inactive:544kB present:16384kB pages_scanned:6729 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 44*4kB 1*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 696kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D246 free pages=0A=
=0D625 reserved pages=0A=
=0D365 slab pages=0A=
=0D3 pages shared=0A=
=0D0 pages swap cached=0A=
=0DError -5 while decompressing!=0A=
=0Dc01e7949(2386)->c040d000(4096)=0A=
=0DError -3 while decompressing!=0A=
=0Dc01e829b(2297)->c05e9000(4096)=0A=
=0D, OOM: Out of Memory would have been called....<4>init: page =
allocation failure. order:0, mode:0x201d2=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:4=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:1=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 600kB (0kB HighMem)=0A=
=0DActive:2189 inactive:166 dirty:0 writeback:0 unstable:0 free:150 =
slab:364 mapped:2125 pagetables:43=0A=
=0DDMA free:600kB min:512kB low:640kB high:768kB active:8756kB =
inactive:664kB present:16384kB pages_scanned:7675 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 20*4kB 1*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 600kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D223 free pages=0A=
=0D625 reserved pages=0A=
=0D364 slab pages=0A=
=0D1 pages shared=0A=
=0D0 pages swap cached=0A=
=0D, OOM: Out of Memory would have been called....<4>test1: page =
allocation failure. order:0, mode:0x201d0=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:4=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:1=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 600kB (0kB HighMem)=0A=
=0DActive:2291 inactive:64 dirty:0 writeback:0 unstable:0 free:150 =
slab:364 mapped:2125 pagetables:43=0A=
=0DDMA free:600kB min:512kB low:640kB high:768kB active:9164kB =
inactive:256kB present:16384kB pages_scanned:10106 all_unreclaimable? yes=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 20*4kB 1*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 600kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D223 free pages=0A=
=0D625 reserved pages=0A=
=0D364 slab pages=0A=
=0D2 pages shared=0A=
=0D0 pages swap cached=0A=
=0D, OOM: Out of Memory would have been called....<4>init: page =
allocation failure. order:0, mode:0x201d2=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:4=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:0=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 512kB (0kB HighMem)=0A=
=0DActive:2296 inactive:125 dirty:0 writeback:0 unstable:0 free:128 =
slab:364 mapped:2127 pagetables:43=0A=
=0DDMA free:512kB min:512kB low:640kB high:768kB active:9184kB =
inactive:500kB present:16384kB pages_scanned:10106 all_unreclaimable? yes=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 512kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D200 free pages=0A=
=0D625 reserved pages=0A=
=0D364 slab pages=0A=
=0D34 pages shared=0A=
=0D0 pages swap cached=0A=
=0D, OOM: Out of Memory would have been called....<4>init: page =
allocation failure. order:0, mode:0x201d2=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:4=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:0=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 512kB (0kB HighMem)=0A=
=0DActive:2296 inactive:125 dirty:0 writeback:0 unstable:0 free:128 =
slab:364 mapped:2127 pagetables:43=0A=
=0DDMA free:512kB min:512kB low:640kB high:768kB active:9184kB =
inactive:500kB present:16384kB pages_scanned:10106 all_unreclaimable? yes=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 512kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D200 free pages=0A=
=0D625 reserved pages=0A=
=0D364 slab pages=0A=
=0D34 pages shared=0A=
=0D0 pages swap cached=0A=
=0D, OOM: Out of Memory would have been called....<4>test1: page =
allocation failure. order:0, mode:0x201d2=0A=
=0DMem-info:=0A=
=0DDMA per-cpu:=0A=
=0Dcpu 0 hot: low 2, high 6, batch 1 used:4=0A=
=0Dcpu 0 cold: low 0, high 2, batch 1 used:0=0A=
=0DNormal per-cpu: empty=0A=
=0DHighMem per-cpu: empty=0A=
=0DFree pages: 512kB (0kB HighMem)=0A=
=0DActive:2296 inactive:125 dirty:0 writeback:0 unstable:0 free:128 =
slab:364 mapped:2133 pagetables:43=0A=
=0DDMA free:512kB min:512kB low:640kB high:768kB active:9184kB =
inactive:500kB present:16384kB pages_scanned:10106 all_unreclaimable? yes=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DNormal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB =
present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DHighMem free:0kB min:128kB low:160kB high:192kB active:0kB =
inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no=0A=
=0Dlowmem_reserve[]: 0 0 0=0A=
=0DDMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB =
0*1024kB =3D 512kB=0A=
=0DNormal: empty=0A=
=0DHighMem: empty=0A=
=0DSwap cache: add 0, delete 0, find 0/0, race 0+0=0A=
=0DFree swap =3D 0kB=0A=
=0DTotal swap =3D 0kB=0A=
=0DFree swap: 0kB=0A=
=0D4096 pages of RAM=0A=
=0D200 free pages=0A=
=0D625 reserved pages=0A=
=0D364 slab pages=0A=
=0D40 pages shared=0A=
=0D0 pages swap cached=0A=
=0D, OOM: Out of Memory would have been called....VM: killing process =
test1=0A=
=0D
------=_NextPart_000_0024_01C6A1D8.57723C30
Content-Type: application/octet-stream;
name="test1.c"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="test1.c"
#include=0A=
#include=0A=
=0A=
main()=0A=
{=0A=
char* buff;=0A=
int count;=0A=
=0A=
count=3D0;=0A=
while(1)=0A=
{=0A=
printf("\nOOM Test: Counter =3D %d", count);=0A=
buff =3D (char*) malloc(1024);=0A=
// memset(buff,'\0',1024);=0A=
count++;=0A=
=0A=
if (buff==NULL)=0A=
{=0A=
printf("\nOOM Test: Memory allocation error");=0A=
}=0A=
}=0A=
}=0A=
------=_NextPart_000_0024_01C6A1D8.57723C30--
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Commenting out out_of_memory() function in __alloc_pages()
am 07.07.2006 11:54:41 von Robin Holt
I am not sure about x86, but on ia64, you would be very hard pressed
for this application to actually run you out of memory. With the
memset commented out, you would be allocating vmas, etc, but you
would not be actually putting pages behind those virtual addresses.
Thanks,
Robin
--------------------------- test1.c ----------------------------------
#include
#include
main()
{
char* buff;
int count;
count=0;
while(1)
{
printf("\nOOM Test: Counter = %d", count);
buff = (char*) malloc(1024);
// memset(buff,'\0',1024);
count++;
if (buff==NULL)
{
printf("\nOOM Test: Memory allocation error");
}
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Commenting out out_of_memory() function in __alloc_pages()
am 07.07.2006 23:21:54 von Chase Venters
On Fri, 7 Jul 2006, Abu M. Muttalib wrote:
> Hi,
>
> I am getting the Out of memory.
>
> To circumvent the problem, I have commented the call to "out_of_memory(),
> and replaced "goto restart" with "goto nopage".
>
> At "nopage:" lable I have added a call to "schedule()" and then "return
> NULL" after "schedule()".
I wouldn't recommend gutting the oom killer...
> I tried the modified kernel with a test application, the test application is
> mallocing memory in a loop. Unlike as expected the process gets killed. On
> second run of the same application I am getting the page allocation failure
> as expected but subsequently the system hangs.
>
> I am attaching the test application and the log herewith.
>
> I am getting this exception with kernel 2.6.13. With kernel
> 2.4.19-rmka7-pxa1 there was no problem.
>
> Why its so? What can I do to alleviate the OOM problem?
First you should know what is causing them. Is an application leaking
memory, or is the kernel leaking memory? "ps" can help you answer the
first question, while "watch cat /proc/meminfo" can help you answer the
second.
If kernel memory usage seems to be rising steadily over time, report it as
a bug. Otherwise, fix the broken application.
The reason for the "OOM killer" is because Linux does "VM overcommit".
Please read "Documentation/vm/overcommit-accounting" for more information,
including what you'll need if you want to disable "VM overcommit" to
hopefully stop the OOM killer from coming around.
(When using VM overcommit, the OOM killer is very necessary for a healthy
system... sometimes the kernel _needs_ memory, and you can't tell it NO.
In those cases, the OOM killer is invoked to find something to
sacrifice...)
> Thanks in anticipation and regards,
> Abu.
>
Thanks,
Chase
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Script to check a process
am 08.07.2006 06:09:48 von Diego Alencar Alves de Lima
Hello,
I have a system that I monitor remotely but I have a problem: I need to have 3
processes running on it all the time (actually, it's the same process running
3 times) and I can't be watching the system 24/7.
How can I make a script that will check to see if a certain process is
running? The process name is "nspluginviewer" and there should be 3 of it
running (each one called from a konqueror process). Then it would reboot the
computer if it didn't detect the three running.
Thanks
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Script to check a process
am 08.07.2006 12:36:41 von Frederik Deweerdt
On Sat, Jul 08, 2006 at 01:09:48AM -0300, Diego Alencar Alves de Lima wrote:
> How can I make a script that will check to see if a certain process is
> running? The process name is "nspluginviewer" and there should be 3 of it
> running (each one called from a konqueror process). Then it would reboot the
> computer if it didn't detect the three running.
>
There are many ways to do it, one could be:
while [ $(pidof | awk '{print NF;}') -eq ]; do sleep 1; done ; shutdown -r now
Regards,
Frederik
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Commenting out out_of_memory() function in __alloc_pages()
am 08.07.2006 20:06:13 von Robert Hancock
Abu M. Muttalib wrote:
> Hi,
>
> I am getting the Out of memory.
>
> To circumvent the problem, I have commented the call to "out_of_memory(),
> and replaced "goto restart" with "goto nopage".
>
> At "nopage:" lable I have added a call to "schedule()" and then "return
> NULL" after "schedule()".
Bad idea - in the configuration you have, the system may need the
out-of-memory killer to free up memory, otherwise the system can
deadlock due to all memory being exhausted.
>
> I tried the modified kernel with a test application, the test application is
> mallocing memory in a loop. Unlike as expected the process gets killed. On
> second run of the same application I am getting the page allocation failure
> as expected but subsequently the system hangs.
>
> I am attaching the test application and the log herewith.
>
> I am getting this exception with kernel 2.6.13. With kernel
> 2.4.19-rmka7-pxa1 there was no problem.
>
> Why its so? What can I do to alleviate the OOM problem?
Please see Documentation/vm/overcommit-accounting in the kernel source tree.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 06:23:46 von abum
Hi,
I tried with the /proc/sys/vm/overcommit_memory=2 and the system refused to
load the program altogether.
In this scenario is making overcommit_memory=2 a good idea?
Regards,
Abu.
-----Original Message-----
From: Robert Hancock [mailto:hancockr@shaw.ca]
Sent: Saturday, July 08, 2006 11:36 PM
To: Abu M. Muttalib
Cc: kernelnewbies@nl.linux.org; linux-newbie@vger.kernel.org;
linux-kernel@vger.kernel.org; linux-mm
Subject: Re: Commenting out out_of_memory() function in __alloc_pages()
Abu M. Muttalib wrote:
> Hi,
>
> I am getting the Out of memory.
>
> To circumvent the problem, I have commented the call to "out_of_memory(),
> and replaced "goto restart" with "goto nopage".
>
> At "nopage:" lable I have added a call to "schedule()" and then "return
> NULL" after "schedule()".
Bad idea - in the configuration you have, the system may need the
out-of-memory killer to free up memory, otherwise the system can
deadlock due to all memory being exhausted.
>
> I tried the modified kernel with a test application, the test application
is
> mallocing memory in a loop. Unlike as expected the process gets killed. On
> second run of the same application I am getting the page allocation
failure
> as expected but subsequently the system hangs.
>
> I am attaching the test application and the log herewith.
>
> I am getting this exception with kernel 2.6.13. With kernel
> 2.4.19-rmka7-pxa1 there was no problem.
>
> Why its so? What can I do to alleviate the OOM problem?
Please see Documentation/vm/overcommit-accounting in the kernel source tree.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
Re: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 07:18:22 von Chase Venters
On Saturday 08 July 2006 23:23, Abu M. Muttalib wrote:
> Hi,
>
> I tried with the /proc/sys/vm/overcommit_memory=2 and the system refused to
> load the program altogether.
>
> In this scenario is making overcommit_memory=2 a good idea?
(Good mailing list practices ask you not to top-post - that is, make your
reply text follow the text you are replying other than appearing before it,
as I demonstrate here:)
Well, how much memory do you have? Does the application actually need more
memory than your system can provide? If this is the case, there isn't going
to be any fix except add more memory. Your choices are:
1. Let the OOM killer sacrifice processes because you don't have enough memory
2. Disable VM overcommit so that the OOM killer doesn't get engaged (rather,
the application's attempt to grab the memory will fail)
3. Add more memory, don't mess with the overcommit sysctl, and watch things
work nicely :P
Are you sure it's not a memory leak? Does the application work on a freshly
booted system?
> Regards,
> Abu.
Thanks,
Chase
> -----Original Message-----
> From: Robert Hancock [mailto:hancockr@shaw.ca]
> Sent: Saturday, July 08, 2006 11:36 PM
> To: Abu M. Muttalib
> Cc: kernelnewbies@nl.linux.org; linux-newbie@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-mm
> Subject: Re: Commenting out out_of_memory() function in __alloc_pages()
>
> Abu M. Muttalib wrote:
> > Hi,
> >
> > I am getting the Out of memory.
> >
> > To circumvent the problem, I have commented the call to "out_of_memory(),
> > and replaced "goto restart" with "goto nopage".
> >
> > At "nopage:" lable I have added a call to "schedule()" and then "return
> > NULL" after "schedule()".
>
> Bad idea - in the configuration you have, the system may need the
> out-of-memory killer to free up memory, otherwise the system can
> deadlock due to all memory being exhausted.
>
> > I tried the modified kernel with a test application, the test application
>
> is
>
> > mallocing memory in a loop. Unlike as expected the process gets killed.
> > On second run of the same application I am getting the page allocation
>
> failure
>
> > as expected but subsequently the system hangs.
> >
> > I am attaching the test application and the log herewith.
> >
> > I am getting this exception with kernel 2.6.13. With kernel
> > 2.4.19-rmka7-pxa1 there was no problem.
> >
> > Why its so? What can I do to alleviate the OOM problem?
>
> Please see Documentation/vm/overcommit-accounting in the kernel source
> tree.
>
> --
> Robert Hancock Saskatoon, SK, Canada
> To email, remove "nospam" from hancockr@nospamshaw.ca
> Home Page: http://www.roberthancock.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 08:11:22 von abum
Hi,
>>
>> I tried with the /proc/sys/vm/overcommit_memory=2 and the system refused
to
>> load the program altogether.
>>
>> In this scenario is making overcommit_memory=2 a good idea?
>
>(Good mailing list practices ask you not to top-post - that is, make your
>reply text follow the text you are replying other than appearing before it,
>as I demonstrate here:)
>
Hope this time round I am following the std practice. :-)
>
>Well, how much memory do you have? Does the application actually need more
>memory than your system can provide? If this is the case, there isn't going
>to be any fix except add more memory. Your choices are:
>
>1. Let the OOM killer sacrifice processes because you don't have enough
memory
>2. Disable VM overcommit so that the OOM killer doesn't get engaged
(rather,
>the application's attempt to grab the memory will fail)
>3. Add more memory, don't mess with the overcommit sysctl, and watch things
>work nicely :P
>Are you sure it's not a memory leak? Does the application work on a freshly
>booted system?
I have a total of 16 MB RAM. My main concern is that I was running the same
set of applications earlier on linux-2.4.19-rmk7-pxa1 and didn't get any out
of memory. I am running the same application and get the OOM, though the
appearance is not uniform, at times it comes on a freshly booted system and
at times it didn't come when the system is on overnight.... Why I am getting
here??? Is there any problem with linux-2.6.13?
I have tried to check the application for memory leak with no success. There
seems to be no memory leak.
>Thanks,
>Chase
Regards,
Abu.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 09:55:10 von Chase Venters
On Sunday 09 July 2006 01:10, Abu M. Muttalib wrote:
> I have a total of 16 MB RAM. My main concern is that I was running the same
> set of applications earlier on linux-2.4.19-rmk7-pxa1 and didn't get any
> out of memory. I am running the same application and get the OOM, though
> the appearance is not uniform, at times it comes on a freshly booted system
> and at times it didn't come when the system is on overnight.... Why I am
> getting here??? Is there any problem with linux-2.6.13?
I'm just guessing now, but it's possible that the default thresholds have
changed from 2.4.19 to 2.6.13 (indeed, the amount of progress between those
two versions is more than some OS kernels have seen in their lifetime).
You might look at Documentation/sysctl/vm.txt and check those settings on
2.4.19 versus 2.6.13.
What application are you having trouble with?
> I have tried to check the application for memory leak with no success.
> There seems to be no memory leak.
>
> >Thanks,
> >Chase
>
> Regards,
> Abu.
Thanks,
Chase
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 13:48:06 von abum
>It will refuse to load the program if that would use enough memory that
>the system cannot be sure it will not run out of memory having done so.
>You probably need a lot more swap.
thanks for ur reply..
but I am running the application on an embedded device and have no swap..
what do I need to do in this case??
Regards,
Abu.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 13:55:07 von Alan Cox
Ar Sul, 2006-07-09 am 09:53 +0530, ysgrifennodd Abu M. Muttalib:
> Hi,
>
> I tried with the /proc/sys/vm/overcommit_memory=2 and the system refused to
> load the program altogether.
>
> In this scenario is making overcommit_memory=2 a good idea?
It will refuse to load the program if that would use enough memory that
the system cannot be sure it will not run out of memory having done so.
You probably need a lot more swap.
Re: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 14:01:38 von Willy Tarreau
On Sun, Jul 09, 2006 at 05:18:06PM +0530, Abu M. Muttalib wrote:
> >It will refuse to load the program if that would use enough memory that
> >the system cannot be sure it will not run out of memory having done so.
> >You probably need a lot more swap.
>
> thanks for ur reply..
>
> but I am running the application on an embedded device and have no swap..
>
> what do I need to do in this case??
Then try to increase the overcommit_ratio in /proc/sys/vm. Maybe the default
is not enough for your application. My web server has 32 MB and was regularly
crashing when too many apache processes were sollicitated, so I have set the
overcommit_memory to 2 and overcommit_ratio to 95 (huge but stable in this
particular workload). Now it works reasonably well.
Also, you should be aware of the side effects of overcommit. When you're
close to the limits, the system will refuse to fork processes, and various
applications might suddenly get NULL pointers in return from malloc(). And
I can tell you that this behaviour has become rare for so long a time that
rare are the programs which do not segfault when malloc() returns NULL !
If you develop all your programs, you should preallocate memory as much as
possible in order to ensure that once started, they will always work. Also
be careful about libc's function which allocate memory upon first call.
I've had problems with localtime() in the past.
> Regards,
> Abu.
Regards,
Willy
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 14:03:22 von abum
>Use less memory ?
>
>You can play with /proc/sys/vm/overcommit_ratio. That is set at 50%
>which is usually a good safe value with swap. If you know the kernel and
>kernel memory will be 20% of memory worst case you can set it to 80 and
>so on.
Thanks again.
Can you please elaborate again on the last line!.
Regards,
Abu.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 14:03:54 von Nick Piggin
Alan Cox wrote:
> Ar Sul, 2006-07-09 am 17:18 +0530, ysgrifennodd Abu M. Muttalib:
>
>>but I am running the application on an embedded device and have no swap..
>>what do I need to do in this case??
>
>
> Use less memory ?
Abu, I guess you have turned on CONFIG_EMBEDDED and disabled everything
you don't need, turned off full sized data structures, removed everything
else you don't need from the kernel config, turned off kernel debugging
(especially slab debugging).
If you still have problems, what does /proc/slabinfo tell you when running
your application under both 2.4 and 2.6?
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 14:09:57 von Alan Cox
Ar Sul, 2006-07-09 am 17:18 +0530, ysgrifennodd Abu M. Muttalib:
> but I am running the application on an embedded device and have no swap..
> what do I need to do in this case??
Use less memory ?
You can play with /proc/sys/vm/overcommit_ratio. That is set at 50%
which is usually a good safe value with swap. If you know the kernel and
kernel memory will be 20% of memory worst case you can set it to 80 and
so on.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 14:13:11 von abum
Thanks Willy for your reply..
In this context will you please help me understand/give some pointer to
understand the various field in the output of /proc/meminfo!!
Anticipation and regards,
Abu.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 14:15:11 von Willy Tarreau
On Sun, Jul 09, 2006 at 05:43:11PM +0530, Abu M. Muttalib wrote:
> Thanks Willy for your reply..
>
> In this context will you please help me understand/give some pointer to
> understand the various field in the output of /proc/meminfo!!
It's explained in Documentation/filesystems/proc.txt. This file know far
more things than me :-)
> Anticipation and regards,
> Abu.
Regards,
willy
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 15:12:23 von abum
>It's explained in Documentation/filesystems/proc.txt. This file know far
>ore things than me :-)
I tried with overcommit_ratio=100 and overcommit_memory=2 in that sequence.
but the applications were killed. :-(
Regards,
Abu.
Re: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 15:23:52 von Willy Tarreau
On Sun, Jul 09, 2006 at 06:42:23PM +0530, Abu M. Muttalib wrote:
> >It's explained in Documentation/filesystems/proc.txt. This file know far
> >ore things than me :-)
>
> I tried with overcommit_ratio=100 and overcommit_memory=2 in that sequence.
>
> but the applications were killed. :-(
If you set it too high, the system will never fail a malloc() and the memory
will quickly be grabbed by memory eaters, thus quickly resulting in OOM. This
is the default behaviour.
If you set it too low, the system will fail malloc() calls eventhough there
might be enough memory left, so you cannot start new processes.
Setting it to an intermediate value helps the system manage its ressources
and helps applications know that they must be smart with their memory usage.
For instance, if your application has something like a garbage collector or
can automatically reduce its buffers when memory becomes scarce, then it
will be helped by a lower overcommit_ratio. If your application does not
run as root, you might also try to play with ulimit -v before starting it.
I use this in my load balancing reverse proxy to restrain memory usage
without impacting the rest of the system.
Memory tuning in constrainted environments is like rocket science. You need
some evaluations then to make a lot of experimentations. There is no rule
which will work for everyone. But it seems to me that your application is
not very resistant in those environments. Maybe 2.4.19 was very close to
the ressource limit and now 2.6.13 has crossed the boundary. You can also
try to play with the -tiny patches (merged around 2.6.15 IIRC) to reduce
the kernel's memory usage.
> Regards,
> Abu.
Regards,
Willy
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 16:34:52 von abum
>Abu, I guess you have turned on CONFIG_EMBEDDED and disabled everything
>you don't need, turned off full sized data structures, removed everything
>else you don't need from the kernel config, turned off kernel debugging
>(especially slab debugging).
Do you mean that I have configured kernel with CONFIG_EMBEDDED option??
>If you still have problems, what does /proc/slabinfo tell you when running
>your application under both 2.4 and 2.6?
Will find out the differences..
Regards,
Abu.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Commenting out out_of_memory() function in __alloc_pages()
am 09.07.2006 17:15:37 von Nick Piggin
Abu M. Muttalib wrote:
>>Abu, I guess you have turned on CONFIG_EMBEDDED and disabled everything
>>you don't need, turned off full sized data structures, removed everything
>>else you don't need from the kernel config, turned off kernel debugging
>>(especially slab debugging).
>
>
> Do you mean that I have configured kernel with CONFIG_EMBEDDED option??
I am guessing you have, if you a concerned about memory usage. Have you?
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 11.07.2006 16:57:07 von abum
The funniest part is that with memset commented out_of_memory observed,
contrary to my expectation.
I don't know why. It shouldn't have. I am running the application on an ARM
target.
Regards,
Abu.
-----Original Message-----
From: Robin Holt [mailto:holt@sgi.com]
Sent: Friday, July 07, 2006 3:25 PM
To: Abu M. Muttalib
Cc: kernelnewbies@nl.linux.org; linux-newbie@vger.kernel.org;
linux-kernel@vger.kernel.org; linux-mm
Subject: Re: Commenting out out_of_memory() function in __alloc_pages()
I am not sure about x86, but on ia64, you would be very hard pressed
for this application to actually run you out of memory. With the
memset commented out, you would be allocating vmas, etc, but you
would not be actually putting pages behind those virtual addresses.
Thanks,
Robin
--------------------------- test1.c ----------------------------------
#include
#include
main()
{
char* buff;
int count;
count=0;
while(1)
{
printf("\nOOM Test: Counter = %d", count);
buff = (char*) malloc(1024);
// memset(buff,'\0',1024);
count++;
if (buff==NULL)
{
printf("\nOOM Test: Memory allocation error");
}
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 11.07.2006 17:08:54 von abum
I am not sure about x86, but on ia64, you would be very hard pressed
for this application to actually run you out of memory. With the
memset commented out, you would be allocating vmas, etc, but you
would not be actually putting pages behind those virtual addresses.
--------------------------- test1.c ----------------------------------
#include
#include
main()
{
char* buff;
int count;
count=0;
while(1)
{
printf("\nOOM Test: Counter = %d", count);
buff = (char*) malloc(1024);
// memset(buff,'\0',1024);
count++;
if (buff==NULL)
{
printf("\nOOM Test: Memory allocation error");
}
}
}
--------------------------- test1.c ----------------------------------
>The funniest part is that with memset commented out_of_memory observed,
contrary to my expectation.
>
>I don't know why. It shouldn't have. I am running the application on an ARM
target.
>Regards,
>Abu.
I fail to understand that why the OS doesn't return NULL as per man pages of
malloc. It insteat results in OOM.
~Abu.
RE: Commenting out out_of_memory() function in __alloc_pages()
am 11.07.2006 17:19:14 von abum
Where the function alloc_pages is defined? A silly question, but I am not
able to find out.
Please help.
Thanks and regards,
~Abu.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
RE: Commenting out out_of_memory() function in __alloc_pages()
am 11.07.2006 17:35:58 von Chase Venters
On Tue, 11 Jul 2006, Abu M. Muttalib wrote:
>
> I fail to understand that why the OS doesn't return NULL as per man pages of
> malloc. It insteat results in OOM.
Well, my "malloc" manpage describes the Linux behavior under "Bugs",
though it gives the overcommit practice a harsh and unfair treatment. Let
me give you an example of why the OS behaves in this way.
Say I've got an Apache web server that is going to fork() 10 children.
Under traditional fork() semantics, you need 10 copies of all of the
memory holding stuff like configuration structures, etc. There are two
reasons why we might not want 10 copies:
1. Some of those pages of data won't change. So why have 10 copies that
you're going to have to constantly move in and out of cache?
2. Why waste that memory in the first place?
Now, if we were just worried about #1, we could "reserve" room for 9
copies and still share the single copy (in a CoW scheme). But the act of
reserving the room would probably just slow fork() down needlessly (when
fork() is one of the most common and possibly expensive system calls).
Now apps get overcommitted memory too because they do things like ask for
a ton of memory and then not use it, or use it gradually... in either
case, Linux (by default) gambles that it can make better choices.
And it turns out that in 999 out of 1000 cases, it can.
If you want strict malloc(), you can use the sysctl to turn off
overcommit. It's even appropriate to do so for certain applications.
> ~Abu.
>
Thanks,
Chase
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Commenting out out_of_memory() function in __alloc_pages()
am 13.07.2006 07:12:36 von Mouhammad Tayseer Alquoatli
------=_Part_4430_24293665.1152767556236
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
On 7/11/06, Abu M. Muttalib wrote:
>
> Where the function alloc_pages is defined? A silly question, but I am not
> able to find out.
Hi
it's defined in /include/linux/gfp.h
>
>
--
Mouhammad Tayseer Alquoatli
------=_Part_4430_24293665.1152767556236
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
On 7/11/06, Abu M. Muttalib <> wrote:
Where the function alloc_pages is defined? A silly question, but I am not
able to find out.
Hi
it's defined in /include/linux/gfp.h
--
Mouhammad Tayseer Alquoatli
------=_Part_4430_24293665.1152767556236--
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
RE: Commenting out out_of_memory() function in __alloc_pages()
am 24.07.2006 11:44:39 von abum
Hi,
In the same context I want to know whether kernel 2.6.13 broken?
I got oom, and as per the documentation and code of out_of_memory, all the
processes, which share the same memory address as the process chosen to be
killed, i.e. threads, will be killed. But in my case its not the case
always.
At times the process chosen, "Angelia", is killed will all its threads but
at other times, only some of the threads get killed and the print from oom
killer (function out_of_memory) comes repeatedly but no process is killed.
Why its so?
Anticipation and regards,
Abu.
------------------------------------------------------------ ----------------
------------------------------------------------------------ ----
oom-killer: gfp_mask=0x201d0, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:1
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 712kB (0kB HighMem)
Active:1359 inactive:122 dirty:0 writeback:0 unstable:0 free:178 slab:469
mapped:1244 pagetables:452
DMA free:712kB min:512kB low:640kB high:768kB active:5436kB inactive:488kB
present:16384kB pages_scanned:5261 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 48*4kB 7*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
712kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
285 free pages
631 reserved pages
469 slab pages
950 pages shared
0 pages swap cached
Out of Memory: Killed process 1137 (Angelia).
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:1
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 712kB (0kB HighMem)
Active:1308 inactive:173 dirty:0 writeback:0 unstable:0 free:178 slab:469
mapped:1244 pagetables:452
DMA free:712kB min:512kB low:640kB high:768kB active:5232kB inactive:692kB
present:16384kB pages_scanned:7971 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 48*4kB 7*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
712kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
285 free pages
631 reserved pages
469 slab pages
950 pages shared
0 pages swap cached
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:1
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 712kB (0kB HighMem)
Active:1308 inactive:173 dirty:0 writeback:0 unstable:0 free:178 slab:469
mapped:1244 pagetables:452
DMA free:712kB min:512kB low:640kB high:768kB active:5232kB inactive:692kB
present:16384kB pages_scanned:7971 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 48*4kB 7*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
712kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
285 free pages
631 reserved pages
469 slab pages
950 pages shared
0 pages swap cached
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:0
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 512kB (0kB HighMem)
Active:1314 inactive:232 dirty:0 writeback:0 unstable:0 free:128 slab:470
mapped:1250 pagetables:452
DMA free:512kB min:512kB low:640kB high:768kB active:5256kB inactive:928kB
present:16384kB pages_scanned:7971 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 6*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
512kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
234 free pages
631 reserved pages
470 slab pages
989 pages shared
0 pages swap cached
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:0
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 512kB (0kB HighMem)
Active:1314 inactive:232 dirty:0 writeback:0 unstable:0 free:128 slab:470
mapped:1250 pagetables:452
DMA free:512kB min:512kB low:640kB high:768kB active:5256kB inactive:928kB
present:16384kB pages_scanned:7971 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 6*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
512kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
234 free pages
631 reserved pages
470 slab pages
989 pages shared
0 pages swap cached
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:0
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 512kB (0kB HighMem)
Active:1314 inactive:232 dirty:0 writeback:0 unstable:0 free:128 slab:470
mapped:1250 pagetables:452
DMA free:512kB min:512kB low:640kB high:768kB active:5256kB inactive:928kB
present:16384kB pages_scanned:7971 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 6*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
512kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
234 free pages
631 reserved pages
470 slab pages
989 pages shared
0 pages swap cached
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:0
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 512kB (0kB HighMem)
Active:1314 inactive:232 dirty:0 writeback:0 unstable:0 free:128 slab:470
mapped:1250 pagetables:452
DMA free:512kB min:512kB low:640kB high:768kB active:5256kB inactive:928kB
present:16384kB pages_scanned:7971 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 6*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
512kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
234 free pages
631 reserved pages
470 slab pages
989 pages shared
0 pages swap cached
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:0
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 512kB (0kB HighMem)
Active:1314 inactive:232 dirty:0 writeback:0 unstable:0 free:128 slab:470
mapped:1250 pagetables:452
DMA free:512kB min:512kB low:640kB high:768kB active:5256kB inactive:928kB
present:16384kB pages_scanned:7971 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 6*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
512kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
234 free pages
631 reserved pages
470 slab pages
989 pages shared
0 pages swap cached
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:0
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 512kB (0kB HighMem)
Active:1347 inactive:203 dirty:0 writeback:0 unstable:0 free:128 slab:470
mapped:1250 pagetables:452
DMA free:512kB min:512kB low:640kB high:768kB active:5388kB inactive:812kB
present:16384kB pages_scanned:8037 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 6*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
512kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
234 free pages
631 reserved pages
470 slab pages
985 pages shared
0 pages swap cached
oom-killer: gfp_mask=0x201d2, order=0
Mem-info:
DMA per-cpu:
cpu 0 hot: low 2, high 6, batch 1 used:2
cpu 0 cold: low 0, high 2, batch 1 used:0
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 512kB (0kB HighMem)
Active:1347 inactive:203 dirty:0 writeback:0 unstable:0 free:128 slab:470
mapped:1250 pagetables:452
DMA free:512kB min:512kB low:640kB high:768kB active:5388kB inactive:812kB
present:16384kB pages_scanned:8037 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 0*4kB 6*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 0*512kB 0*1024kB =
512kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
4096 pages of RAM
234 free pages
631 reserved pages
470 slab pages
985 pages shared
0 pages swap cached
------------------------------------------------------------ ----------------
------------------------------------------------------------ ----