Re: svn commit: r242014 - head/sys/kern

2012-10-25 Thread Alan Cox
On 10/25/2012 11:23, Andre Oppermann wrote: On 25.10.2012 05:49, Bruce Evans wrote: On Wed, 24 Oct 2012, Attilio Rao wrote: On Wed, Oct 24, 2012 at 8:16 PM, Andre Oppermann wrote: ... Let's go back and see how we can do this the sanest way. These are the options I see at the moment: 1. sp

Re: svn commit: r242014 - head/sys/kern

2012-10-25 Thread Andre Oppermann
On 25.10.2012 05:49, Bruce Evans wrote: On Wed, 24 Oct 2012, Attilio Rao wrote: On Wed, Oct 24, 2012 at 8:16 PM, Andre Oppermann wrote: ... Let's go back and see how we can do this the sanest way. These are the options I see at the moment: 1. sprinkle __aligned(CACHE_LINE_SIZE) all over th

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Bruce Evans
On Thu, 25 Oct 2012, Andre Oppermann wrote: ... I spoke too soon. Attilio is completely right in his assessment. It does work when done on the struct definition: struct mtx { ... } __aligned(CACHE_LINE_SIZE); /* works including .bss alignment & padding */ When creating a struct (in

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Bruce Evans
On Wed, 24 Oct 2012, Attilio Rao wrote: On Wed, Oct 24, 2012 at 8:16 PM, Andre Oppermann wrote: ... Let's go back and see how we can do this the sanest way. These are the options I see at the moment: 1. sprinkle __aligned(CACHE_LINE_SIZE) all over the place This is wrong because it doesn'

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Andre Oppermann
On 24.10.2012 22:55, Andre Oppermann wrote: On 24.10.2012 22:29, Attilio Rao wrote: On Wed, Oct 24, 2012 at 9:25 PM, Andre Oppermann wrote: On 24.10.2012 21:06, Attilio Rao wrote: As I've already said in another thread __align() doesn't work on object declaration, so what that won't pad it ei

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Brett
> >>> As I've already said in another thread __align() doesn't work on > >>> object declaration, so what that won't pad it either if it is global > >>> or part of a struct. > >>> It is just implemented as __attribute__((aligned(X))): > >>> http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Type-Attributes.h

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Andre Oppermann
On 24.10.2012 22:29, Attilio Rao wrote: On Wed, Oct 24, 2012 at 9:25 PM, Andre Oppermann wrote: On 24.10.2012 21:06, Attilio Rao wrote: As I've already said in another thread __align() doesn't work on object declaration, so what that won't pad it either if it is global or part of a struct. It

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Andre Oppermann
On 24.10.2012 21:30, Alexander Motin wrote: On 24.10.2012 22:16, Andre Oppermann wrote: On 24.10.2012 20:56, Jim Harris wrote: On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: On 24 October 2012 11:36, Jim Harris wrote: Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 9:25 PM, Andre Oppermann wrote: > On 24.10.2012 21:06, Attilio Rao wrote: >> >> On Wed, Oct 24, 2012 at 8:00 PM, Jim Harris wrote: >>> >>> On Wed, Oct 24, 2012 at 11:43 AM, John Baldwin wrote: On Wednesday, October 24, 2012 2:36:41 pm Jim Harris wrote: > >>>

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Andre Oppermann
On 24.10.2012 21:06, Attilio Rao wrote: On Wed, Oct 24, 2012 at 8:00 PM, Jim Harris wrote: On Wed, Oct 24, 2012 at 11:43 AM, John Baldwin wrote: On Wednesday, October 24, 2012 2:36:41 pm Jim Harris wrote: Author: jimharris Date: Wed Oct 24 18:36:41 2012 New Revision: 242014 URL: http://svn.f

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Andre Oppermann
On 24.10.2012 21:49, Jim Harris wrote: On Wed, Oct 24, 2012 at 12:16 PM, Andre Oppermann wrote: See also the discussion on svn-src-all regarding global struct mtx alignment. Thank you for proving my point. ;) Let's go back and see how we can do this the sanest way. These are the options

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 8:30 PM, Alexander Motin wrote: > On 24.10.2012 22:16, Andre Oppermann wrote: >> >> On 24.10.2012 20:56, Jim Harris wrote: >>> >>> On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd >>> wrote: On 24 October 2012 11:36, Jim Harris wrote: >Pad tdq_lock to

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Jeff Roberson
On Wed, 24 Oct 2012, Attilio Rao wrote: On Wed, Oct 24, 2012 at 8:16 PM, Andre Oppermann wrote: On 24.10.2012 20:56, Jim Harris wrote: On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: On 24 October 2012 11:36, Jim Harris wrote: Pad tdq_lock to avoid false sharing with tdq_load

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 8:16 PM, Andre Oppermann wrote: > On 24.10.2012 20:56, Jim Harris wrote: >> >> On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: >>> >>> On 24 October 2012 11:36, Jim Harris wrote: >>> Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. >>> >>>

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Jim Harris
On Wed, Oct 24, 2012 at 12:16 PM, Andre Oppermann wrote: > > > See also the discussion on svn-src-all regarding global struct mtx > alignment. > > Thank you for proving my point. ;) > > Let's go back and see how we can do this the sanest way. These are > the options I see at the moment: > > 1.

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Alexander Motin
On 24.10.2012 22:16, Andre Oppermann wrote: On 24.10.2012 20:56, Jim Harris wrote: On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: On 24 October 2012 11:36, Jim Harris wrote: Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. Ok, but.. struct mtx

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Andre Oppermann
On 24.10.2012 20:56, Jim Harris wrote: On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: On 24 October 2012 11:36, Jim Harris wrote: Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. Ok, but.. struct mtx tdq_lock; /* run queue lock. *

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Jim Harris
On Wed, Oct 24, 2012 at 12:08 PM, Attilio Rao wrote: > On Wed, Oct 24, 2012 at 7:56 PM, Jim Harris wrote: >> On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: >>> On 24 October 2012 11:36, Jim Harris wrote: >>> Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. >>> >

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 7:56 PM, Jim Harris wrote: > On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: >> On 24 October 2012 11:36, Jim Harris wrote: >> >>> Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. >> >> Ok, but.. >> >> >>> struct mtx tdq_lock;

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 8:00 PM, Jim Harris wrote: > On Wed, Oct 24, 2012 at 11:43 AM, John Baldwin wrote: >> On Wednesday, October 24, 2012 2:36:41 pm Jim Harris wrote: >>> Author: jimharris >>> Date: Wed Oct 24 18:36:41 2012 >>> New Revision: 242014 >>> URL: http://svn.freebsd.org/changeset/bas

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Jim Harris
On Wed, Oct 24, 2012 at 11:43 AM, John Baldwin wrote: > On Wednesday, October 24, 2012 2:36:41 pm Jim Harris wrote: >> Author: jimharris >> Date: Wed Oct 24 18:36:41 2012 >> New Revision: 242014 >> URL: http://svn.freebsd.org/changeset/base/242014 >> >> Log: >> Pad tdq_lock to avoid false sharin

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Jim Harris
On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd wrote: > On 24 October 2012 11:36, Jim Harris wrote: > >> Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. > > Ok, but.. > > >> struct mtx tdq_lock; /* run queue lock. */ >> + charpad[

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread John Baldwin
On Wednesday, October 24, 2012 2:36:41 pm Jim Harris wrote: > Author: jimharris > Date: Wed Oct 24 18:36:41 2012 > New Revision: 242014 > URL: http://svn.freebsd.org/changeset/base/242014 > > Log: > Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. > > This enables CPU sea

Re: svn commit: r242014 - head/sys/kern

2012-10-24 Thread Adrian Chadd
On 24 October 2012 11:36, Jim Harris wrote: > Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. Ok, but.. > struct mtx tdq_lock; /* run queue lock. */ > + charpad[64 - sizeof(struct mtx)]; .. don't we have an existing compile ti