Re: [PATCH v6 1/4] mm: swap: introduce swap tier infrastructure

From: YoungJun Park

Date: Tue May 26 2026 - 02:25:10 EST


On Tue, May 26, 2026 at 06:57:03AM +0800, Baoquan He wrote:
> On 04/21/26 at 02:53pm, Youngjun Park wrote:
> ...snip...
> > +bool swap_tiers_validate(void)
> > +{
> > + struct swap_tier *tier;
> > +
> > + /*
> > + * Initial setting might not cover DEF_SWAP_PRIO.
> > + * Swap tier must cover the full range (DEF_SWAP_PRIO to SHRT_MAX).
> > + */
>
> If so, do we need check if the upmost boundary SHRT_MAX is covered?

Hello Baoquan

It naturally covers SHRT_MAX.
Because all swap_tier object prio represents start of priority
and the prio value is assured on the range of DEF_SWAP_PRIO ~ SHAR_MAX
on the privious routine.

swap_tier_validate function is for checking the first tier cover DEF_SWAP_PRIO.
if it is not, it breaks the assumtion "cover DEF_SWAP_PRIO to SHRT_MAX"

Thanks for the review.
Youngjun Park