[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090220003743.d787107b.akpm@linux-foundation.org>
Date: Fri, 20 Feb 2009 00:37:43 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Tejun Heo <tj@...nel.org>
Cc: rusty@...tcorp.com.au, tglx@...utronix.de, x86@...nel.org,
linux-kernel@...r.kernel.org, hpa@...or.com, jeremy@...p.org,
cpw@....com, mingo@...e.hu
Subject: Re: [PATCH UPDATED 09/10] percpu: implement new dynamic percpu
allocator
On Fri, 20 Feb 2009 16:30:01 +0900 Tejun Heo <tj@...nel.org> wrote:
> Impact: new scalable dynamic percpu allocator which allows dynamic
> percpu areas to be accessed the same way as static ones
>
> Implement scalable dynamic percpu allocator which can be used for both
> static and dynamic percpu areas. This will allow static and dynamic
> areas to share faster direct access methods. This feature is optional
> and enabled only when CONFIG_HAVE_DYNAMIC_PER_CPU_AREA is defined by
> arch. Please read comment on top of mm/percpu.c for details.
>
> ...
>
> +static int pcpu_unit_pages_shift;
> +static int pcpu_unit_pages;
> +static int pcpu_unit_shift;
> +static int pcpu_unit_size;
> +static int pcpu_chunk_size;
> +static int pcpu_nr_slots;
> +static size_t pcpu_chunk_struct_size;
> +
> +/* the address of the first chunk which starts with the kernel static area */
> +void *pcpu_base_addr;
> +EXPORT_SYMBOL_GPL(pcpu_base_addr);
> +
> +/* the size of kernel static area */
> +static int pcpu_static_size;
It would be nice to document the units of the `size' variables. Bytes?
Pages?
Or, better: s/size/bytes/g.
> +static int pcpu_size_to_slot(int size)
> +{
> + int highbit = fls(size);
> + return max(highbit - PCPU_SLOT_BASE_SHIFT + 2, 1);
> +}
See,
static int pcpu_bytes_to_slot(int bytes)
{
int highbit = fls(bytes);
return max(highbit - PCPU_SLOT_BASE_SHIFT + 2, 1);
}
is clearer.
--
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