回复: [PATCH] mm:vmscan: fix extra adjustment for lruvec's nonresident_age in case of reactivation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






发件人: Johannes Weiner <hannes@xxxxxxxxxxx>
发送时间: 2021年9月21日 22:48
收件人: Yongmei Xie <yongmeixie@xxxxxxxxxxx>
抄送: akpm@xxxxxxxxxxxxxxxxxxxx <akpm@xxxxxxxxxxxxxxxxxxxx>; linux-mm@xxxxxxxxx <linux-mm@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>
主题: Re: [PATCH] mm:vmscan: fix extra adjustment for lruvec's nonresident_age in case of reactivation
 
On Sun, Sep 19, 2021 at 11:25:09PM +0800, Yongmei Xie wrote:
> Before commit #31d8fcac, VM didn't increase nonresident_age (AKA inactive age for
> file pages) in shrink_page_list. When putback_inactive_pages was converged with
> move_pages_to_lru, both shrink_active_list and shrink_page_list use the same
> function to handle move pages to the appropriate lru under lru lock's protection.
>
> At those day, VM didn't increase nonresident_age for second chance promotion.
> Commit #31d8fcac fix the problem. Definitely, we should account the activation
> for second chance. But move_pages_to_lru is used in reactivation in active lru
> as well for protecting code section. So I suggest to add another variable to
> tell whether reactivation or not.

This looks incorrect to me. We *should* count reactivations/rotations
on the active list toward nonresident age.

The nonresident age tracks the number of in-memory references in order
to later calculate the (minimum) reuse distance of refaulting pages.

If a page on the active list gets reactivated due to a reference, that
reference contributes to the distance of yet-to-refault pages.

Johannes,

Thanks for your reply:)

But now, move_pages_to_lru didn't increase nonresident age for active rotation.
Back toinactive age, VM ONLY care about the pages left inactive lru, AKA activation and reclaiming.
Anyway reactivation is rare case, so whatever it contributes to nonresident age or not is ok to me.

But I am interested the logic how to guess the pages will be referenced again in the future.
If active reactivation does matter to nonresident age. why not active rotation? But, currently it doesn't.

Thanks again
Yongmei

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux