lkml.org 
[lkml]   [2012]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: + syscalls-x86-add-__nr_kcmp-syscall-v8.patch added to -mm tree
On 02/16, Vasiliy Kulikov wrote:
>
> On Thu, Feb 16, 2012 at 20:49 +0400, Cyrill Gorcunov wrote:
> > + err = mutex_lock_killable(m1);
> > + if (!err && likely(m1 != m2)) {
> > + err = mutex_lock_killable_nested(m2, SINGLE_DEPTH_NESTING);
>
> Doesn't it lead to a deadlock?
>
> mutex_lock_killable(task1)
> | mutex_lock_killable(task2)
> mutex_lock_killable_nested(task2) |
> (locked) |
> mutex_lock_killable_nested(task1)
> (locked)

Please note the

if (m1 >= m2)
swap(m1. m2)

at the start.

Oleg.



\
 
 \ /
  Last update: 2012-02-16 20:13    [W:0.148 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site