[lkml]   [2016]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] lockdep: Add a document describing crossrelease feature
On Wed, Jul 06, 2016 at 11:17:10AM +0900, Byungchul Park wrote:
> lock(A)
> wait_for(B)
> ~~~~~~~~~~~~~~~~~~~~~~~~ <- serialized by atomic operation
> lock(A)
> unlock(A)
> wake(B)
> unlock(A)

By the way, I have a question. Is there anyone who could answer it?

I want to serialize between two context's lock operations, for example,

context A context B
-------------- --------------
lock A
lock B ...
lock C
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <- serialization
lock D
... lock E
lock F

so that we can see these in the order like A -> B -> C -> D -> E -> F.

atomic_inc_return() is used after lock C in context A, and atomic_read()
is used before lock D in context B. And I want to make it serialized when
the atomic_read() can see the increased value.

Can I use smp_mb__after_atomic() just after atomic_read() or should I use
smp_mb()? I think anyway I have to choose one of them for that ordering.

Thank you,

 \ /
  Last update: 2016-07-06 08:21    [W:0.062 / U:2.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site