From: Wei Yang <richard.weiyang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
hughd@google.com, pasha.tatashin@oracle.com, mgorman@suse.de,
linux-mm@kvack.org
Subject: Re: [RFC PATCH] mm: update highest_memmap_pfn based on exact pfn
Date: Thu, 29 Nov 2018 02:08:25 +0000 [thread overview]
Message-ID: <20181129020825.3zezgscg3nilfssy@master> (raw)
In-Reply-To: <20181128150052.6c00403395ca3c9654341a94@linux-foundation.org>
On Wed, Nov 28, 2018 at 03:00:52PM -0800, Andrew Morton wrote:
>On Wed, 28 Nov 2018 16:36:34 +0800 Wei Yang <richard.weiyang@gmail.com> wrote:
>
>> When DEFERRED_STRUCT_PAGE_INIT is set, page struct will not be
>> initialized all at boot up. Some of them is postponed to defer stage.
>> While the global variable highest_memmap_pfn is still set to the highest
>> pfn at boot up, even some of them are not initialized.
>>
>> This patch adjust this behavior by update highest_memmap_pfn with the
>> exact pfn during each iteration. Since each node has a defer thread,
>> introduce a spin lock to protect it.
>>
>
>Does this solve any known problems? If so then I'm suspecting that
>those problems go deeper than this.
Corrently I don't see any problem.
>
>Why use a spinlock rather than an atomic_long_t?
Sorry for my shortage in knowledge. I am not sure how to compare and
change a value atomicly. cmpxchg just could compare the exact value.
>
>Perhaps this check should instead be built into pfn_valid()?
I think the original commit 22b31eec63e5 ('badpage: vm_normal_page use
print_bad_pte') introduce highest_memmap_pfn to make pfn_valid()
cheaper.
Some definition of pfn_valid() is :
#define pfn_valid(pfn) ((pfn) < max_pfn)
Which doesn't care about the exact presented or memmap-ed page.
I am not for sure all pfn_valid() could leverage this. One thing for
sure is there are only two users of highest_memmap_pfn
* vm_normal_page_pmd
* _vm_normal_page
--
Wei Yang
Help you, Help me
prev parent reply other threads:[~2018-11-29 2:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 8:36 Wei Yang
2018-11-28 23:00 ` Andrew Morton
2018-11-29 2:08 ` Wei Yang [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=20181129020825.3zezgscg3nilfssy@master \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--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