linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* setup_per_zone_pages_min(): zone->lock vs. zone->lru_lock
@ 2008-09-29 17:10 Gerald Schaefer
  2008-09-29 17:36 ` Andy Whitcroft
  0 siblings, 1 reply; 8+ messages in thread
From: Gerald Schaefer @ 2008-09-29 17:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, schwidefsky, heiko.carstens, KAMEZAWA Hiroyuki,
	Yasunori Goto, Mel Gorman, Andy Whitcroft, Andrew Morton

Hi,

is zone->lru_lock really the right lock to take in setup_per_zone_pages_min()?
All other functions in mm/page_alloc.c take zone->lock instead, for working
with page->lru free-list or PageBuddy().

setup_per_zone_pages_min() eventually calls move_freepages(), which is also
manipulating the page->lru free-list and checking for PageBuddy(). Both
should be protected by zone->lock instead of zone->lru_lock, if I understood
that right, or else there could be a race with the other functions in
mm/page_alloc.c.

We ran into a list corruption bug in free_pages_bulk() once, during memory
hotplug stress test, but cannot reproduce it easily. So I cannot verify if
using zone->lock instead of zone->lru_lock would fix it, but to me it looks
like this may be the problem.

Any thoughts?

BTW, I also wonder if a spin_lock_irq() would be enough, instead of
spin_lock_irqsave(), because this function should never be called from
interrupt context, right?

Thanks,
Gerald



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-10-02 10:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-29 17:10 setup_per_zone_pages_min(): zone->lock vs. zone->lru_lock Gerald Schaefer
2008-09-29 17:36 ` Andy Whitcroft
2008-09-29 21:20   ` Gerald Schaefer
2008-09-30  0:40     ` KAMEZAWA Hiroyuki
2008-09-30  1:53       ` Yasunori Goto
2008-10-01 17:39         ` [PATCH] setup_per_zone_pages_min(): take zone->lock instead of zone->lru_lock Gerald Schaefer
2008-10-02  5:49           ` KAMEZAWA Hiroyuki
2008-10-02 10:00           ` Yasunori Goto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).