From: Zi Yan <ziy@nvidia.com>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Aneesh Kumar K V <aneesh.kumar@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>,
Minchan Kim <minchan@kernel.org>,
Vlastimil Babka <vbabka@suse.cz>,
linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org,
virtualization@lists.linux-foundation.org,
iommu@lists.linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH v1 2/2] mm: enforce pageblock_order < MAX_ORDER
Date: Mon, 14 Feb 2022 13:05:16 -0500 [thread overview]
Message-ID: <CBC1765F-6E95-45BB-8071-3574ED2E6EF4@nvidia.com> (raw)
In-Reply-To: <20220214174132.219303-3-david@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1912 bytes --]
On 14 Feb 2022, at 12:41, David Hildenbrand wrote:
> Some places in the kernel don't really expect pageblock_order >=
> MAX_ORDER, and it looks like this is only possible in corner cases:
>
> 1) CONFIG_DEFERRED_STRUCT_PAGE_INIT we'll end up freeing pageblock_order
> pages via __free_pages_core(), which cannot possibly work.
>
> 2) find_zone_movable_pfns_for_nodes() will roundup the ZONE_MOVABLE
> start PFN to MAX_ORDER_NR_PAGES. Consequently with a bigger
> pageblock_order, we could have a single pageblock partially managed by
> two zones.
>
> 3) compaction code runs into __fragmentation_index() with order
> >= MAX_ORDER, when checking WARN_ON_ONCE(order >= MAX_ORDER). [1]
>
> 4) mm/page_reporting.c won't be reporting any pages with default
> page_reporting_order == pageblock_order, as we'll be skipping the
> reporting loop inside page_reporting_process_zone().
>
> 5) __rmqueue_fallback() will never be able to steal with
> ALLOC_NOFRAGMENT.
>
> pageblock_order >= MAX_ORDER is weird either way: it's a pure
> optimization for making alloc_contig_range(), as used for allcoation of
> gigantic pages, a little more reliable to succeed. However, if there is
> demand for somewhat reliable allocation of gigantic pages, affected setups
> should be using CMA or boottime allocations instead.
>
> So let's make sure that pageblock_order < MAX_ORDER and simplify.
>
> [1] https://lkml.kernel.org/r/87r189a2ks.fsf@linux.ibm.com
>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> drivers/virtio/virtio_mem.c | 9 +++------
> include/linux/cma.h | 3 +--
> include/linux/pageblock-flags.h | 7 +++++--
> mm/Kconfig | 3 +++
> mm/page_alloc.c | 32 ++++++++------------------------
> 5 files changed, 20 insertions(+), 34 deletions(-)
LGTM. Thanks. Reviewed-by: Zi Yan <ziy@nvidia.com>
--
Best Regards,
Yan, Zi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]
prev parent reply other threads:[~2022-02-14 18:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 17:41 [PATCH v1 0/2] " David Hildenbrand
2022-02-14 17:41 ` [PATCH v1 1/2] cma: factor out minimum alignment requirement David Hildenbrand
2022-02-14 17:59 ` Zi Yan
2022-02-15 19:53 ` Rob Herring
2022-02-14 17:41 ` [PATCH v1 2/2] mm: enforce pageblock_order < MAX_ORDER David Hildenbrand
2022-02-14 18:05 ` Zi Yan [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=CBC1765F-6E95-45BB-8071-3574ED2E6EF4@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=david@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=m.szyprowski@samsung.com \
--cc=minchan@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=mst@redhat.com \
--cc=paulus@samba.org \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=vbabka@suse.cz \
--cc=virtualization@lists.linux-foundation.org \
/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