Re: [PATCH v1 1/1] mm: report per-page metadata information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux