linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Young <dyoung@redhat.com>
To: Pavel Tatashin <pasha.tatashin@oracle.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: Fri, 1 Dec 2017 16:57:49 +0800	[thread overview]
Message-ID: <20171201085749.GB2291@dhcp-128-65.nay.redhat.com> (raw)
In-Reply-To: <CAOAebxti9DVyjb0dsR-E_8ULenaRf0OZ_WeWxppbdDVmFbt8mA@mail.gmail.com>

On 11/30/17 at 12:25pm, Pavel Tatashin wrote:
> 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?

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

Will resend with your suggestion along with patch log changes.

> 
> Thank you,
> Pavel

Thanks
Dave

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

      reply	other threads:[~2017-12-01  8:57 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
2017-12-01  8:57   ` Dave Young [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=20171201085749.GB2291@dhcp-128-65.nay.redhat.com \
    --to=dyoung@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@oracle.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