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]
Date:   Mon, 02 May 2022 15:28:49 +1000
From:   "NeilBrown" <neilb@...e.de>
To:     "Matthew Wilcox" <willy@...radead.org>
Cc:     "Miaohe Lin" <linmiaohe@...wei.com>,
        "Andrew Morton" <akpm@...ux-foundation.org>,
        "Geert Uytterhoeven" <geert+renesas@...der.be>,
        "Christoph Hellwig" <hch@....de>, linux-nfs@...r.kernel.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MM: handle THP in swap_*page_fs() - count_vm_events()

On Mon, 02 May 2022, Matthew Wilcox wrote:
> On Mon, May 02, 2022 at 02:57:46PM +1000, NeilBrown wrote:
> > @@ -390,9 +392,9 @@ static void sio_read_complete(struct kiocb *iocb, long ret)
> >  			struct page *page = sio->bvec[p].bv_page;
> >  
> >  			SetPageUptodate(page);
> > +			count_swpout_vm_event(page);
> >  			unlock_page(page);
> >  		}
> > -		count_vm_events(PSWPIN, sio->pages);
> 
> Surely that should be count_swpIN_vm_event?
> 
I'm not having a good day....

Certainly shouldn't be swpout.  There isn't a count_swpin_vm_event().

swap_readpage() only counts once for each page no matter how big it is.
While swap_writepage() counts one for each PAGE_SIZE written.

And we have THP_SWPOUT but not THP_SWPIN

And I cannot find where any of these counters are documents, so I cannot
say what is "correct".

Well.... arch/s390/appldata/appldata_mem.c says
	u64 pswpin;		/* pages swapped in  */
	u64 pswpout;		/* pages swapped out */

but that isn't exactly unambiguous, and is for s390 which doesn't
support THP_SWAP

Ho hum.  I guess I put that back as it was.

Thanks for the review!!!

NeilBrown

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ