lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y20pa3r6.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date:   Fri, 01 Apr 2022 11:20:29 +0800
From:   "Huang, Ying" <ying.huang@...el.com>
To:     Miaohe Lin <linmiaohe@...wei.com>
Cc:     <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Konstantin Khlebnikov <khlebnikov@...nvz.org>,
        Wu Fengguang <wfg@...l.ustc.edu.cn>
Subject: Re: [PATCH 5/8] mm/vmscan: use helper folio_is_file_lru()

Miaohe Lin <linmiaohe@...wei.com> writes:

> Use helper folio_is_file_lru() to check whether folio is file lru. Minor
> readability improvement.
>
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ