lkml.org 
[lkml]   [2007]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC, PATCH] locks: remove posix deadlock detection
    On Sun, 28 Oct 2007, Matthew Wilcox wrote:

    > > A potential for deadlock occurs if a process controlling a locked
    > > region is put to sleep by attempting to lock another process'
    > > locked region. If the system detects that sleeping until a locked
    > > region is unlocked would cause a deadlock, fcntl() shall fail with
    > > an [EDEADLK] error.
    > > This is what POSIX says [1], even after being modified with respect to
    > > POSIX Threads Extension, right? So it doesn't deal with threads at
    > > all, just processess are taken into account. Probably for a reason :)
    > Did you have a concrete suggestion, or are you just quoting the spec?

    I was quoting the spec and I thought that the suggestion is implicit --
    the specification defines what happens only when processess are in place.
    If the application uses POSIX threads in combination with locks, it is
    going to receive undefined behavior.

    > The problem is that it's nonsense -- processes don't sleep, threads do.
    > I think the key is "would deadlock", not "might deadlock". Our current
    > behaviour is clearly in violation of SuSv3.

    - either we can add a special fcntl() Linux-specific flag, that will ask
    the kernel not to perform deadlock detection. Any application that is
    combining threads and posix locks (and thus IMHO asking for undefined
    behavior) could use this flag and not receive EDEADLK any more

    - or we can add some heuristics here-and-there to track which
    current->files are shared and which are not, and do not return EDEADLK
    in the case of shared ->files (could be a little bit tricky)

    --
    Jiri Kosina
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-10-29 10:15    [W:2.385 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site