Re: [Bisected Regression in 2.6.35] A full tmpfs filesystem causeshibernation to hang

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: KOSAKI Motohiro
Date: Tuesday, August 31, 2010 - 5:48 pm

> === 8< ===

Rafael, this log mean hibernate_preallocate_memory() has a bug.
It allocate memory as following order.
 1. preallocate_image_highmem()  (i.e. __GFP_HIGHMEM)
 2. preallocate_image_memory()   (i.e. GFP_KERNEL)
 3. preallocate_highmem_fraction (i.e. __GFP_HIGHMEM)
 4. preallocate_image_memory()   (i.e. GFP_KERNEL)

But, please imazine following scenario (as Vefa's scenario).
 - system has 3GB memory. 1GB is normal. 2GB is highmem.
 - all normal memory is free
 - 1.5GB memory of highmem are used for tmpfs. rest 500MB is free.

At that time, hibernate_preallocate_memory() works as following.

1. call preallocate_image_highmem(1GB)
2. call preallocate_image_memory(500M)		total 1.5GB allocated
3. call preallocate_highmem_fraction(660M)	total 2.2GB allocated

then, all of normal zone memory was exhaust. next preallocate_image_memory()
makes OOM, and oom_killer_disabled makes infinite loop.
(oom_killer_disabled careless is vmscan bug. I'll fix it soon)

The problem is, alloc_pages(__GFP_HIGHMEM) -> alloc_pages(GFP_KERNEL) is
wrong order. alloc_pages(__GFP_HIGHMEM) may allocate page from lower zone.
then, next alloc_pages(GFP_KERNEL) lead to OOM.

Please consider alloc_pages(GFP_KERNEL) -> alloc_pages(__GFP_HIGHMEM) order.
Even though vmscan fix can avoid infinite loop, OOM situation might makes
big slow down on highmem machine. It seems no good.


Thanks.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [Bisected Regression in 2.6.35] A full tmpfs filesyste ..., Rafael J. Wysocki, (Wed Aug 25, 10:31 am)
Re: [Bisected Regression in 2.6.35] A full tmpfs filesyste ..., KOSAKI Motohiro, (Tue Aug 31, 5:48 pm)
Re: [Bisected Regression in 2.6.35] A full tmpfs filesyste ..., Rafael J. Wysocki, (Thu Sep 2, 12:57 pm)
Important news regarding the two different patches, M. Vefa Bicakci, (Mon Sep 6, 4:27 am)
Re: Important news regarding the two different patches, Rafael J. Wysocki, (Mon Sep 6, 11:43 am)
Re: [Bisected Regression in 2.6.35] A full tmpfs filesyste ..., Rafael J. Wysocki, (Mon Sep 6, 11:46 am)
Re: [Bisected Regression in 2.6.35] A full tmpfs filesyste ..., Rafael J. Wysocki, (Mon Sep 6, 12:54 pm)
Re: Important news regarding the two different patches, M. Vefa Bicakci, (Mon Sep 6, 6:34 pm)
Re: Important news regarding the two different patches, KOSAKI Motohiro, (Mon Sep 6, 6:58 pm)
Re: Important news regarding the two different patches, Rafael J. Wysocki, (Tue Sep 7, 2:44 pm)
Re: Important news regarding the two different patches, M. Vefa Bicakci, (Wed Sep 8, 5:56 am)
Re: PATCH: PM / Hibernate: Avoid hitting OOM during preall ..., Rafael J. Wysocki, (Sat Sep 11, 12:06 pm)
[PATCH] PM / Hibernate: Make default image size depend on ..., Rafael J. Wysocki, (Sat Sep 11, 3:27 pm)
Re: [PATCH] PM / Hibernate: Make default image size depend ..., Rafael J. Wysocki, (Mon Sep 13, 10:52 am)