From: Daniel Vacek <neelx@redhat.com>
To: Michal Hocko <mhocko@kernel.org>, Paul Burton <paul.burton@imgtec.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Mel Gorman <mgorman@techsingularity.net>,
Pavel Tatashin <pasha.tatashin@oracle.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] mm/page_alloc: fix memmap_init_zone pageblock alignment
Date: Fri, 2 Mar 2018 11:54:51 +0100 [thread overview]
Message-ID: <CACjP9X9BVmr0wkrS5=oruQJFEs0ip7VFvD8rdWSZFcoYyiYB5A@mail.gmail.com> (raw)
In-Reply-To: <CACjP9X8hFDhkKUHRu2K5WgEp9YFHh2=vMSyM6KkZ5UZtxs7k-w@mail.gmail.com>
On Thu, Mar 1, 2018 at 5:20 PM, Daniel Vacek <neelx@redhat.com> wrote:
> On Thu, Mar 1, 2018 at 4:27 PM, Michal Hocko <mhocko@kernel.org> wrote:
>> It is still not clear why not to do the alignment in
>> memblock_next_valid_pfn rather than its caller.
>
> As it's the mem init which needs it to be aligned. Other callers may
> not, possibly?
> Not that there are any other callers at the moment so it really does
> not matter where it is placed. The only difference would be the end of
> the loop with end_pfn vs aligned end_pfn. And it looks like the pure
> (unaligned) end_pfn would be preferred here. Wanna me send a v2?
Thinking about it again memblock has nothing to do with pageblock. And
the function name suggests one shall get a next valid pfn, not
something totally unrelated to memblock. So that's what it returns.
It's the mem init which needs to align this and hence mem init aligns
it for it's purposes. I'd call this the correct design.
To deal with the end_pfn special case I'd actually get rid of it
completely and hardcode -1UL as max pfn instead (rather than 0).
Caller should handle max pfn as an error or end of the loop as here in
this case.
I'll send a v2 with this implemented.
Paul> Why is it based on memblock actually? Wouldn't a generic
mem_section solution work satisfiable for you? That would be natively
aligned with whole section (doing a bit more work as a result in the
end) and also independent of CONFIG_HAVE_MEMBLOCK_NODE_MAP
availability.
>> --
>> Michal Hocko
>> SUSE Labs
--
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>
next prev parent reply other threads:[~2018-03-02 10:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 12:47 Daniel Vacek
2018-03-01 13:10 ` Michal Hocko
2018-03-01 15:09 ` Daniel Vacek
2018-03-01 15:27 ` Michal Hocko
2018-03-01 16:20 ` Daniel Vacek
2018-03-01 23:21 ` Andrew Morton
2018-03-02 10:54 ` Daniel Vacek [this message]
2018-03-02 13:01 ` Michal Hocko
2018-03-02 15:27 ` Daniel Vacek
2018-03-01 17:24 ` Daniel Vacek
2018-03-02 11:01 ` [PATCH v2] " Daniel Vacek
2018-03-03 0:12 ` [PATCH v3 0/2] mm/page_alloc: fix kernel BUG at mm/page_alloc.c:1913! crash in move_freepages() Daniel Vacek
2018-03-03 0:12 ` [PATCH v3 1/2] mm/memblock: hardcode the end_pfn being -1 Daniel Vacek
2018-03-03 0:12 ` [PATCH v3 2/2] mm/page_alloc: fix memmap_init_zone pageblock alignment Daniel Vacek
2018-03-03 0:40 ` Andrew Morton
2018-03-03 1:08 ` Daniel Vacek
2018-03-12 12:26 ` Sudeep Holla
2018-03-12 14:49 ` Naresh Kamboju
2018-03-12 16:51 ` Daniel Vacek
2018-03-12 17:11 ` Sudeep Holla
2018-03-13 6:34 ` Naresh Kamboju
2018-03-13 22:47 ` Daniel Vacek
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='CACjP9X9BVmr0wkrS5=oruQJFEs0ip7VFvD8rdWSZFcoYyiYB5A@mail.gmail.com' \
--to=neelx@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=pasha.tatashin@oracle.com \
--cc=paul.burton@imgtec.com \
--cc=stable@vger.kernel.org \
--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