From: David Rientjes <rientjes@google.com>
To: Li Zhong <zhong@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
linux-mm@kvack.org,
Nadia Yvette Chambers <nadia.yvette.chambers@gmail.com>
Subject: [patch] mm: fix potential infinite loop in dissolve_free_huge_pages() fix
Date: Tue, 29 Jul 2014 18:09:01 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.02.1407291806530.6967@chino.kir.corp.google.com> (raw)
In-Reply-To: <1406514043.2941.6.camel@TP-T420>
No legitimate reason to call dissolve_free_huge_pages() when
!hugepages_supported().
Signed-off-by: David Rientjes <rientjes@google.com>
---
To be folded into
mm-fix-potential-infinite-loop-in-dissolve_free_huge_pages.patch.
mm/hugetlb.c | 3 +++
mm/memory_hotplug.c | 3 +--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1088,6 +1088,9 @@ void dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn)
unsigned long pfn;
struct hstate *h;
+ if (!hugepages_supported())
+ return;
+
/* Set scan step to minimum hugepage size */
for_each_hstate(h)
if (order > huge_page_order(h))
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1726,8 +1726,7 @@ repeat:
* dissolve free hugepages in the memory block before doing offlining
* actually in order to make hugetlbfs's object counting consistent.
*/
- if (hugepages_supported())
- dissolve_free_huge_pages(start_pfn, end_pfn);
+ dissolve_free_huge_pages(start_pfn, end_pfn);
/* check again */
offlined_pages = check_pages_isolated(start_pfn, end_pfn);
if (offlined_pages < 0) {
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2014-07-30 1:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-24 9:36 [RFC PATCH]mm: fix potential infinite loop in dissolve_free_huge_pages() Li Zhong
2014-07-24 12:45 ` Naoya Horiguchi
2014-07-28 1:28 ` Li Zhong
2014-07-28 2:20 ` [PATCH v2]mm: " Li Zhong
2014-07-28 14:33 ` Naoya Horiguchi
2014-07-30 1:09 ` David Rientjes [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.02.1407291806530.6967@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=nadia.yvette.chambers@gmail.com \
--cc=zhong@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox