lkml.org 
[lkml]   [2007]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] Allow percpu variables to be page-aligned
Date
Jeremy Fitzhardinge <jeremy@goop.org> writes:

> Let's allow page-alignment in general for per-cpu data (wanted by Xen, and
> Ingo suggested KVM as well).
>
> Because larger alignments can use more room, we increase the max per-cpu
> memory to 64k rather than 32k: it's getting a little tight.

The second paragraph of the comment is dated. You are not changing the per-cpu
memory size at all now.

The code itself looks sane.

Although we should probably fail the module load if the requested alignment
is to great, but that is just picking nits, and is no worse than what we
do today.

Eric

> ===================================================================
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -346,10 +346,10 @@ static void *percpu_modalloc(unsigned lo
> unsigned int i;
> void *ptr;
>
> - if (align > SMP_CACHE_BYTES) {
> - printk(KERN_WARNING "%s: per-cpu alignment %li > %i\n",
> - name, align, SMP_CACHE_BYTES);
> - align = SMP_CACHE_BYTES;
> + if (align > PAGE_SIZE) {
> + printk(KERN_WARNING "%s: per-cpu alignment %li > %li\n",
> + name, align, PAGE_SIZE);
> + align = PAGE_SIZE;
> }
>
> ptr = __per_cpu_start;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-11 00:25    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site