Date: Wed, 6 Jan 2016 14:19:01 +0900 From: Kengo NAKAHARA <k-nakah...@iij.ad.jp>
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.