svn commit: r242402 - in head/sys: kern vm

Attilio Rao attilio at freebsd.org
Wed Oct 31 23:42:14 UTC 2012


On Wed, Oct 31, 2012 at 11:25 PM, Jim Harris <jim.harris at gmail.com> wrote:
>
>
> On Wed, Oct 31, 2012 at 3:55 PM, Attilio Rao <attilio at freebsd.org> wrote:
>>
>> On Wed, Oct 31, 2012 at 8:31 PM, Andre Oppermann <andre at freebsd.org>
>> wrote:
>> > You can define CACHE_LINE_SIZE to 0 on those platforms.
>> > Or to make it even more granular there could be a CACHE_LINE_SIZE_LOCKS
>> > that is used for lock padding.
>>
>> I think that this is a bright idea, albeit under the condition that
>> just like CACHE_LINE_SIZE it won't change during STABLE branches
>> timeframe and that it must not be dependent by SMP option.
>>
>> What do you think about this patch?:
>> http://www.freebsd.org/~attilio/cache_line_size_locks.patch
>
>
> Should CACHE_LINE_SIZE_LOCKS still be defined as CACHE_LINE_SIZE on arm,
> mips, etc. if SMP is enabled?  This would ensure the padding that used to be
> there in vpglock doesn't go away.

As first thing, I'm strongly against having SMP-dependant lock sizes,
as said so I won't be happy with whatever patch that changes lock
sizes based on the SMP option presence or not.
Said that, I'm not really sure if pad-aligned locks have the same
performance weight on !Intel architectures. I suspect not.

If this is not the case (then pad-aligned are important on some
architectures where I used the 1 value) I just say to go and use
CACHE_ALIGN_SIZE for them.

I think the whole point of this patch was to prevent !Intel (or most
of them, namely MIPS and ARM) architectures to avoid the pad-aligned
effect at all, otherwise this patch looks moot to me.

Said that, this changes completely the meaning of pad-align locks. If
this patch goes in it switches from "mutexes padded and aligned to the
cache line size" to "mutexes which can be padded and aligned if the
architecture can have a real benefit from doing so".

> I'm also wondering if this should be named something different, perhaps
> LOCK_ALIGNMENT.

I don't really mind whatever name you are happier with, so just pick up one.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the svn-src-all mailing list