Am 27.12.2013 um 05:17 hat Wenchao Xia geschrieben: > δΊ 2013/12/13 21:22, Kevin Wolf ει: > > We can only have a single wait_serialising_requests() call per request > > because otherwise we can run into deadlocks where requests are waiting > > for each other. > do you mean: > mark_request_serialising(req) > ... > wait_serialising_requests(req); > ... > wait_serialising_requests(req); > > will have deadlock?
Yes, it can deadlock (it doesn't have to, it depends on whether another overlapping request is started concurrently). More precisely, the problematic pattern is: mark_request_serialising(req); ... qemu_coroutine_yield(); /* Other requests may be issued now */ ... wait_serialising_requests(req); What you mentioned above is a special case of this. > I thought it is already resolved by patch 15? > Maybe here is another deadlock reason? The problematic pattern in patch 15 was: mark_request_serialising(req); ... /* no yield here */ wait_serialising_requests(req); As opposed to the originally used: wait_serialising_requests(req); ... /* no yield here */ mark_request_serialising(req); Kevin