Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1529040
| From | Mel Gorman <mgorman@techsingularity.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH] mm: page_alloc: High-order per-cpu page allocator |
| Date | 2016-11-24 08:50 +0100 |
| Message-ID | <sGWX8-83u-7@gated-at.bofh.it> (permalink) |
| References | <sFZaF-333-7@gated-at.bofh.it> <sGHOr-6Ev-59@gated-at.bofh.it> <sGIUa-7ig-23@gated-at.bofh.it> <sGWDL-7WB-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[RFC PATCH] mm: page_alloc: High-order per-cpu page allocator Mel Gorman <mgorman@techsingularity.net> - 2016-11-21 17:00 +0100
Re: [RFC PATCH] mm: page_alloc: High-order per-cpu page allocator Vlastimil Babka <vbabka@suse.cz> - 2016-11-23 16:40 +0100
Re: [RFC PATCH] mm: page_alloc: High-order per-cpu page allocator Mel Gorman <mgorman@techsingularity.net> - 2016-11-23 17:50 +0100
Re: [RFC PATCH] mm: page_alloc: High-order per-cpu page allocator Vlastimil Babka <vbabka@suse.cz> - 2016-11-24 08:30 +0100
Re: [RFC PATCH] mm: page_alloc: High-order per-cpu page allocator Mel Gorman <mgorman@techsingularity.net> - 2016-11-24 08:50 +0100
csiph-web