mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [merged] mm-hugetlb-soft_offline-save-compound-page-order-before-page-migration.patch removed from -mm tree
@ 2017-10-04 19:40 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-10-04 19:40 UTC (permalink / raw)
  To: 00moses.alexander00, aarcange, hdanton, khandual,
	kirill.shutemov, mgorman, mhocko, minchan, mm-commits,
	n-horiguchi, riel, rientjes, rppt, shli, stable


The patch titled
     Subject: mm, hugetlb, soft_offline: save compound page order before page migration
has been removed from the -mm tree.  Its filename was
     mm-hugetlb-soft_offline-save-compound-page-order-before-page-migration.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Alexandru Moise <00moses.alexander00@gmail.com>
Subject: mm, hugetlb, soft_offline: save compound page order before page migration

This fixes a bug in madvise() where if you'd try to soft offline a
hugepage via madvise(), while walking the address range you'd end up,
using the wrong page offset due to attempting to get the compound order of
a former but presently not compound page, due to dissolving the huge page
(since c3114a8).

As a result I ended up with all my free pages except one being
offlined.

Link: http://lkml.kernel.org/r/20170912204306.GA12053@gmail.com
Fixes: c3114a84f7f9 ("mm: hugetlb: soft-offline: dissolve source hugepage after successful migration")
Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Shaohua Li <shli@fb.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: David Rientjes <rientjes@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/madvise.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN mm/madvise.c~mm-hugetlb-soft_offline-save-compound-page-order-before-page-migration mm/madvise.c
--- a/mm/madvise.c~mm-hugetlb-soft_offline-save-compound-page-order-before-page-migration
+++ a/mm/madvise.c
@@ -625,18 +625,26 @@ static int madvise_inject_error(int beha
 {
 	struct page *page;
 	struct zone *zone;
+	unsigned int order;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	for (; start < end; start += PAGE_SIZE <<
-				compound_order(compound_head(page))) {
+
+	for (; start < end; start += PAGE_SIZE << order) {
 		int ret;
 
 		ret = get_user_pages_fast(start, 1, 0, &page);
 		if (ret != 1)
 			return ret;
 
+		/*
+		 * When soft offlining hugepages, after migrating the page
+		 * we dissolve it, therefore in the second loop "page" will
+		 * no longer be a compound page, and order will be 0.
+		 */
+		order = compound_order(compound_head(page));
+
 		if (PageHWPoison(page)) {
 			put_page(page);
 			continue;
_

Patches currently in -mm which might be from 00moses.alexander00@gmail.com are

mm-madvise-enable-soft-offline-of-hugetlb-pages-at-pud-level.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-04 19:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 19:40 [merged] mm-hugetlb-soft_offline-save-compound-page-order-before-page-migration.patch removed from -mm tree akpm

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).