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]
Message-ID: <ZQMA/63agV42szfc@casper.infradead.org>
Date:   Thu, 14 Sep 2023 13:47:59 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Mike Rapoport <rppt@...nel.org>
Cc:     Sourav Panda <souravpanda@...gle.com>, corbet@....net,
        gregkh@...uxfoundation.org, rafael@...nel.org,
        akpm@...ux-foundation.org, mike.kravetz@...cle.com,
        muchun.song@...ux.dev, david@...hat.com, rdunlap@...radead.org,
        chenlinxuan@...ontech.com, yang.yang29@....com.cn,
        tomas.mudrunka@...il.com, bhelgaas@...gle.com, ivan@...udflare.com,
        pasha.tatashin@...een.com, yosryahmed@...gle.com,
        hannes@...xchg.org, shakeelb@...gle.com,
        kirill.shutemov@...ux.intel.com, wangkefeng.wang@...wei.com,
        adobriyan@...il.com, vbabka@...e.cz, Liam.Howlett@...cle.com,
        surenb@...gle.com, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-doc@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [PATCH v1 1/1] mm: report per-page metadata information

On Wed, Sep 13, 2023 at 11:51:25PM +0300, Mike Rapoport wrote:
> > @@ -387,8 +390,12 @@ static int alloc_vmemmap_page_list(unsigned long start, unsigned long end,
> >  
> >  	while (nr_pages--) {
> >  		page = alloc_pages_node(nid, gfp_mask, 0);
> > -		if (!page)
> > +		if (!page) {
> >  			goto out;
> > +		} else {
> > +			__mod_node_page_state(NODE_DATA(page_to_nid(page)),
> > +					      NR_PAGE_METADATA, 1);
> 
> We can update this once for nr_pages outside the loop, cannot we?

Except that nr_pages is being used as the loop counter.
Probably best to turn this into a normal (i = 0; i < nr_pages; i++)
loop, and then we can do as you say.  But this isn't a particularly
interesting high-performance loop.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ