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: <1352217806.6504.19.camel@MikesLinux.fc.hp.com>
Date:	Tue, 06 Nov 2012 09:03:26 -0700
From:	Mike Yoknis <mike.yoknis@...com>
To:	Dave Hansen <dave@...ux.vnet.ibm.com>
Cc:	Mel Gorman <mgorman@...e.de>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
	"mmarek@...e.cz" <mmarek@...e.cz>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"hpa@...or.com" <hpa@...or.com>, "arnd@...db.de" <arnd@...db.de>,
	"sam@...nborg.org" <sam@...nborg.org>,
	"minchan@...nel.org" <minchan@...nel.org>,
	"kamezawa.hiroyu@...fujitsu.com" <kamezawa.hiroyu@...fujitsu.com>,
	"mhocko@...e.cz" <mhocko@...e.cz>,
	"linux-kbuild@...r.kernel.org" <linux-kbuild@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH] mm: memmap_init_zone() performance improvement

On Tue, 2012-10-30 at 09:14 -0600, Dave Hansen wrote:
> On 10/20/2012 01:29 AM, Mel Gorman wrote:
> > I'm travelling at the moment so apologies that I have not followed up on
> > this. My problem is still the same with the patch - it changes more
> > headers than is necessary and it is sparsemem specific. At minimum, try
> > the suggestion of
> >
> > if (!early_pfn_valid(pfn)) {
> >       pfn = ALIGN(pfn + MAX_ORDER_NR_PAGES, MAX_ORDER_NR_PAGES) - 1;
> >       continue;
> > }
> 
> Sorry I didn't catch this until v2...
> 
> Is that ALIGN() correct?  If pfn=3, then it would expand to:
> 
> (3+MAX_ORDER_NR_PAGES+MAX_ORDER_NR_PAGES-1) & ~(MAX_ORDER_NR_PAGES-1)
> 
> You would end up skipping the current MAX_ORDER_NR_PAGES area, and then
> one _extra_ because ALIGN() aligns up, and you're adding
> MAX_ORDER_NR_PAGES too.  It doesn't matter unless you run in to a
> !early_valid_pfn() in the middle of a MAX_ORDER area, I guess.
> 
> I think this would work, plus be a bit smaller:
> 
>         pfn = ALIGN(pfn + 1, MAX_ORDER_NR_PAGES) - 1;
> 
Dave,
I see your point about "rounding-up".  But, I favor the way Mel
suggested it.  It more clearly shows the intent, which is to move up by
MAX_ORDER_NR_PAGES.  The "pfn+1" may suggest that there is some
significance to the next pfn, but there is not.
I find Mel's way easier to understand.
Mike Y


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ