lkml.org 
[lkml]   [2014]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] [percpu] Make the unit size of the first chunk the same as other chunks
From
In pcpu_embed_first_chunk(), we allocate full unit size for each CPU
in the first chunk:

1981 /* allocate space for the whole group */
1982 ptr = alloc_fn(cpu, gi->nr_units * ai->unit_size,
atom_size);
1983 if (!ptr) {
1984 rc = -ENOMEM;
1985 goto out_free_areas;
1986 }


Later we freed unused part:


2009 /* copy and return the unused part */
2010 memcpy(ptr, __per_cpu_load, ai->static_size);
2011 free_fn(ptr + size_sum, ai->unit_size - size_sum);

I am trying to make each CPU to have a full unit size in the first
chunk, same as in all other chunks. Does this make sense?

-Zhihui

On Mon, Oct 27, 2014 at 10:08 AM, Tejun Heo <tj@kernel.org> wrote:
> On Sat, Oct 25, 2014 at 11:05:58AM -0400, Zhihui Zhang wrote:
>> Since we have already allocated the full unit size for the first chunk, we might as well use
>> it so that the unit size are the same for all chunks. The page first chunk allocator already
>> has this effect because it allocates one page at a time.
>
> I'm not following. Where do we allocate the full unit size for the
> first chunk?
>
> Thanks.
>
> --
> tejun


\
 
 \ /
  Last update: 2014-10-28 01:01    [W:0.048 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site