Re: [GIT PATCH] x86,percpu: fix pageattr handling with remapallocator

From: Suresh Siddha
Date: Mon May 18 2009 - 17:09:26 EST


On Mon, 2009-05-18 at 12:41 -0700, H. Peter Anvin wrote:
> Suresh Siddha wrote:
> >
> > Can we don't use PERCPU_DYNAMIC_RESERVE in the first chunk and for
> > dynamic per_cpu_ptr's we can use some other offset such as
> > per_cpu_ptr_offset() or some such thing?
> >
> > Then we can separate the static and dynamic chunks. And use large page
> > kernel-direct mappings for fast access for critical common things and
> > use small page accesses for dynamic and not so common accesses.
> >
> > Just checking to see if we can reduce the complexity of setting up the
> > percpu areas (different versions for embed, non-embed etc) and handling
> > all these aliases with simple code, rather than making it complex.
> >
>
> I'm confused what you're suggesting here. The whole point of the percpu
> unification work is that we can use %gs:absolute type references to hit
> a variable right away. Although in theory we could use both %fs and %gs
> for pointers, setting up both would greatly increase the cost of
> entering the kernel, especially on 64 bits.
>
> This means all percpu data has to have a constant (virtual) offset from
> the beginning of the static percpu area.

This %gs:absolute type accesses are for static percpu data.

But what I was referring to is the dynamic percpu data(accessed through
per_cpu_ptr()). Instead of combining some part of the dynamic percpu
data into the static percpu data(first percpu chunk), we can use
different chunks for dynamic percpu data and governed by a different
per_cpu_dynamic_offset[NR_CPUS] array.

Then we can use large-page kernel direct mappings for static percpu data
(or %gs:offset) and small-page vmalloc mappings for dynamic percpu data.

thanks,
suresh

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/