linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@techsingularity.net>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Linux-MM <linux-mm@kvack.org>, Christoph Lameter <cl@linux.com>,
	Michal Hocko <mhocko@suse.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] mm: page_alloc: High-order per-cpu page allocator
Date: Thu, 24 Nov 2016 07:43:18 +0000	[thread overview]
Message-ID: <20161124074318.a72wbn6lx5skxuxf@techsingularity.net> (raw)
In-Reply-To: <a1f8d311-1f69-b672-1dad-9867c212147f@suse.cz>

On Thu, Nov 24, 2016 at 08:26:39AM +0100, Vlastimil Babka wrote:
> On 11/23/2016 05:33 PM, Mel Gorman wrote:
> > > > +
> > > > +static inline unsigned int pindex_to_order(unsigned int pindex)
> > > > +{
> > > > +	return pindex < MIGRATE_PCPTYPES ? 0 : pindex - MIGRATE_PCPTYPES + 1;
> > > > +}
> > > > +
> > > > +static inline unsigned int order_to_pindex(int migratetype, unsigned int order)
> > > > +{
> > > > +	return (order == 0) ? migratetype : MIGRATE_PCPTYPES - 1 + order;
> > > 
> > > Here I think that "MIGRATE_PCPTYPES + order - 1" would be easier to
> > > understand as the array is for all migratetypes, but the order is shifted?
> > > 
> > 
> > As in migratetypes * costly_order ? That would be excessively large.
> 
> No, I just meant that instead of "MIGRATE_PCPTYPES - 1 + order" it could be
> "MIGRATE_PCPTYPES + order - 1" as we are subtracting from order, not
> migratetypes. Just made me confused a bit when seeing the code for the first
> time.
> 

Oh ok. At the time I was thinking in terms of the starting offset for
the high-order and this seemed more natural but I'm ok with it either
way.

As an aside, the sizing of the array was still wrong but I corrected
it yesterday shortly after sending the mail. I also realised that the
free_pcppages_bulk was not interleaving properly and it should be fixed
now. More tests are in progress.

Thanks.

-- 
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2016-11-24  7:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 15:55 Mel Gorman
2016-11-23 15:37 ` Vlastimil Babka
2016-11-23 16:33   ` Mel Gorman
2016-11-24  7:26     ` Vlastimil Babka
2016-11-24  7:43       ` Mel Gorman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161124074318.a72wbn6lx5skxuxf@techsingularity.net \
    --to=mgorman@techsingularity.net \
    --cc=cl@linux.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox