Re: [PATCH v6 1/4] mm: swap: introduce swap tier infrastructure
From: Baoquan He
Date: Tue May 26 2026 - 06:53:02 EST
On 05/26/26 at 03:09pm, YoungJun Park wrote:
> 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, I got it now. We only track the beginning of prio range via tier->prio,
while deduce the end of prio range from configured tiers. That checking
is reasonable. Sorry for the noise.