]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mm: mark the correct zone as full when scanning zonelists
authorMel Gorman <mel@csn.ul.ie>
Sat, 13 Sep 2008 22:05:39 +0000 (22:05 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Oct 2008 03:22:49 +0000 (20:22 -0700)
commit6b546b3dbbc51800bdbd075da923288c6a4fe5af
tree17eab3f5545e37dc825c749603ee1d0e508d967e
parent36b560bfebe9f35a15d7069b3708a7ef7ad414d6
mm: mark the correct zone as full when scanning zonelists

commit 5bead2a0680687b9576d57c177988e8aa082b922 upstream

The iterator for_each_zone_zonelist() uses a struct zoneref *z cursor when
scanning zonelists to keep track of where in the zonelist it is.  The
zoneref that is returned corresponds to the the next zone that is to be
scanned, not the current one.  It was intended to be treated as an opaque
list.

When the page allocator is scanning a zonelist, it marks elements in the
zonelist corresponding to zones that are temporarily full.  As the
zonelist is being updated, it uses the cursor here;

  if (NUMA_BUILD)
        zlc_mark_zone_full(zonelist, z);

This is intended to prevent rescanning in the near future but the zoneref
cursor does not correspond to the zone that has been found to be full.
This is an easy misunderstanding to make so this patch corrects the
problem by changing zoneref cursor to be the current zone being scanned
instead of the next one.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/mmzone.h
mm/mmzone.c