linux/mm
Martin Bligh 3bb1a852ab [PATCH] vmscan: Fix temp_priority race
The temp_priority field in zone is racy, as we can walk through a reclaim
path, and just before we copy it into prev_priority, it can be overwritten
(say with DEF_PRIORITY) by another reclaimer.

The same bug is contained in both try_to_free_pages and balance_pgdat, but
it is fixed slightly differently.  In balance_pgdat, we keep a separate
priority record per zone in a local array.  In try_to_free_pages there is
no need to do this, as the priority level is the same for all zones that we
reclaim from.

Impact of this bug is that temp_priority is copied into prev_priority, and
setting this artificially high causes reclaimers to set distress
artificially low.  They then fail to reclaim mapped pages, when they are,
in fact, under severe memory pressure (their priority may be as low as 0).
This causes the OOM killer to fire incorrectly.

From: Andrew Morton <akpm@osdl.org>

__zone_reclaim() isn't modifying zone->prev_priority.  But zone->prev_priority
is used in the decision whether or not to bring mapped pages onto the inactive
list.  Hence there's a risk here that __zone_reclaim() will fail because
zone->prev_priority ir large (ie: low urgency) and lots of mapped pages end up
stuck on the active list.

Fix that up by decreasing (ie making more urgent) zone->prev_priority as
__zone_reclaim() scans the zone's pages.

This bug perhaps explains why ZONE_RECLAIM_PRIORITY was created.  It should be
possible to remove that now, and to just start out at DEF_PRIORITY?

Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-28 11:30:50 -07:00
..
Kconfig Fix "can not" in Documentation and Kconfig 2006-10-03 22:53:09 +02:00
Makefile [PATCH] separate bdi congestion functions from queue congestion functions 2006-10-20 10:26:35 -07:00
allocpercpu.c [PATCH] Extract the allocpercpu functions from the slab allocator 2006-09-26 08:48:51 -07:00
backing-dev.c [PATCH] separate bdi congestion functions from queue congestion functions 2006-10-20 10:26:35 -07:00
bootmem.c [PATCH] bootmem: use MAX_DMA_ADDRESS instead of LOW32LIMIT 2006-09-26 08:48:49 -07:00
bounce.c [PATCH] BLOCK: Separate the bounce buffering code from the highmem code [try #6] 2006-09-30 20:32:11 +02:00
fadvise.c [PATCH] fadvise() make POSIX_FADV_NOREUSE a no-op 2006-08-06 08:57:47 -07:00
filemap.c [PATCH] mm: clean up pagecache allocation 2006-10-28 11:30:50 -07:00
filemap.h Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
filemap_xip.c [PATCH] mark address_space_operations const 2006-06-28 14:59:04 -07:00
fremap.c [PATCH] paravirt: pte clear not present 2006-10-01 00:39:33 -07:00
highmem.c [PATCH] BLOCK: Separate the bounce buffering code from the highmem code [try #6] 2006-09-30 20:32:11 +02:00
hugetlb.c [PATCH] hugetlb: fix linked list corruption in unmap_hugepage_range() 2006-10-11 11:14:15 -07:00
internal.h [PATCH] mm: VM_BUG_ON 2006-09-26 08:48:44 -07:00
madvise.c [PATCH] Fix MADV_REMOVE protection checking 2006-04-17 18:22:18 -07:00
memory.c [PATCH] mm: D-cache aliasing issue in cow_user_page 2006-10-20 10:26:43 -07:00
memory_hotplug.c [PATCH] hot-add-mem x86_64: use CONFIG_MEMORY_HOTPLUG_RESERVE 2006-10-01 00:39:18 -07:00
mempolicy.c [PATCH] Fix do_mbind warning with CONFIG_MIGRATION=n 2006-10-11 11:14:19 -07:00
mempool.c [PATCH] dm: work around mempool_alloc, bio_alloc_bioset deadlocks 2006-09-01 11:39:09 -07:00
migrate.c [PATCH] BLOCK: Make it possible to disable the block layer [try #6] 2006-09-30 20:52:31 +02:00
mincore.c
mlock.c
mmap.c Fix VM_MAYEXEC calculation 2006-10-15 14:09:55 -07:00
mmzone.c [PATCH] mm/mmzone.c: EXPORT_UNUSED_SYMBOL 2006-07-10 13:24:17 -07:00
mprotect.c [PATCH] paravirt: lazy mmu mode hooks.patch 2006-10-01 00:39:33 -07:00
mremap.c [PATCH] paravirt: lazy mmu mode hooks.patch 2006-10-01 00:39:33 -07:00
msync.c [PATCH] mm: msync() cleanup 2006-09-26 08:48:45 -07:00
nommu.c Spelling fix: "control" instead of "cotrol" 2006-10-03 23:21:02 +02:00
oom_kill.c [PATCH] OOM killer meets userspace headers 2006-10-20 10:26:38 -07:00
page-writeback.c [PATCH] separate bdi congestion functions from queue congestion functions 2006-10-20 10:26:35 -07:00
page_alloc.c [PATCH] vmscan: Fix temp_priority race 2006-10-28 11:30:50 -07:00
page_io.c [PATCH] swsusp: read speedup 2006-09-26 08:48:58 -07:00
pdflush.c [PATCH] pdflush: handle resume wakeups 2006-06-25 10:01:06 -07:00
prio_tree.c
readahead.c Merge rsync://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-07-03 10:25:08 -04:00
rmap.c [PATCH] mm: more commenting on lock ordering 2006-10-20 10:26:44 -07:00
shmem.c [PATCH] separate bdi congestion functions from queue congestion functions 2006-10-20 10:26:35 -07:00
shmem_acl.c [PATCH] Fix typos in mm/shmem_acl.c 2006-10-11 11:14:23 -07:00
slab.c [PATCH] Slab: Do not fallback to nodes that have not been bootstrapped yet 2006-10-21 13:35:06 -07:00
slob.c [PATCH] Make kmem_cache_destroy() return void 2006-09-27 08:26:11 -07:00
sparse.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
swap.c [PATCH] mm/: make functions static 2006-09-26 08:48:45 -07:00
swap_state.c [PATCH] lockdep: locking init debugging improvement 2006-07-03 15:27:02 -07:00
swapfile.c [PATCH] valid_swaphandles() fix 2006-09-29 09:18:23 -07:00
thrash.c
tiny-shmem.c [PATCH] devfs: Remove the devfs_fs_kernel.h file from the tree 2006-06-26 12:25:08 -07:00
truncate.c [PATCH] invalidate: remove_mapping() fix 2006-10-17 08:18:43 -07:00
util.c [PATCH] slab: clean up leak tracking ifdefs a little bit 2006-10-04 07:55:13 -07:00
vmalloc.c [PATCH] vmalloc(): don't pass __GFP_ZERO to slab 2006-10-17 08:18:44 -07:00
vmscan.c [PATCH] vmscan: Fix temp_priority race 2006-10-28 11:30:50 -07:00
vmstat.c [PATCH] vmscan: Fix temp_priority race 2006-10-28 11:30:50 -07:00