Re: [PATCH 02/16] mm: introduce leaf entry type and use to simplify leaf entry logic

From: Gregory Price

Date: Wed Nov 05 2025 - 09:42:29 EST


On Mon, Nov 03, 2025 at 12:31:43PM +0000, Lorenzo Stoakes wrote:
> +typedef swp_entry_t leaf_entry_t;
> +
> +#ifdef CONFIG_MMU
> +
> +/* Temporary until swp_entry_t eliminated. */
> +#define LEAF_TYPE_SHIFT SWP_TYPE_SHIFT
> +
> +enum leaf_entry_type {
> + /* Fundamental types. */
> + LEAFENT_NONE,
> + LEAFENT_SWAP,
> + /* Migration types. */
> + LEAFENT_MIGRATION_READ,
> + LEAFENT_MIGRATION_READ_EXCLUSIVE,
> + LEAFENT_MIGRATION_WRITE,
> + /* Device types. */
> + LEAFENT_DEVICE_PRIVATE_READ,
> + LEAFENT_DEVICE_PRIVATE_WRITE,
> + LEAFENT_DEVICE_EXCLUSIVE,
> + /* H/W posion types. */
> + LEAFENT_HWPOISON,
> + /* Marker types. */
> + LEAFENT_MARKER,
> +};
> +

Have been browsing the patch set again, will get around a deeper review,
but just wanted to say this is a thing of beauty :]

~Gregory