From: Mike Rapoport <rppt@kernel.org>
To: Robin Murphy <robin.murphy@arm.com>
Cc: m.szyprowski@samsung.com, akpm@linux-foundation.org,
vbabka@suse.cz, david@kernel.org, bhe@redhat.com,
iommu@lists.linux-foundation.org, linux-mm@kvack.org,
vladimir.kondratiev@mobileye.com, s-adivi@ti.com,
linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, surenb@google.com, mhocko@suse.com,
jackmanb@google.com, hannes@cmpxchg.org, ziy@nvidia.com
Subject: Re: [PATCH 2/3] mm_zone: Generalise has_managed_dma()
Date: Wed, 14 Jan 2026 09:18:56 +0200 [thread overview]
Message-ID: <aWdDYFkTeOqOnbWD@kernel.org> (raw)
In-Reply-To: <bd002d2351074e57be1ca08f03f333debac658fb.1768230104.git.robin.murphy@arm.com>
On Mon, Jan 12, 2026 at 03:46:37PM +0000, Robin Murphy wrote:
> It would be useful to be able to check for potential DMA pages beyond
> just ZONE_DMA - generalise the existing has_managed_dma() function to
> allow checking other zones too.
>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> include/linux/mmzone.h | 9 +++++----
> mm/page_alloc.c | 8 ++------
> 2 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 75ef7c9f9307..fc5d6c88d2f0 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -1648,14 +1648,15 @@ static inline int is_highmem(const struct zone *zone)
> return is_highmem_idx(zone_idx(zone));
> }
>
> -#ifdef CONFIG_ZONE_DMA
> -bool has_managed_dma(void);
> -#else
> +bool has_managed_zone(enum zone_type zone);
> static inline bool has_managed_dma(void)
> {
> +#ifdef CONFIG_ZONE_DMA
> + return has_managed_zone(ZONE_DMA);
> +#else
> return false;
> -}
> #endif
> +}
>
>
> #ifndef CONFIG_NUMA
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 822e05f1a964..36ccc85c5073 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -7418,20 +7418,16 @@ bool put_page_back_buddy(struct page *page)
> }
> #endif
>
> -#ifdef CONFIG_ZONE_DMA
> -bool has_managed_dma(void)
> +bool has_managed_zone(enum zone_type zone)
> {
> struct pglist_data *pgdat;
>
> for_each_online_pgdat(pgdat) {
> - struct zone *zone = &pgdat->node_zones[ZONE_DMA];
> -
> - if (managed_zone(zone))
> + if (managed_zone(&pgdat->node_zones[zone]))
> return true;
> }
> return false;
> }
> -#endif /* CONFIG_ZONE_DMA */
>
> #ifdef CONFIG_UNACCEPTED_MEMORY
>
> --
> 2.34.1
>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-01-14 7:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260112154649eucas1p265e59d616343bb4c2ce80128c393f56b@eucas1p2.samsung.com>
2026-01-12 15:46 ` [PATCH 0/3] dma-mapping: Improve atomic pool behaviour Robin Murphy
2026-01-12 15:46 ` [PATCH 1/3] dma/pool: Improve pool lookup Robin Murphy
2026-01-12 15:46 ` [PATCH 2/3] mm_zone: Generalise has_managed_dma() Robin Murphy
2026-01-12 19:32 ` David Hildenbrand (Red Hat)
2026-01-14 7:18 ` Mike Rapoport [this message]
2026-01-12 15:46 ` [PATCH 3/3] dma/pool: Avoid allocating redundant pools Robin Murphy
2026-01-13 10:16 ` Baoquan He
2026-01-13 16:14 ` Robin Murphy
2026-01-14 2:05 ` Baoquan He
2026-01-13 14:07 ` [PATCH 0/3] dma-mapping: Improve atomic pool behaviour Vladimir Kondratiev
2026-01-13 22:59 ` Marek Szyprowski
2026-01-14 2:06 ` Baoquan He
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=aWdDYFkTeOqOnbWD@kernel.org \
--to=rppt@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=m.szyprowski@samsung.com \
--cc=mhocko@suse.com \
--cc=robin.murphy@arm.com \
--cc=s-adivi@ti.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=vladimir.kondratiev@mobileye.com \
--cc=ziy@nvidia.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