Re: alignment requirements for kmutex_t

Jörg Sonnenberger <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On 3/30/25 10:14 AM, Beesdeckar wrote:
> Hello,
> I found that global variable of type kmutex_t is on many places defined 
> like:
> kmutex_t variable_name __cacheline_aligned;
> 
> Two questions,
> 1. Is __cacheline_aligned mandatory for global/static variables of type 
> kmutex in kernel space ?

No, it's a performance optimization only. Basically, avoid cache line 
sharing with something that is potentially highly contested.

Joerg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.