Re: Question about policy of calling lockdep functions in trylocks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Tuesday, March 2, 2010 - 2:13 am

On Tue, 2010-03-02 at 17:44 +0900, Hitoshi Mitake wrote:

Did you mean to call acquire twice?


Well, trylocks cannot contend, so the lock_contended() call doesn't make
sense, I don't think it will confuse lockstat, since acquire will simply
reset the state again, but it will waste cycles, nor is there a reason
to call acquired without first having call contended. So no.

What exactly is the problem, the lack of callbacks for a failed trylock?
Why would you want one?

Because other than that I see no problem, you get an acquire(.try=1) and
a release() to match and lockstat measure and accounts the hold-time.





--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Question about policy of calling lockdep functions in ..., Peter Zijlstra, (Tue Mar 2, 2:13 am)