RE: [PATCH v4 1/8] mm: Add a ptdesc flag to mark kernel page tables

Tian, Kevin
2025-09-12T07:58:33Z

> From: Lu Baolu <baolu.lu@linux.intel.com>
> Sent: Friday, September 5, 2025 1:51 PM
>
> +/**
> + * ptdesc_clear_kernel - Mark a ptdesc as no longer used to map the kernel
> + * @ptdesc: The ptdesc to be unmarked
> + *
> + * Use when the ptdesc is no longer used to map the kernel and no longer
> + * needs special handling.
> + */
> +static inline void ptdesc_clear_kernel(struct ptdesc *ptdesc)
> +{
> + struct folio *folio = ptdesc_folio(ptdesc);
> +
> + /*
> + * Note: the 'PG_referenced' bit does not strictly need to be
> + * cleared before freeing the page. But this is nice for
> + * symmetry.
> + */
> + folio_clear_referenced(folio);

the comment belongs to the caller?

Reviewed-by: Kevin Tian <kevin.tian@intel.com>