public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hubertus Franke <frankeh@watson.ibm.com>
To: Rusty Russell <rusty@rustcorp.com.au>, Robert Love <rml@tech9.net>
Cc: Davide Libenzi <davidel@xmailserver.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fast Userspace Mutexes III.
Date: Tue, 5 Mar 2002 10:09:47 -0500	[thread overview]
Message-ID: <20020305150842.247963FE07@smtp.linux.ibm.com> (raw)
In-Reply-To: <E16i5tL-0006NV-00@wagner.rustcorp.com.au>
In-Reply-To: <E16i5tL-0006NV-00@wagner.rustcorp.com.au>

On Monday 04 March 2002 10:45 pm, Rusty Russell wrote:
> In message <1015293007.882.87.camel@phantasy> you write:
> > On Mon, 2002-03-04 at 17:15, Davide Libenzi wrote:
> > > That's great. What if the process holding the mutex dies while there're
> > > sleeping tasks waiting for it ?
> >
> > I can't find an answer in the code (meaning the lock is lost...) and no
> > one has yet answered.  Davide, have you noticed anything?
> >
> > I think this needs a proper solution..
>
>
> If you want this, use fcntl locks (see TDB).  If you don't tell the kernel
> what you are doing (which is the reason these locks are fast), it cannot
> clean up for you.
>
> One could conceive of a solution where a process told the kernel
> "here is where I keep my lock states: if I die, clean up".  Of course,
> there's a race there too.
>

Yes, the problem goes even deeper. A simple hook is not enough.
One must know who is actually holding the lock, so that the cleanup
routines do the right thing.
E.g. store the pid with the lock. As Rusty stated this has still race 
conditions.
Anyway, this should be orthogonal to the low level services
provided. 
Another issue is that of rwlocks. Here its perfectly OK to die if
you hold the lock in read mode and clean up before going away.

Again, this should not be part of the base service.

> IMHO, given that the lock is protecting something which is left in an
> unknown state, this is something which would require serious testing
> to be proven worthwhile.
>


> Hope that helps,
> Rusty.

-- 
-- Hubertus Franke  (frankeh@watson.ibm.com)

  parent reply	other threads:[~2002-03-05 15:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-04  3:55 [PATCH] Fast Userspace Mutexes III Rusty Russell
2002-03-04 19:49 ` Robert Love
2002-03-04 20:13   ` Davide Libenzi
2002-03-04 20:20     ` Matthew Kirkwood
2002-03-04 20:48     ` Hubertus Franke
2002-03-04 22:15       ` Davide Libenzi
2002-03-05  1:50         ` Robert Love
2002-03-05  2:53           ` Davide Libenzi
2002-03-05  3:45           ` Rusty Russell
2002-03-05  3:55             ` Davide Libenzi
2002-03-05  6:11               ` Rusty Russell
2002-03-05 17:23                 ` Davide Libenzi
2002-03-05 15:09             ` Hubertus Franke [this message]
2002-03-05  4:30           ` Edgar Toernig
2002-03-07  1:58         ` Richard Henderson
2002-03-07  2:10           ` Davide Libenzi
2002-03-05  4:48       ` Rusty Russell
2002-03-05 15:15         ` Hubertus Franke
2002-03-06  1:31           ` Rusty Russell
2002-03-05  1:34   ` Rusty Russell
2002-03-07  1:52 ` Richard Henderson
2002-03-07  3:39   ` Rusty Russell
2002-03-07  8:48     ` Richard Henderson
2002-03-07  9:17       ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020305150842.247963FE07@smtp.linux.ibm.com \
    --to=frankeh@watson.ibm.com \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox