[withdrawn] mm-page_alloc-store-updated-page-migratetype-to-avoid-misusing-stale-value.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: page_alloc: store updated page migratetype to avoid misusing stale value
has been removed from the -mm tree.  Its filename was
     mm-page_alloc-store-updated-page-migratetype-to-avoid-misusing-stale-value.patch

This patch was dropped because it was withdrawn

------------------------------------------------------
From: Weijie Yang <weijie.yang@xxxxxxxxxxx>
Subject: mm: page_alloc: store updated page migratetype to avoid misusing stale value

Commit ad53f92e ("fix incorrect isolation behavior by rechecking
migratetype") patch series describe the race between page isolation and
free path, and try to fix the freepage account issues.

However, there is still a little issue: freed page could have stale
migratetype in the free_list.  This would cause some bad behavior if we
misuse this stale value later.

Such as: in __test_page_isolated_in_pageblock() we check the buddy page,
if the page's stale migratetype is not MIGRATE_ISOLATE, which will cause
unnecessary page move action.

This patch stores the page's updated migratetype after freeing the page to
the free_list to avoid subsequent misusing stale value, and uses a
WARN_ON_ONCE to catch a potential undetected race between isolation and
free path.

[akpm@xxxxxxxxxxxxxxxxxxxx: fix comment]
Signed-off-by: Weijie Yang <weijie.yang@xxxxxxxxxxx>
Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxx>
Cc: Rik van Riel <riel@xxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Minchan Kim <minchan@xxxxxxxxxx>
Cc: Michal Nazarewicz <mina86@xxxxxxxxxx>
Cc: Vlastimil Babka <vbabka@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/page_alloc.c     |    1 +
 mm/page_isolation.c |   17 +++++------------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff -puN mm/page_alloc.c~mm-page_alloc-store-updated-page-migratetype-to-avoid-misusing-stale-value mm/page_alloc.c
--- a/mm/page_alloc.c~mm-page_alloc-store-updated-page-migratetype-to-avoid-misusing-stale-value
+++ a/mm/page_alloc.c
@@ -627,6 +627,7 @@ static inline void __free_one_page(struc
 	}
 
 	list_add(&page->lru, &zone->free_area[order].free_list[migratetype]);
+	set_freepage_migratetype(page, migratetype);
 out:
 	zone->free_area[order].nr_free++;
 }
diff -puN mm/page_isolation.c~mm-page_alloc-store-updated-page-migratetype-to-avoid-misusing-stale-value mm/page_isolation.c
--- a/mm/page_isolation.c~mm-page_alloc-store-updated-page-migratetype-to-avoid-misusing-stale-value
+++ a/mm/page_isolation.c
@@ -226,19 +226,12 @@ __test_page_isolated_in_pageblock(unsign
 		page = pfn_to_page(pfn);
 		if (PageBuddy(page)) {
 			/*
-			 * If race between isolatation and allocation happens,
-			 * some free pages could be in MIGRATE_MOVABLE list
-			 * although pageblock's migratation type of the page
-			 * is MIGRATE_ISOLATE. Catch it and move the page into
-			 * MIGRATE_ISOLATE list.
+			 * Use a WARN_ON_ONCE to catch a potential undetected
+			 * race between isolation and pages freeing, even though
+			 * we try to avoid this issue.
 			 */
-			if (get_freepage_migratetype(page) != MIGRATE_ISOLATE) {
-				struct page *end_page;
-
-				end_page = page + (1 << page_order(page)) - 1;
-				move_freepages(page_zone(page), page, end_page,
-						MIGRATE_ISOLATE);
-			}
+			WARN_ON_ONCE(get_freepage_migratetype(page) !=
+					MIGRATE_ISOLATE);
 			pfn += 1 << page_order(page);
 		}
 		else if (page_count(page) == 0 &&
_

Patches currently in -mm which might be from weijie.yang@xxxxxxxxxxx are

mm-frontswap-invalidate-expired-data-on-a-dup-store-failure.patch
mm-page_isolation-check-pfn-validity-before-access.patch
mm-mincore-add-hwpoison-page-handle.patch
mm-mincore-add-hwpoison-page-handle-checkpatch-fixes.patch
mm-zram-correct-zram_zero-flag-bit-position.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux