linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Tatashin <pasha.tatashin@oracle.com>
To: Dave Young <dyoung@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm: check pfn_valid first in zero_resv_unavail
Date: Thu, 30 Nov 2017 12:25:14 -0500	[thread overview]
Message-ID: <CAOAebxti9DVyjb0dsR-E_8ULenaRf0OZ_WeWxppbdDVmFbt8mA@mail.gmail.com> (raw)
In-Reply-To: <20171130060431.GA2290@dhcp-128-65.nay.redhat.com>

Hi Dave,

Because unavailable memory can be in the middle of a section, I think
a proper fix would be to do pfn_valid() check only at the beginning of
section. Otherwise, we might miss zeroing  a struct page is in the
middle of a section but pfn_valid() could potentially return false as
that page is indeed invalid.

So, I would do something like this:
+                       if (!pfn_valid(ALIGN_DOWN(pfn, pageblock_nr_pages))
+                               continue;

Could you please test if this fix works?

We should really look into this memory that is reserved by memblock
but Linux is not aware of physical backing, so far I know that only
x86 can have such scenarios, so we should really see if the problem
can be addressed on x86 platform. It would be very nice if we could
enforce inside memblock to reserve only memory that has real physical
backing.

Thank you,
Pavel

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

  parent reply	other threads:[~2017-11-30 17:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30  6:04 Dave Young
2017-11-30  9:35 ` Michal Hocko
2017-12-01  8:56   ` Dave Young
2017-12-01  9:19     ` Michal Hocko
2017-12-01  9:29       ` Dave Young
2017-12-01  9:42         ` Michal Hocko
2017-12-01  9:49           ` Dave Young
2017-11-30 17:25 ` Pavel Tatashin [this message]
2017-12-01  8:57   ` Dave Young

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=CAOAebxti9DVyjb0dsR-E_8ULenaRf0OZ_WeWxppbdDVmFbt8mA@mail.gmail.com \
    --to=pasha.tatashin@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dyoung@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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