On 2018/5/24 15:15, Sebastian Andrzej Siewior wrote:
On 2018-05-24 10:58:44 [+0800], Jason Yan wrote:
I think it's fine to delete this irq save code. As for the "TODO"
comment, I think we can add:

BUG_ON(!irqs_disabled());

or

WARN_ON_ONCE(!irqs_disabled());

no, please don't do this. Please add instead
        lockdep_assert_held()

on the lock in question and let lockdep to its work. Lockdep has way
better coverage than your irqs_disabled() check which also breaks RT.


lockdep_assert_held() cannot detect the irq state, it can only detect
whether we have held the lock.

Because you are trying to delete the irq-save code which will make the
comment hard to understand, I'm just giving an advise. It's welcome
if you have a better way.

Thanks.

and then delete the "TODO" comment.

Sebastian

.


Reply via email to