lkml.org 
[lkml]   [2022]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 5/8] mm/vmscan: use helper folio_is_file_lru()
Date
Miaohe Lin <linmiaohe@huawei.com> writes:

> Use helper folio_is_file_lru() to check whether folio is file lru. Minor
> readability improvement.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> mm/vmscan.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index ebd8ffb63673..31e95d627448 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1411,14 +1411,14 @@ static enum page_references folio_check_references(struct folio *folio,
> /*
> * Activate file-backed executable folios after first usage.
> */
> - if ((vm_flags & VM_EXEC) && !folio_test_swapbacked(folio))
> + if ((vm_flags & VM_EXEC) && folio_is_file_lru(folio))

I think that this should be converted to

if ((vm_flags & VM_EXEC)))

We should activate swap-backed executable folios (e.g. tmpfs) after
first usage too.

Best Regards,
Huang, Ying

> return PAGEREF_ACTIVATE;
>
> return PAGEREF_KEEP;
> }
>
> /* Reclaim if clean, defer dirty folios to writeback */
> - if (referenced_folio && !folio_test_swapbacked(folio))
> + if (referenced_folio && folio_is_file_lru(folio))
> return PAGEREF_RECLAIM_CLEAN;
>
> return PAGEREF_RECLAIM;

\
 
 \ /
  Last update: 2022-04-01 05:23    [W:0.189 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site