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 an...@freebsd.org 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

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 an...@freebsd.org wrote: ... Let's go back and see how we can do this the sanest way. These are the options I see at

svn commit: r242014 - head/sys/kern

2012-10-24 Thread Jim Harris
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 searches (which read tdq_load) to operate independently of any contention on

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

2012-10-24 Thread Adrian Chadd
On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org 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

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 searches

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

2012-10-24 Thread Jim Harris
On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org 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 11:43 AM, John Baldwin j...@freebsd.org 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

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

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 8:00 PM, Jim Harris jim.har...@gmail.com wrote: On Wed, Oct 24, 2012 at 11:43 AM, John Baldwin j...@freebsd.org 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:

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

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 7:56 PM, Jim Harris jim.har...@gmail.com wrote: On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org wrote: Pad tdq_lock to avoid false sharing with tdq_load and tdq_cpu_idle. Ok, but..

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

2012-10-24 Thread Jim Harris
On Wed, Oct 24, 2012 at 12:08 PM, Attilio Rao atti...@freebsd.org wrote: On Wed, Oct 24, 2012 at 7:56 PM, Jim Harris jim.har...@gmail.com wrote: On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org wrote: Pad

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 adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org 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 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 adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org 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 an...@freebsd.org wrote: snip 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

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

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 8:16 PM, Andre Oppermann an...@freebsd.org wrote: On 24.10.2012 20:56, Jim Harris wrote: On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org wrote: Pad tdq_lock to avoid false sharing

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 an...@freebsd.org wrote: On 24.10.2012 20:56, Jim Harris wrote: On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org

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

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 8:30 PM, Alexander Motin m...@freebsd.org 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 adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org

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 an...@freebsd.org wrote: snip 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.

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 jim.har...@gmail.com wrote: On Wed, Oct 24, 2012 at 11:43 AM, John Baldwin j...@freebsd.org wrote: On Wednesday, October 24, 2012 2:36:41 pm Jim Harris wrote: Author: jimharris Date: Wed Oct 24 18:36:41 2012

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

2012-10-24 Thread Attilio Rao
On Wed, Oct 24, 2012 at 9:25 PM, Andre Oppermann an...@freebsd.org wrote: On 24.10.2012 21:06, Attilio Rao wrote: On Wed, Oct 24, 2012 at 8:00 PM, Jim Harris jim.har...@gmail.com wrote: On Wed, Oct 24, 2012 at 11:43 AM, John Baldwin j...@freebsd.org wrote: On Wednesday, October 24, 2012

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 adr...@freebsd.org wrote: On 24 October 2012 11:36, Jim Harris jimhar...@freebsd.org wrote: Pad tdq_lock to avoid

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 an...@freebsd.org 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

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 an...@freebsd.org 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

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 an...@freebsd.org 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

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