2008-01-08 02:14:54

by Mike Travis

[permalink] [raw]
Subject: [PATCH 00/10] percpu: Per cpu code simplification V3


This patchset simplifies the code that arches need to maintain to support
per cpu functionality. Most of the code is moved into arch independent
code. Only a minimal set of definitions is kept for each arch.

The patch also unifies the x86 arch so that there is only a single
asm-x86/percpu.h

V1->V2:
- Add support for specifying attributes for per cpu declarations (preserves
IA64 model(small) attribute).
- Drop first patch that removes the model(small) attribute for IA64
- Missing #endif in powerpc generic config / Wrong Kconfig
- Follow Randy's suggestions on how to do the Kconfig settings

V2->V3:
- fix x86_64 non-SMP case
- change SHIFT_PTR to SHIFT_PERCPU_PTR
- fix various percpu_modcopy()'s to reference correct per_cpu_offset()
- s390 has a special way to determine the pointer to a per cpu area

Signed-off-by: Christoph Lameter <[email protected]>
Signed-off-by: Mike Travis <[email protected]>

--


2008-01-08 09:07:35

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 00/10] percpu: Per cpu code simplification V3


* [email protected] <[email protected]> wrote:

> This patchset simplifies the code that arches need to maintain to
> support per cpu functionality. Most of the code is moved into arch
> independent code. Only a minimal set of definitions is kept for each
> arch.
>
> The patch also unifies the x86 arch so that there is only a single
> asm-x86/percpu.h
>
> V1->V2:
> - Add support for specifying attributes for per cpu declarations (preserves
> IA64 model(small) attribute).
> - Drop first patch that removes the model(small) attribute for IA64
> - Missing #endif in powerpc generic config / Wrong Kconfig
> - Follow Randy's suggestions on how to do the Kconfig settings
>
> V2->V3:
> - fix x86_64 non-SMP case
> - change SHIFT_PTR to SHIFT_PERCPU_PTR
> - fix various percpu_modcopy()'s to reference correct per_cpu_offset()
> - s390 has a special way to determine the pointer to a per cpu area

thanks, i've picked up the x86 and core bits, for testing.

i had the patch below for v2, it's still needed (because i didnt apply
the s390/etc. bits), right?

Ingo

------------->
Subject: x86: let other arches build
From: Ingo Molnar <[email protected]>

let architectures which still have the DEFINE_PER_CPU/etc. build
properly.

Signed-off-by: Ingo Molnar <[email protected]>
---
include/linux/percpu.h | 2 ++
1 file changed, 2 insertions(+)

Index: linux-x86.q/include/linux/percpu.h
===================================================================
--- linux-x86.q.orig/include/linux/percpu.h
+++ linux-x86.q/include/linux/percpu.h
@@ -14,6 +14,7 @@
#endif

#ifdef CONFIG_SMP
+#ifndef DEFINE_PER_CPU
#define DEFINE_PER_CPU(type, name) \
__attribute__((__section__(".data.percpu"))) \
PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
@@ -32,6 +33,7 @@

#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
+#endif

/* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */
#ifndef PERCPU_ENOUGH_ROOM

2008-01-08 16:28:01

by Mike Travis

[permalink] [raw]
Subject: Re: [PATCH 00/10] percpu: Per cpu code simplification V3

Ingo Molnar wrote:
> * [email protected] <[email protected]> wrote:
>
>> This patchset simplifies the code that arches need to maintain to
>> support per cpu functionality. Most of the code is moved into arch
>> independent code. Only a minimal set of definitions is kept for each
>> arch.
>>
>> The patch also unifies the x86 arch so that there is only a single
>> asm-x86/percpu.h
>>
>> V1->V2:
>> - Add support for specifying attributes for per cpu declarations (preserves
>> IA64 model(small) attribute).
>> - Drop first patch that removes the model(small) attribute for IA64
>> - Missing #endif in powerpc generic config / Wrong Kconfig
>> - Follow Randy's suggestions on how to do the Kconfig settings
>>
>> V2->V3:
>> - fix x86_64 non-SMP case
>> - change SHIFT_PTR to SHIFT_PERCPU_PTR
>> - fix various percpu_modcopy()'s to reference correct per_cpu_offset()
>> - s390 has a special way to determine the pointer to a per cpu area
>
> thanks, i've picked up the x86 and core bits, for testing.
>
> i had the patch below for v2, it's still needed (because i didnt apply
> the s390/etc. bits), right?
>
> Ingo

Yes, good point. Thanks.

Mike

>
> ------------->
> Subject: x86: let other arches build
> From: Ingo Molnar <[email protected]>
>
> let architectures which still have the DEFINE_PER_CPU/etc. build
> properly.
>
> Signed-off-by: Ingo Molnar <[email protected]>
> ---
> include/linux/percpu.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> Index: linux-x86.q/include/linux/percpu.h
> ===================================================================
> --- linux-x86.q.orig/include/linux/percpu.h
> +++ linux-x86.q/include/linux/percpu.h
> @@ -14,6 +14,7 @@
> #endif
>
> #ifdef CONFIG_SMP
> +#ifndef DEFINE_PER_CPU
> #define DEFINE_PER_CPU(type, name) \
> __attribute__((__section__(".data.percpu"))) \
> PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
> @@ -32,6 +33,7 @@
>
> #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
> #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
> +#endif
>
> /* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */
> #ifndef PERCPU_ENOUGH_ROOM

2008-01-08 19:04:18

by Christoph Lameter

[permalink] [raw]
Subject: Re: [PATCH 00/10] percpu: Per cpu code simplification V3

On Tue, 8 Jan 2008, Ingo Molnar wrote:

> i had the patch below for v2, it's still needed (because i didnt apply
> the s390/etc. bits), right?

Well the patch really should go through mm because it is a change that
covers multiple arches. I think testing with this is fine. I think Mike
has diffed this against Linus tree so this works but will now conflict
with the modcopy patch already in mm.

2008-01-08 19:27:10

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 00/10] percpu: Per cpu code simplification V3

On Mon, Jan 07, 2008 at 06:11:42PM -0800, [email protected] wrote:
>
> This patchset simplifies the code that arches need to maintain to support
> per cpu functionality. Most of the code is moved into arch independent
> code. Only a minimal set of definitions is kept for each arch.
>
> The patch also unifies the x86 arch so that there is only a single
> asm-x86/percpu.h
>
> V1->V2:
> - Add support for specifying attributes for per cpu declarations (preserves
> IA64 model(small) attribute).
> - Drop first patch that removes the model(small) attribute for IA64
> - Missing #endif in powerpc generic config / Wrong Kconfig
> - Follow Randy's suggestions on how to do the Kconfig settings
>
> V2->V3:
> - fix x86_64 non-SMP case
> - change SHIFT_PTR to SHIFT_PERCPU_PTR
> - fix various percpu_modcopy()'s to reference correct per_cpu_offset()
> - s390 has a special way to determine the pointer to a per cpu area

In your changelog comments you have this:
V1->V2
- ...

V2->V3
- ...

But that really belongs below the "end-of-changelog" comment as this info
is relevant only for this submission to lkml and not in whats get committed.

As your submission did not include an RFC I assume this is expected to be
the final version.

Sam

2008-01-08 20:29:42

by Mike Travis

[permalink] [raw]
Subject: Re: [PATCH 00/10] percpu: Per cpu code simplification V3


>
> As your submission did not include an RFC I assume this is expected to be
> the final version.

I have another version coming that includes the changes requested by you
and others.

Thanks,
Mike

2008-01-08 22:18:37

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 00/10] percpu: Per cpu code simplification V3


* Christoph Lameter <[email protected]> wrote:

> On Tue, 8 Jan 2008, Ingo Molnar wrote:
>
> > i had the patch below for v2, it's still needed (because i didnt
> > apply the s390/etc. bits), right?
>
> Well the patch really should go through mm because it is a change that
> covers multiple arches. I think testing with this is fine. I think
> Mike has diffed this against Linus tree so this works but will now
> conflict with the modcopy patch already in mm.

well we cannot really ack it for x86 inclusion without having tested it
through, so it will stay in x86.git for some time. That approach found a
few problems with v1 already. In any case, v3 is looking pretty good so
far - and it's cool stuff - i'm all for unifying/generalizing arch code.

Ingo

2008-01-08 23:53:49

by Mike Travis

[permalink] [raw]
Subject: Re: [PATCH 00/10] percpu: Per cpu code simplification V3

Ingo Molnar wrote:
> * Christoph Lameter <[email protected]> wrote:
>
>> On Tue, 8 Jan 2008, Ingo Molnar wrote:
>>
>>> i had the patch below for v2, it's still needed (because i didnt
>>> apply the s390/etc. bits), right?
>> Well the patch really should go through mm because it is a change that
>> covers multiple arches. I think testing with this is fine. I think
>> Mike has diffed this against Linus tree so this works but will now
>> conflict with the modcopy patch already in mm.
>
> well we cannot really ack it for x86 inclusion without having tested it
> through, so it will stay in x86.git for some time. That approach found a
> few problems with v1 already. In any case, v3 is looking pretty good so
> far - and it's cool stuff - i'm all for unifying/generalizing arch code.
>
> Ingo

Hi Ingo,

You probably will want to pick up V4 though I didn't add that ifndef
patch you mentioned earlier. There are no functional changes, basically
only a rebasing on the correct mm version.

Thanks,
Mike