Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Oct 2012 20:08:32 +0100
From:      Attilio Rao <attilio@freebsd.org>
To:        Jim Harris <jim.harris@gmail.com>
Cc:        svn-src-head@freebsd.org, Adrian Chadd <adrian@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org
Subject:   Re: svn commit: r242014 - head/sys/kern
Message-ID:  <CAJ-FndBOTHu=9j2DK9StzEQ5aq%2BmttZ8_T3TxjbJ7BvFhc03jg@mail.gmail.com>
In-Reply-To: <CAJP=Hc9XmvfW3MrDjvK15OAx1fyfjPk%2BEhqHUOzoEpChu5imtg@mail.gmail.com>
References:  <201210241836.q9OIafqo073002@svn.freebsd.org> <CAJ-VmonpdJ445hXVaoHqFgS0v7QRwqHWodQrVHm2CN9T661www@mail.gmail.com> <CAJP=Hc9XmvfW3MrDjvK15OAx1fyfjPk%2BEhqHUOzoEpChu5imtg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 24, 2012 at 7:56 PM, Jim Harris <jim.harris@gmail.com> wrote:
> On Wed, Oct 24, 2012 at 11:41 AM, Adrian Chadd <adrian@freebsd.org> wrote:
>> On 24 October 2012 11:36, Jim Harris <jimharris@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. */
>>> +       char            pad[64 - sizeof(struct mtx)];
>>
>> .. don't we have an existing compile time macro for the cache line
>> size, which can be used here?
>
> Yes, but I didn't use it for a couple of reasons:
>
> 1) struct tdq itself is currently using __aligned(64), so I wanted to
> keep it consistent.
> 2) CACHE_LINE_SIZE is currently defined as 128 on x86, due to
> NetBurst-based processors having 128-byte cache sectors a while back.
> I had planned to start a separate thread on arch@ about this today on
> whether this was still appropriate.

While you may want to bring CACHE_LINE_SIZE to 64, code in sched_ule
should still use CACHE_LINE_SIZE, as MI code cannot make assumption on
cache line sizes for all the architectures.
Your reasons for using 64 are valid, but a further next step to
cleanup CACHE_LINE_SIZE and then use it properly in sched_ule are due
IMHO.

Attilio


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-FndBOTHu=9j2DK9StzEQ5aq%2BmttZ8_T3TxjbJ7BvFhc03jg>