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]
Date:   Thu, 16 Feb 2017 12:52:53 -0500
From:   Johannes Weiner <hannes@...xchg.org>
To:     Shaohua Li <shli@...com>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Kernel-team@...com, mhocko@...e.com, minchan@...nel.org,
        hughd@...gle.com, riel@...hat.com, mgorman@...hsingularity.net,
        akpm@...ux-foundation.org
Subject: Re: [PATCH V3 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE
 list

On Tue, Feb 14, 2017 at 11:36:08AM -0800, Shaohua Li wrote:
> @@ -126,4 +126,24 @@ static __always_inline enum lru_list page_lru(struct page *page)
>  
>  #define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
>  
> +/*
> + * lazyfree pages are clean anonymous pages. They have SwapBacked flag cleared
> + * to destinguish normal anonymous pages.
> + */
> +static inline void set_page_lazyfree(struct page *page)
> +{
> +	VM_BUG_ON_PAGE(!PageAnon(page) || !PageSwapBacked(page), page);
> +	ClearPageSwapBacked(page);
> +}
> +
> +static inline void clear_page_lazyfree(struct page *page)
> +{
> +	VM_BUG_ON_PAGE(!PageAnon(page) || PageSwapBacked(page), page);
> +	SetPageSwapBacked(page);
> +}
> +
> +static inline bool page_is_lazyfree(struct page *page)
> +{
> +	return PageAnon(page) && !PageSwapBacked(page);
> +}

Sorry for not getting to v2 in time, but I have to say I strongly
agree with your first iterations and would much prefer this to be
open-coded.

IMO this needlessly introduces a new state opaquely called "lazyfree",
when really that's just anonymous pages that don't need to be swapped
before reclaim - PageAnon && !PageSwapBacked. Very simple MM concept.

That especially shows when we later combine it with page_is_file_cache
checks like the next patch does.

The rest of the patch looks good to me.

Powered by blists - more mailing lists