Re: [PATCH v23 04/15] mm/idle_page_tracking: Make PG_idle reusable

From: Shakeel Butt
Date: Wed Dec 23 2020 - 10:12:36 EST


On Tue, Dec 15, 2020 at 3:57 AM SeongJae Park <sjpark@xxxxxxxxxx> wrote:
>
> From: SeongJae Park <sjpark@xxxxxxxxx>
>
> PG_idle and PG_young allow the two PTE Accessed bit users, Idle Page
> Tracking and the reclaim logic concurrently work while don't interfere
> each other. That is, when they need to clear the Accessed bit, they set
> PG_young to represent the previous state of the bit, respectively. And
> when they need to read the bit, if the bit is cleared, they further read
> the PG_young to know whether the other has cleared the bit meanwhile or
> not.
>
> We could add another page flag and extend the mechanism to use the flag
> if we need to add another concurrent PTE Accessed bit user subsystem.
> However, the space is limited. Meanwhile, if the new subsystem is
> mutually exclusive with IDLE_PAGE_TRACKING or interfering with it is not
> a real problem, it would be ok to simply reuse the PG_idle flag.
> However, it's impossible because the flags are dependent on
> IDLE_PAGE_TRACKING.
>
> To allow such reuse of the flags, this commit separates the PG_young and
> PG_idle flag logic from IDLE_PAGE_TRACKING and introduces new kernel
> config, 'PAGE_IDLE_FLAG'. Hence, a new subsystem would be able to reuse
> PG_idle without depending on IDLE_PAGE_TRACKING.
>
> In the next commit, DAMON's reference implementation of the virtual
> memory address space monitoring primitives will use it.
>
> Signed-off-by: SeongJae Park <sjpark@xxxxxxxxx>

Reviewed-by: Shakeel Butt <shakeelb@xxxxxxxxxx>