Re: [PATCH 1/4] mm/damon: defensively skip zone device folios in damon_get_folio()

From: Gregory Price

Date: Thu Aug 06 2026 - 13:13:54 EST


On Thu, Aug 06, 2026 at 02:37:59PM +0100, Lorenzo Stoakes (ARM) wrote:
> On Tue, Jul 28, 2026 at 03:47:11PM -0400, Gregory Price wrote:
> > All DAMON physical- and virtual-address operations obtain their folios
> > through damon_get_folio(). That helper already excludes ZONE_DEVICE
> > memory implicitly via pfn_to_online_page() and folio_test_lru(), but
> > this is inconsistent with other callers in mm/ which test explicitly.
> >
> > Add an explicit folio_is_zone_device() rejection in damon_get_folio()
> > so the guarantee lives in one place and covers every caller uniformly,
> > consistent with other mm walkers that reject zone device folios.
> >
> > Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
>
> Thanks, nice to make it explicit!
>
> Acked-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
>

SJ Asked me to drop it, so I most likely will, but yeah - this exact
patch is a good example of how many footguns zone device gives us.

~Gregory