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]
Date:   Wed, 13 Jan 2021 14:31:40 +1100
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Randy Dunlap <rdunlap@...radead.org>, broonie@...nel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, linux-next@...r.kernel.org, mhocko@...e.cz,
        mm-commits@...r.kernel.org, Shakeel Butt <shakeelb@...gle.com>
Subject: Re: mmotm 2021-01-12-01-57 uploaded (NR_SWAPCACHE in mm/)

Hi all,

On Tue, 12 Jan 2021 13:50:10 -0800 Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Tue, 12 Jan 2021 12:38:18 -0800 Randy Dunlap <rdunlap@...radead.org> wrote:
> 
> > On 1/12/21 1:58 AM, akpm@...ux-foundation.org wrote:  
> > > The mm-of-the-moment snapshot 2021-01-12-01-57 has been uploaded to
> > > 
> > >    https://www.ozlabs.org/~akpm/mmotm/
> > > 
> > > mmotm-readme.txt says
> > > 
> > > README for mm-of-the-moment:
> > > 
> > > https://www.ozlabs.org/~akpm/mmotm/
> > > 
> > > This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> > > more than once a week.
> > >   
> > 
> > on i386 and x86_64:
> > 
> > when CONFIG_SWAP is not set/enabled:
> > 
> > ../mm/migrate.c: In function ‘migrate_page_move_mapping’:
> > ../mm/migrate.c:504:35: error: ‘NR_SWAPCACHE’ undeclared (first use in this function); did you mean ‘QC_SPACE’?
> >     __mod_lruvec_state(old_lruvec, NR_SWAPCACHE, -nr);
> >                                    ^~~~~~~~~~~~
> > 
> > ../mm/memcontrol.c:1529:20: error: ‘NR_SWAPCACHE’ undeclared here (not in a function); did you mean ‘SGP_CACHE’?
> >   { "swapcached",   NR_SWAPCACHE   },
> >                     ^~~~~~~~~~~~  
> 
> Thanks.  I did the below.
> 
> But we're still emitting "Node %d SwapCached: 0 kB" in sysfs when
> CONFIG_SWAP=n, which is probably wrong.  Shakeel, can you please have a
> think?
> 
> 
> --- a/mm/memcontrol.c~mm-memcg-add-swapcache-stat-for-memcg-v2-fix
> +++ a/mm/memcontrol.c
> @@ -1521,7 +1521,9 @@ static const struct memory_stat memory_s
>  	{ "file_mapped",		NR_FILE_MAPPED			},
>  	{ "file_dirty",			NR_FILE_DIRTY			},
>  	{ "file_writeback",		NR_WRITEBACK			},
> +#ifdef CONFIG_SWAP
>  	{ "swapcached",			NR_SWAPCACHE			},
> +#endif
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  	{ "anon_thp",			NR_ANON_THPS			},
>  	{ "file_thp",			NR_FILE_THPS			},
> --- a/mm/migrate.c~mm-memcg-add-swapcache-stat-for-memcg-v2-fix
> +++ a/mm/migrate.c
> @@ -500,10 +500,12 @@ int migrate_page_move_mapping(struct add
>  			__mod_lruvec_state(old_lruvec, NR_SHMEM, -nr);
>  			__mod_lruvec_state(new_lruvec, NR_SHMEM, nr);
>  		}
> +#ifdef CONFIG_SWAP
>  		if (PageSwapCache(page)) {
>  			__mod_lruvec_state(old_lruvec, NR_SWAPCACHE, -nr);
>  			__mod_lruvec_state(new_lruvec, NR_SWAPCACHE, nr);
>  		}
> +#endif
>  		if (dirty && mapping_can_writeback(mapping)) {
>  			__mod_lruvec_state(old_lruvec, NR_FILE_DIRTY, -nr);
>  			__mod_zone_page_state(oldzone, NR_ZONE_WRITE_PENDING, -nr);
> _
> 

Applied to linux-next today.

-- 
Cheers,
Stephen Rothwell

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists