Re: Q: lockdep_assert_held_read() after downgrade_write()

J. R. Okajima
2017-02-02T16:33:26Z

Peter Zijlstra:
> Does something like the below work better? The annotation in
> downgrade_write() would look something like:
>
> + lock_downgrade(&sem->dep_map, 1, _RET_IP_);
>
> Not even compile tested and lacks the !LOCKDEP build bits.

Thanks for the patch.
It seems working expectedly. I began writing a similar patch locally
with minor consolidations by adding a new function or two. I will send a
patch series. Please review and merge them into v4.10. If you don't like
the patch, especially the new function name, feel free to change it.
I don't know whether !LOCKDEP build bits are necessary or not.

J. R. Okajima