tech-kern archive

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

Re: membar_enter semantics



> On Feb 11, 2022, at 7:07 AM, Taylor R Campbell <riastradh%NetBSD.org@localhost> wrote:
> 
>> Date: Fri, 11 Feb 2022 06:52:48 -0800
>> From: Jason Thorpe <thorpej%me.com@localhost>
>> 
>> I would prefer we adopt the Solaris description about a generic
>> barrier that provides "lock-is-visible-before-load/store" without
>> explicitly stating "load-before-load/store", and provide a new
>> membar_acquire() that means "load-before-load/store".
> 
> What does `lock-is-visible' mean?  How would you ever use it
> correctly, or audit correct use?  What operations do we have that have
> `lock-is-visible' semantics, which don't also imply an acquire
> operation and thus don't need an explicit barrier anyway?

Actually, you know what, I’m just going to defer on all of this.  I have a huge beef with the modern naming of various memory barrier operations (they are not intuitive at all, IMO) … so whatever.

> It turns out that _even on x86_, our membar_enter fails to implement
> the semantics we documented for it

Sure, change the documentation rather than fix the bug, then.

-- thorpej



Home | Main Index | Thread Index | Old Index