mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-page_alloc-add-missing-check-for-memory-holes.patch added to -mm tree
@ 2017-03-07 23:48 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-03-07 23:48 UTC (permalink / raw)
  To: tony.luck, hannes, iamjoonsoo.kim, kirill.shutemov, mgorman,
	mhocko, mm-commits


The patch titled
     Subject: mm, page_alloc: add missing check for memory holes
has been added to the -mm tree.  Its filename is
     mm-page_alloc-add-missing-check-for-memory-holes.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-page_alloc-add-missing-check-for-memory-holes.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_alloc-add-missing-check-for-memory-holes.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Tony Luck <tony.luck@intel.com>
Subject: mm, page_alloc: add missing check for memory holes

13ad59df67f197 ("mm, page_alloc: avoid page_to_pfn() when merging
buddies") moved the check for memory holes out of page_is_buddy() and had
the callers do the check.

But this wasn't done correctly in one place which caused ia64 to crash
very early in boot.

Update to fix that and make ia64 boot again.

Fixes: 13ad59df67f1 ("avoid page_to_pfn() when merging buddies")
Link: http://lkml.kernel.org/r/1488929150-13629-1-git-send-email-tony.luck@intel.com
Signed-off-by: Tony Luck <tony.luck@intel.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/page_alloc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN mm/page_alloc.c~mm-page_alloc-add-missing-check-for-memory-holes mm/page_alloc.c
--- a/mm/page_alloc.c~mm-page_alloc-add-missing-check-for-memory-holes
+++ a/mm/page_alloc.c
@@ -873,7 +873,8 @@ done_merging:
 		higher_page = page + (combined_pfn - pfn);
 		buddy_pfn = __find_buddy_pfn(combined_pfn, order + 1);
 		higher_buddy = higher_page + (buddy_pfn - combined_pfn);
-		if (page_is_buddy(higher_page, higher_buddy, order + 1)) {
+		if (pfn_valid_within(page_to_pfn(higher_buddy)) &&
+		    page_is_buddy(higher_page, higher_buddy, order + 1)) {
 			list_add_tail(&page->lru,
 				&zone->free_area[order].free_list[migratetype]);
 			goto out;
_

Patches currently in -mm which might be from tony.luck@intel.com are

mm-page_alloc-add-missing-check-for-memory-holes.patch


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

only message in thread, other threads:[~2017-03-08  0:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 23:48 + mm-page_alloc-add-missing-check-for-memory-holes.patch added to -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).