From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>,
Oscar Salvador <osalvador@suse.de>
Subject: Re: [PATCH v1 2/2] mm: factor out next_present_section_nr()
Date: Tue, 14 Jan 2020 18:52:58 +0300 [thread overview]
Message-ID: <20200114155258.kww5ve7agifxxtoy@box> (raw)
In-Reply-To: <4de17591-e2c4-daff-e4b2-d03dd8792d0f@redhat.com>
On Tue, Jan 14, 2020 at 11:49:19AM +0100, David Hildenbrand wrote:
> memmap_init_zone() is called for a physical memory region: pfn + size
> (nr_pages)
>
> The highest possible PFN you can have is "-1(unsigned long) >>
> PFN_SHIFT". So even if you would want to add the very last section, the
> PFN would still be smaller than -1UL << PFN_SECTION_SHIFT.
PFN_SHIFT? I guess you mean PAGE_SHIFT.
Of course PFN can be more than -1UL >> PAGE_SHIFT. Like on 32-bit x86 with
PAE it is ((1ULL << 36) - 1) >> PAGE_SHIFT. That's the whole reason for
PAE.
The highest possible PFN must fit into phys_addr_t when shifted left by
PAGE_SHIFT and must fit into unsigned long. It's can be -1UL if
phys_addr_t is 64-bit.
Any other limitation I miss?
--
Kirill A. Shutemov
next prev parent reply other threads:[~2020-01-14 15:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 14:40 [PATCH v1 0/2] mm/page_alloc: memmap_init_zone() cleanups David Hildenbrand
2020-01-13 14:40 ` [PATCH v1 1/2] mm/page_alloc: fix and rework pfn handling in memmap_init_zone() David Hildenbrand
2020-02-03 21:35 ` Alexander Duyck
2020-02-03 21:44 ` David Hildenbrand
2020-02-03 23:17 ` Alexander Duyck
2020-02-04 8:40 ` David Hildenbrand
2020-01-13 14:40 ` [PATCH v1 2/2] mm: factor out next_present_section_nr() David Hildenbrand
2020-01-13 22:41 ` Kirill A. Shutemov
2020-01-13 22:57 ` David Hildenbrand
2020-01-13 23:02 ` David Hildenbrand
2020-01-14 10:41 ` Kirill A. Shutemov
2020-01-14 10:49 ` David Hildenbrand
2020-01-14 15:52 ` Kirill A. Shutemov [this message]
2020-01-14 16:50 ` David Hildenbrand
2020-01-14 16:52 ` David Hildenbrand
2020-01-31 4:30 ` [PATCH v1 0/2] mm/page_alloc: memmap_init_zone() cleanups Andrew Morton
2020-02-03 14:49 ` Kirill A. Shutemov
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=20200114155258.kww5ve7agifxxtoy@box \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=osalvador@suse.de \
/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