This is a note to let you know that I've just added the patch titled
mm: vmscan: do not use page_count without a page pin
to the 2.6.39-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mm-vmscan-do-not-use-page_count-without-a-page-pin.patch
and it can be found in the queue-2.6.39 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From [email protected] Mon Aug 1 11:42:14 2011
From: Mel Gorman <[email protected]>
Date: Tue, 19 Jul 2011 10:15:50 +0100
Subject: mm: vmscan: do not use page_count without a page pin
To: [email protected]
Cc: Andrea Arcangeli <[email protected]>, Andrew Morton
<[email protected]>, Thomas Sattler <[email protected]>, Mel Gorman
<[email protected]>
Message-ID: <[email protected]>
From: Andrea Arcangeli <[email protected]>
commit: d179e84ba5da1d0024087d1759a2938817a00f3f upstream
It is unsafe to run page_count during the physical pfn scan because
compound_head could trip on a dangling pointer when reading
page->first_page if the compound page is being freed by another CPU.
[[email protected]: split out patch]
Signed-off-by: Andrea Arcangeli <[email protected]>
Signed-off-by: Mel Gorman <[email protected]>
Reviewed-by: Michal Hocko <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
mm/vmscan.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1114,8 +1114,20 @@ static unsigned long isolate_lru_pages(u
nr_lumpy_dirty++;
scan++;
} else {
- /* the page is freed already. */
- if (!page_count(cursor_page))
+ /*
+ * Check if the page is freed already.
+ *
+ * We can't use page_count() as that
+ * requires compound_head and we don't
+ * have a pin on the page here. If a
+ * page is tail, we may or may not
+ * have isolated the head, so assume
+ * it's not free, it'd be tricky to
+ * track the head status without a
+ * page pin.
+ */
+ if (!PageTail(cursor_page) &&
+ !atomic_read(&cursor_page->_count))
continue;
break;
}
Patches currently in stable-queue which might be from [email protected] are
queue-2.6.39/mm-vmscan-evaluate-the-watermarks-against-the-correct.patch
queue-2.6.39/mm-compaction-ensure-that-the-compaction-free-scanner-does-not-move-to-the-next-zone.patch
queue-2.6.39/mm-vmscan-do-not-apply-pressure-to-slab-if-we-are-not-applying-pressure-to-zone.patch
queue-2.6.39/mm-vmscan-do-not-use-page_count-without-a-page-pin.patch
queue-2.6.39/vmscan-fix-a-livelock-in-kswapd.patch
queue-2.6.39/mm-vmscan-correct-check-for-kswapd-sleeping-in.patch
queue-2.6.39/mm-compaction-abort-compaction-if-too-many-pages-are-isolated-and-caller-is-asynchronous-v2.patch
queue-2.6.39/mm-vmscan-only-read-new_classzone_idx-from-pgdat-when-reclaiming-successfully.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable