Re: Internal vs. external barriers (was: Re: Interesting LKMM litmus test)
From: Alan Stern
Date: Fri Jan 20 2023 - 11:18:32 EST
On Fri, Jan 20, 2023 at 11:13:00AM +0100, Jonas Oberhauser wrote:
> Perhaps we could say that reading an index without using it later is
> forbidden?
>
> flag ~empty [Srcu-lock];data;rf;[~ domain(data;[Srcu-unlock])] as
> thrown-srcu-cookie-on-floor
We already flag locks that don't have a matching unlock. I don't see
any point in worrying about whatever else happens to the index.
> So if there is an srcu_down() that produces a cookie that is read by some
> read R, and R doesn't then pass that value into an srcu_up(), the
> srcu-warranty is voided.
No, it isn't. As long as the value is passed to exactly one
srcu_up_read(), it doesn't much matter what else you do with it.
Alan