Date: Mon, 27 Oct 2014 16:34:33 -0700 From: John-Mark Gurney <jmg@funkthat.com> To: Mateusz Guzik <mjguzik@gmail.com> Cc: Alan Cox <alc@rice.edu>, Konstantin Belousov <kib@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: amd64 modules still use atomics as callable functions Message-ID: <20141027233432.GR82214@funkthat.com> In-Reply-To: <20141027224901.GC28049@dft-labs.eu> References: <20141027224901.GC28049@dft-labs.eu>
next in thread | previous in thread | raw e-mail | index | archive | help
Mateusz Guzik wrote this message on Mon, Oct 27, 2014 at 23:49 +0100: > Turns out several years ago the kernel was modified to provide actual > functions for atomic operations and modules are always using them. > > I propose plugging it on amd64 in head. It'd be interesting to measure the difference between making the call, and the cost of the lock prefix... On modern processors, according to instruction_tables.pdf, the lock prefix costs between 5 and 45 cycles.. It could be more on older processors... Though another references says that a function call over head is in the 7-9 cycle range, so w/o measuring, I'm not so sure this is a good idea... Originally I was in favor of this, as the number of amd64 systems that aren't SMP aware are getting rarer by the day... But, considering that many locking ops (if contended) will take a lot longer, I'm not so sure that the inline call will save you that much.. It'd be useful to see a comparision between: LOCK'd inlined LOCK'd via function call non-LOCK'd inlined -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141027233432.GR82214>