Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jan 2013 10:39:17 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-net@freebsd.org
Cc:        Barney Cordoba <barney_cordoba@yahoo.com>, Peter Jeremy <peter@rulingia.com>
Subject:   Re: To SMP or not to SMP
Message-ID:  <201301111039.17673.jhb@freebsd.org>
In-Reply-To: <20130110193659.GA27156@server.rulingia.com>
References:  <1357611958.66651.YahooMailClassic@web121603.mail.ne1.yahoo.com> <20130110193659.GA27156@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, January 10, 2013 02:36:59 PM Peter Jeremy wrote:
> On 2013-Jan-07 18:25:58 -0800, Barney Cordoba <barney_cordoba@yahoo.com> 
wrote:
> >I have a situation where I have to run 9.1 on an old single core
> >box. Does anyone have a handle on whether it's better to build a non
> >SMP kernel or to just use a standard SMP build with just the one
> >core?
> 
> Another input for this decision is kern/173322.  Currently on x86,
> atomic operations within kernel modules are implemented using calls
> to code in the kernel, which do or don't use lock prefixes depending
> on whethur the kernel was built as SMP.  My proposed change changes
> kernel modules to inline atomic operations but always include lock
> prefixes (effectively reverting r49999).  I'm appreciate anyone who
> feels like testing the impact of this change.

Presumably a locked atomic op is cheaper than a function call then?  The 
current setup assumes the opposite.

I think we should actually do this for atomics in modules on x86:

1) If a module is built standalone, it should do whichever is cheaper:
   a function call or always use "LOCK".

2) If a module is built as part of the kernel build, it should use inlined
   atomics that match what the kernel does.  Thus, modules built with a
   non-SMP kernel would use inlined atomic ops that do not use LOCK.  We
   have a way to detect this now (some HAVE_FOO #define added in the past
   few years) that we didn't back when this bit of atomic.h was written.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301111039.17673.jhb>