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] [day] [month] [year] [list]
Message-ID: <1e12400d-80c7-33a0-051d-85976b6d3fad@suse.cz>
Date:   Tue, 22 Oct 2019 13:53:23 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Fengguang Wu <fengguang.wu@...el.com>,
        Linux Memory Management List <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Dave Hansen <dave.hansen@...el.com>,
        Liu Jingqi <jingqi.liu@...el.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: trivial mark_page_accessed() cleanup

On 10/17/19 12:53 AM, Fengguang Wu wrote:
> This avoids duplicated PageReferenced() calls.
> No behavior change.
> 
> Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>

Acked-by: Vlastimil Babka <vbabka@...e.cz>

> ---
>   mm/swap.c | 14 +++++++++-----
>   1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/swap.c b/mm/swap.c
> index 38a52b9..c55720c 100644
> --- a/mm/swap.c
> +++ b/mm/swap.c
> @@ -373,9 +373,15 @@ void mark_page_accessed(struct page *page)
>   	page = compound_head(page);
>   	inc_node_page_state(page, NR_ACCESSED);
>   
> -	if (!PageActive(page) && !PageUnevictable(page) &&
> -			PageReferenced(page)) {
> -
> +	if (!PageReferenced(page)) {
> +		SetPageReferenced(page);
> +	} else if (PageUnevictable(page)) {
> +		/*
> +		 * Unevictable pages are on the "LRU_UNEVICTABLE" list. But,
> +		 * this list is never rotated or maintained, so marking an
> +		 * evictable page accessed has no effect.
> +		 */
> +	} else if (!PageActive(page)) {
>   		/*
>   		 * If the page is on the LRU, queue it for activation via
>   		 * activate_page_pvecs. Otherwise, assume the page is on a
> @@ -389,8 +395,6 @@ void mark_page_accessed(struct page *page)
>   		ClearPageReferenced(page);
>   		if (page_is_file_cache(page))
>   			workingset_activation(page);
> -	} else if (!PageReferenced(page)) {
> -		SetPageReferenced(page);
>   	}
>   	if (page_is_idle(page))
>   		clear_page_idle(page);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ