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  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:   Tue, 26 May 2020 20:54:23 -0400
From:   Qian Cai <cai@....pw>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     linux-mm@...ck.org, Rik van Riel <riel@...riel.com>,
        Minchan Kim <minchan.kim@...il.com>,
        Michal Hocko <mhocko@...e.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH 09/14] mm: deactivations shouldn't bias the LRU balance

On Tue, May 26, 2020 at 11:55:49AM -0400, Johannes Weiner wrote:
> > mm/swap.c: In function 'lru_deactivate_file_fn':
> > mm/swap.c:504:11: warning: variable 'file' set but not used
> > [-Wunused-but-set-variable]
> >   int lru, file;
> >            ^~~~ 
> 
> Oops, my gcc doesn't warn about that, but yes, it's clearly dead code.

You will probably need W=1 to see that.

> 
> $ make mm/swap.o
>   GEN     Makefile
>   CALL    /home/hannes/src/linux/linux/scripts/checksyscalls.sh
>   CALL    /home/hannes/src/linux/linux/scripts/atomic/check-atomics.sh
>   DESCEND  objtool
>   CC      mm/swap.o
> $
>  
> > This?
> > 
> > diff --git a/mm/swap.c b/mm/swap.c
> > index fedf5847dfdb..9c38c1b545af 100644
> > --- a/mm/swap.c
> > +++ b/mm/swap.c
> > @@ -501,7 +501,7 @@ void lru_cache_add_active_or_unevictable(struct page *page,
> >  static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec,
> >  			      void *arg)
> >  {
> > -	int lru, file;
> > +	int lru;
> >  	bool active;
> >  
> >  	if (!PageLRU(page))
> > @@ -515,7 +515,6 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec,
> >  		return;
> >  
> >  	active = PageActive(page);
> > -	file = page_is_file_lru(page);
> >  	lru = page_lru_base_type(page);
> >  
> >  	del_page_from_lru_list(page, lruvec, lru + active);
> 
> Looks good, and it appears Andrew has already queued it. Would you
> mind providing the Signed-off-by: for it?

Don't worry about that. I believe Andrew will squash it when sending to
Linus.

Powered by blists - more mailing lists