tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cacheline-aligned locks [was Re: RFC: gif(4) MP-ify]



Hi,

On 2016/01/07 0:26, Taylor R Campbell wrote:
>    Date: Wed, 6 Jan 2016 14:19:01 +0900
>    From: Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>
> 
>    I have a question for confirmation. If the struct has two locks for
>    different purposes, is the COHERENCY_UNIT padding required between
>    the locks isn't it? E.g. in my old patch(gif-mp-ify.patch), is the
>    COHERENCY_UNIT padding is required between gif_lock and struct si_sync
>    which has other lock(si_lock)?
>    # BTW, struct si_sync is removed by if_gif.h:r1.21
> 
> That may be a good idea if you expect simultaneous use of both locks
> independently -- as in struct pcq.  But without that analysis, it is
> likely premature optimization, and the wrangling of COHERENCY_UNIT
> alignment inside a struct is more trouble than it's worth.  In
> contrast, for global locks, the __cacheline_aligned attribute is no
> trouble at all.

I see. I will analyze carefully if I want to use COHERENCY_UNIT inside
struct.

Thank you very much!


Thanks,

-- 
//////////////////////////////////////////////////////////////////////
Internet Initiative Japan Inc.

Device Engineering Section,
Core Product Development Department,
Product Division,
Technology Unit

Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>


Home | Main Index | Thread Index | Old Index