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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190724193249.00875235c4fa2495e0098451@linux-foundation.org>
Date:   Wed, 24 Jul 2019 19:32:49 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Yu Zhao <yuzhao@...gle.com>
Cc:     Vlastimil Babka <vbabka@...e.cz>, Michal Hocko <mhocko@...e.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Dan Williams <dan.j.williams@...el.com>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        Matthew Wilcox <willy@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peng Fan <peng.fan@....com>, Ira Weiny <ira.weiny@...el.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Minchan Kim <minchan@...nel.org>
Subject: Re: [PATCH] mm: replace list_move_tail() with
 add_page_to_lru_list_tail()

On Tue, 16 Jul 2019 15:24:36 -0600 Yu Zhao <yuzhao@...gle.com> wrote:

> This is a cleanup patch that replaces two historical uses of
> list_move_tail() with relatively recent add_page_to_lru_list_tail().
> 

Looks OK to me.

> --- a/mm/swap.c
> +++ b/mm/swap.c
> @@ -515,7 +515,6 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec,
>  	del_page_from_lru_list(page, lruvec, lru + active);
>  	ClearPageActive(page);
>  	ClearPageReferenced(page);
> -	add_page_to_lru_list(page, lruvec, lru);
>  
>  	if (PageWriteback(page) || PageDirty(page)) {
>  		/*
> @@ -523,13 +522,14 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec,
>  		 * It can make readahead confusing.  But race window
>  		 * is _really_ small and  it's non-critical problem.
>  		 */
> +		add_page_to_lru_list(page, lruvec, lru);
>  		SetPageReclaim(page);
>  	} else {
>  		/*
>  		 * The page's writeback ends up during pagevec
>  		 * We moves tha page into tail of inactive.
>  		 */

That comment is really hard to follow.  Minchan, can you please explain
the first sentence?

The second sentence can simply be removed.

> -		list_move_tail(&page->lru, &lruvec->lists[lru]);
> +		add_page_to_lru_list_tail(page, lruvec, lru);
>  		__count_vm_event(PGROTATED);
>  	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ