Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-29 Thread Rusty Russell
On Thursday 29 November 2007 10:36:06 Christoph Lameter wrote: > The code becomes much simpler if gs would point to the beginning of the > per cpu area and if the __per_cpu_offset[i] would do the same. No weird > __per_cpu_start offsetting anymore. It is a little weird, but it gave flexibility

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-29 Thread Rusty Russell
On Thursday 29 November 2007 10:36:06 Christoph Lameter wrote: The code becomes much simpler if gs would point to the beginning of the per cpu area and if the __per_cpu_offset[i] would do the same. No weird __per_cpu_start offsetting anymore. It is a little weird, but it gave flexibility for

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
Second portion. Add a new seg_offset macro to calculate the offset. This can be avoided if the linker relocates the per cpu area to zero. Includes a patch to read trickle count via both methods to verify that it actually works. Both patches on top of the per cpu cleanup patches that I sent

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
Here is the first of two patches for x86_64 that move the pda into the per cpu area and then make the x86 percpu macros work for x86_64. This needs to be generalized for other arches. The __per_cpu_start offsets can be taken care of by the linker. We can also tell the linker to completely

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: > x86_64 can use a 32 bit offset instead of a 64 bit addres because it uses > the small model. A load of a 64 bit address would require much more > expensive instructions. A load of a 64 bit address is currently avoided > through the use of the pda that contains the

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: > > percpu references are quite frequent already (vm statistics) and will be > > more frequent after we have converted the per cpu arrays to per cpu > > allocations. > > > > Well, I think the point is moot, because x86 will always use 32-bit >

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: > The percpu areas need to be allocated in a NUMA aware fashion. Otherwise > you use distant memory for the most performance sensitive areas. The NUMA > subsystem must be so far up that these allocations can be performed in the > right way. And this means at least you

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: > Don't think it matters either way. Before percpu is allocated, NUMA > issues don't matter. Once they are - by whatever mechanism - you can > set the segment bases up appropriately. The fact that you chose to put > percpu data at address X

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: > On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: > > >> I don't see the problem. The way i386 does it inherently supports >> per-cpu data very early on (it uses the prototype percpu section until >> the real percpu values are set up). >> > > Ok so we could do

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: > I don't see the problem. The way i386 does it inherently supports > per-cpu data very early on (it uses the prototype percpu section until > the real percpu values are set up). Ok so we could do that for x86_64 as well? There is more complicated

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Andi Kleen
> * drop support for stack-protector (does it really help? do people > use it?) AFAIK we only ever had a single classical stack buffer overflow in the kernel. It certainly doesn't seem to be a common security problem it is solving. -Andi - To unsubscribe from this list: send the line

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: > On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: > > > Yes, I would like to convert x86_64 to match i386's percpu, and drop the > >> pda altogether. The only thing preventing this is the stack canary, and >> I'm wondering how much value there is in keeping it, given

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Thu, 29 Nov 2007, Andi Kleen wrote: > On Wed, Nov 28, 2007 at 04:11:37PM -0800, Christoph Lameter wrote: > > 1. The stack canary > > You would need to change gcc with a new option and only allow the stack > checking when the compiler supports the new option. However the problem > is still how

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Andi Kleen
On Wed, Nov 28, 2007 at 04:11:37PM -0800, Christoph Lameter wrote: > 1. The stack canary You would need to change gcc with a new option and only allow the stack checking when the compiler supports the new option. However the problem is still how to get a reasonable fixed offset. Or perhaps just

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: > Yes, I would like to convert x86_64 to match i386's percpu, and drop the > pda altogether. The only thing preventing this is the stack canary, and > I'm wondering how much value there is in keeping it, given the > disadvantages of having this

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Rusty Russell wrote: > On Thursday 29 November 2007 05:51:29 Christoph Lameter wrote: > >> On Wed, 28 Nov 2007, Rusty Russell wrote: >> >>> On Wednesday 28 November 2007 05:14:47 Christoph Lameter wrote: >>> On Tue, 27 Nov 2007, Rusty Russell wrote: > Have you

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Thu, 29 Nov 2007, Rusty Russell wrote: > But the PDA itself is silly (Jeremy ported it to i386 and I balked). We have > a generic one: it's called the per-cpu data. Having a completely separate > per-cpu structure for x86-64 is a mistake. Yes ultimately the pda can be dissolved. However,

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Rusty Russell
On Thursday 29 November 2007 05:51:29 Christoph Lameter wrote: > On Wed, 28 Nov 2007, Rusty Russell wrote: > > On Wednesday 28 November 2007 05:14:47 Christoph Lameter wrote: > > > On Tue, 27 Nov 2007, Rusty Russell wrote: > > > > Have you considered moving x86-64's setup_per_cpu_areas into

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Rusty Russell wrote: > On Wednesday 28 November 2007 05:14:47 Christoph Lameter wrote: > > On Tue, 27 Nov 2007, Rusty Russell wrote: > > > Have you considered moving x86-64's setup_per_cpu_areas into generic > > > code? It's a bit messier because some archs might not have set

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Rusty Russell wrote: On Wednesday 28 November 2007 05:14:47 Christoph Lameter wrote: On Tue, 27 Nov 2007, Rusty Russell wrote: Have you considered moving x86-64's setup_per_cpu_areas into generic code? It's a bit messier because some archs might not have set up NUMA

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Rusty Russell
On Thursday 29 November 2007 05:51:29 Christoph Lameter wrote: On Wed, 28 Nov 2007, Rusty Russell wrote: On Wednesday 28 November 2007 05:14:47 Christoph Lameter wrote: On Tue, 27 Nov 2007, Rusty Russell wrote: Have you considered moving x86-64's setup_per_cpu_areas into generic

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Thu, 29 Nov 2007, Rusty Russell wrote: But the PDA itself is silly (Jeremy ported it to i386 and I balked). We have a generic one: it's called the per-cpu data. Having a completely separate per-cpu structure for x86-64 is a mistake. Yes ultimately the pda can be dissolved. However, the

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Rusty Russell wrote: On Thursday 29 November 2007 05:51:29 Christoph Lameter wrote: On Wed, 28 Nov 2007, Rusty Russell wrote: On Wednesday 28 November 2007 05:14:47 Christoph Lameter wrote: On Tue, 27 Nov 2007, Rusty Russell wrote: Have you considered moving

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: Yes, I would like to convert x86_64 to match i386's percpu, and drop the pda altogether. The only thing preventing this is the stack canary, and I'm wondering how much value there is in keeping it, given the disadvantages of having this

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Thu, 29 Nov 2007, Andi Kleen wrote: On Wed, Nov 28, 2007 at 04:11:37PM -0800, Christoph Lameter wrote: 1. The stack canary You would need to change gcc with a new option and only allow the stack checking when the compiler supports the new option. However the problem is still how to get

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: Yes, I would like to convert x86_64 to match i386's percpu, and drop the pda altogether. The only thing preventing this is the stack canary, and I'm wondering how much value there is in keeping it, given the

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Andi Kleen
On Wed, Nov 28, 2007 at 04:11:37PM -0800, Christoph Lameter wrote: 1. The stack canary You would need to change gcc with a new option and only allow the stack checking when the compiler supports the new option. However the problem is still how to get a reasonable fixed offset. Or perhaps just

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Andi Kleen
* drop support for stack-protector (does it really help? do people use it?) AFAIK we only ever had a single classical stack buffer overflow in the kernel. It certainly doesn't seem to be a common security problem it is solving. -Andi - To unsubscribe from this list: send the line

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: I don't see the problem. The way i386 does it inherently supports per-cpu data very early on (it uses the prototype percpu section until the real percpu values are set up). Ok so we could do that for x86_64

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: Don't think it matters either way. Before percpu is allocated, NUMA issues don't matter. Once they are - by whatever mechanism - you can set the segment bases up appropriately. The fact that you chose to put percpu data at address X doesn't

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: I don't see the problem. The way i386 does it inherently supports per-cpu data very early on (it uses the prototype percpu section until the real percpu values are set up). Ok so we could do that for x86_64 as well? There is more complicated

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: The percpu areas need to be allocated in a NUMA aware fashion. Otherwise you use distant memory for the most performance sensitive areas. The NUMA subsystem must be so far up that these allocations can be performed in the right way. And this means at least you need

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
On Wed, 28 Nov 2007, Jeremy Fitzhardinge wrote: percpu references are quite frequent already (vm statistics) and will be more frequent after we have converted the per cpu arrays to per cpu allocations. Well, I think the point is moot, because x86 will always use 32-bit offsets.

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: x86_64 can use a 32 bit offset instead of a 64 bit addres because it uses the small model. A load of a 64 bit address would require much more expensive instructions. A load of a 64 bit address is currently avoided through the use of the pda that contains the full 64

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
Second portion. Add a new seg_offset macro to calculate the offset. This can be avoided if the linker relocates the per cpu area to zero. Includes a patch to read trickle count via both methods to verify that it actually works. Both patches on top of the per cpu cleanup patches that I sent

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-28 Thread Christoph Lameter
Here is the first of two patches for x86_64 that move the pda into the per cpu area and then make the x86 percpu macros work for x86_64. This needs to be generalized for other arches. The __per_cpu_start offsets can be taken care of by the linker. We can also tell the linker to completely

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Rusty Russell
On Wednesday 28 November 2007 05:14:47 Christoph Lameter wrote: > On Tue, 27 Nov 2007, Rusty Russell wrote: > > Have you considered moving x86-64's setup_per_cpu_areas into generic > > code? It's a bit messier because some archs might not have set up NUMA > > stuff yet, but it's logically

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Randy Dunlap
Christoph Lameter wrote: On Tue, 27 Nov 2007, Randy Dunlap wrote: +config ARCH_SETS_UP_PER_CPU_AREA + bool + default y def_bool y is the preferred form for those 2-liners above... + config ARCH_NO_VIRT_TO_BUS def_bool y Ok. Changed. x86 should use

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Christoph Lameter
On Tue, 27 Nov 2007, Randy Dunlap wrote: > > +config ARCH_SETS_UP_PER_CPU_AREA > > + bool > > + default y > > def_bool y > is the preferred form for those 2-liners above... > > > > + > > config ARCH_NO_VIRT_TO_BUS > > def_bool y > > Ok. Changed. x86 should use config

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Randy Dunlap
On Mon, 26 Nov 2007 16:14:12 -0800 Christoph Lameter wrote: > The use of the __GENERIC_PERCPU is a bit problematic since arches > may want to run their own percpu setup while using the generic > percpu definitions. Replace it through a kconfig variable. > > Cc: Rusty Russell <[EMAIL PROTECTED]>

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Christoph Lameter
On Tue, 27 Nov 2007, Rusty Russell wrote: > Have you considered moving x86-64's setup_per_cpu_areas into generic code? > It's a bit messier because some archs might not have set up NUMA stuff yet, > but it's logically generic... Yes that will happen later. This is just the early cleanup work.

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Christoph Lameter
On Tue, 27 Nov 2007, Rusty Russell wrote: Have you considered moving x86-64's setup_per_cpu_areas into generic code? It's a bit messier because some archs might not have set up NUMA stuff yet, but it's logically generic... Yes that will happen later. This is just the early cleanup work. I

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Randy Dunlap
On Mon, 26 Nov 2007 16:14:12 -0800 Christoph Lameter wrote: The use of the __GENERIC_PERCPU is a bit problematic since arches may want to run their own percpu setup while using the generic percpu definitions. Replace it through a kconfig variable. Cc: Rusty Russell [EMAIL PROTECTED] Cc:

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Christoph Lameter
On Tue, 27 Nov 2007, Randy Dunlap wrote: +config ARCH_SETS_UP_PER_CPU_AREA + bool + default y def_bool y is the preferred form for those 2-liners above... + config ARCH_NO_VIRT_TO_BUS def_bool y Ok. Changed. x86 should use config

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Randy Dunlap
Christoph Lameter wrote: On Tue, 27 Nov 2007, Randy Dunlap wrote: +config ARCH_SETS_UP_PER_CPU_AREA + bool + default y def_bool y is the preferred form for those 2-liners above... + config ARCH_NO_VIRT_TO_BUS def_bool y Ok. Changed. x86 should use

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-27 Thread Rusty Russell
On Wednesday 28 November 2007 05:14:47 Christoph Lameter wrote: On Tue, 27 Nov 2007, Rusty Russell wrote: Have you considered moving x86-64's setup_per_cpu_areas into generic code? It's a bit messier because some archs might not have set up NUMA stuff yet, but it's logically generic...

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-26 Thread Rusty Russell
On Tuesday 27 November 2007 11:14:12 Christoph Lameter wrote: > The use of the __GENERIC_PERCPU is a bit problematic since arches > may want to run their own percpu setup while using the generic > percpu definitions. Replace it through a kconfig variable. Thanks for this Christoph! These patches

[patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-26 Thread Christoph Lameter
The use of the __GENERIC_PERCPU is a bit problematic since arches may want to run their own percpu setup while using the generic percpu definitions. Replace it through a kconfig variable. Cc: Rusty Russell <[EMAIL PROTECTED]> Cc: Andi Kleen <[EMAIL PROTECTED]> Signed-off-by: Christoph Lameter

[patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-26 Thread Christoph Lameter
The use of the __GENERIC_PERCPU is a bit problematic since arches may want to run their own percpu setup while using the generic percpu definitions. Replace it through a kconfig variable. Cc: Rusty Russell [EMAIL PROTECTED] Cc: Andi Kleen [EMAIL PROTECTED] Signed-off-by: Christoph Lameter [EMAIL

Re: [patch 05/14] percpu: Use a Kconfig variable to configure arch specific percpu setup

2007-11-26 Thread Rusty Russell
On Tuesday 27 November 2007 11:14:12 Christoph Lameter wrote: The use of the __GENERIC_PERCPU is a bit problematic since arches may want to run their own percpu setup while using the generic percpu definitions. Replace it through a kconfig variable. Thanks for this Christoph! These patches