From: Pavel Tatashin <pasha.tatashin@oracle.com>
To: osalvador@techadventures.net
Cc: Steven Sistare <steven.sistare@oracle.com>,
Daniel Jordan <daniel.m.jordan@oracle.com>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
kirill.shutemov@linux.intel.com, Michal Hocko <mhocko@suse.com>,
Linux Memory Management List <linux-mm@kvack.org>,
dan.j.williams@intel.com, jack@suse.cz, jglisse@redhat.com,
Souptick Joarder <jrdr.linux@gmail.com>,
bhe@redhat.com, gregkh@linuxfoundation.org,
Vlastimil Babka <vbabka@suse.cz>,
Wei Yang <richard.weiyang@gmail.com>,
dave.hansen@intel.com, rientjes@google.com, mingo@kernel.org,
abdhalee@linux.vnet.ibm.com, mpe@ellerman.id.au
Subject: Re: [PATCH 2/3] mm: calculate deferred pages after skipping mirrored memory
Date: Wed, 25 Jul 2018 09:32:31 -0400 [thread overview]
Message-ID: <CAGM2reZJHc4NYFnQPxJ3wwYXAnicVSqZzndHHpZFeeKHAmzY2Q@mail.gmail.com> (raw)
In-Reply-To: <20180725121459.GA16987@techadventures.net>
On Wed, Jul 25, 2018 at 8:15 AM Oscar Salvador
<osalvador@techadventures.net> wrote:
>
> On Tue, Jul 24, 2018 at 07:55:19PM -0400, Pavel Tatashin wrote:
> > update_defer_init() should be called only when struct page is about to be
> > initialized. Because it counts number of initialized struct pages, but
> > there we may skip struct pages if there is some mirrored memory.
> >
> > So move, update_defer_init() after checking for mirrored memory.
> >
> > Also, rename update_defer_init() to defer_init() and reverse the return
> > boolean to emphasize that this is a boolean function, that tells that the
> > reset of memmap initialization should be deferred.
> >
> > Make this function self-contained: do not pass number of already
> > initialized pages in this zone by using static counters.
> >
> > Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
> > ---
> > mm/page_alloc.c | 40 ++++++++++++++++++++--------------------
> > 1 file changed, 20 insertions(+), 20 deletions(-)
> >
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index cea749b26394..86c678cec6bd 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -306,24 +306,28 @@ static inline bool __meminit early_page_uninitialised(unsigned long pfn)
> > }
> >
> > /*
> > - * Returns false when the remaining initialisation should be deferred until
> > + * Returns true when the remaining initialisation should be deferred until
> > * later in the boot cycle when it can be parallelised.
> > */
> > -static inline bool update_defer_init(pg_data_t *pgdat,
> > - unsigned long pfn, unsigned long zone_end,
> > - unsigned long *nr_initialised)
> > +static inline bool defer_init(int nid, unsigned long pfn, unsigned long end_pfn)
> > {
> > + static unsigned long prev_end_pfn, nr_initialised;
> > +
> > + if (prev_end_pfn != end_pfn) {
> > + prev_end_pfn = end_pfn;
> > + nr_initialised = 0;
> > + }
> Hi Pavel,
>
> What about a comment explaining that "if".
> I am not the brightest one, so it took me a bit to figure out that we got that "if" there
> because now that the variables are static, we need to somehow track whenever we change to
> another zone.
Hi Oscar,
Hm, yeah a comment would be appropriate here. I will send an updated
patch. I will also change the functions from inline to normal
functions as Andrew pointed out: it is not a good idea to use statics
in inline functions.
Thank you,
Pavel
next prev parent reply other threads:[~2018-07-25 13:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 23:55 [PATCH 0/3] memmap_init_zone improvements Pavel Tatashin
2018-07-24 23:55 ` [PATCH 1/3] mm: make memmap_init a proper function Pavel Tatashin
2018-07-26 7:50 ` Oscar Salvador
2018-07-24 23:55 ` [PATCH 2/3] mm: calculate deferred pages after skipping mirrored memory Pavel Tatashin
2018-07-25 1:12 ` Andrew Morton
2018-07-25 1:19 ` Pavel Tatashin
2018-07-25 1:31 ` Andrew Morton
2018-07-25 1:46 ` Pavel Tatashin
2018-07-25 21:30 ` Andrew Morton
2018-07-26 15:39 ` Pavel Tatashin
2018-07-25 12:14 ` Oscar Salvador
2018-07-25 13:32 ` Pavel Tatashin [this message]
2018-07-24 23:55 ` [PATCH 3/3] mm: move mirrored memory specific code outside of memmap_init_zone Pavel Tatashin
2018-07-25 1:18 ` Andrew Morton
2018-07-25 1:31 ` Pavel Tatashin
2018-07-25 11:48 ` Oscar Salvador
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=CAGM2reZJHc4NYFnQPxJ3wwYXAnicVSqZzndHHpZFeeKHAmzY2Q@mail.gmail.com \
--to=pasha.tatashin@oracle.com \
--cc=abdhalee@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=daniel.m.jordan@oracle.com \
--cc=dave.hansen@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=jglisse@redhat.com \
--cc=jrdr.linux@gmail.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=osalvador@techadventures.net \
--cc=richard.weiyang@gmail.com \
--cc=rientjes@google.com \
--cc=steven.sistare@oracle.com \
--cc=vbabka@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).