From: Esben Nielsen <simlo@phys.au.dk>
To: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>,
Daniel Walker <dwalker@mvista.com>,
linux-kernel@vger.kernel.org, Ulrich Drepper <drepper@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [patch 0/6] lightweight robust futexes: -V3 - Why in userspace?
Date: Fri, 17 Feb 2006 00:20:34 +0100 (MET) [thread overview]
Message-ID: <Pine.OSF.4.05.10602170003380.22107-100000@da410> (raw)
In-Reply-To: <20060216223618.GA8182@elte.hu>
On Thu, 16 Feb 2006, Ingo Molnar wrote:
>
> * Esben Nielsen <simlo@phys.au.dk> wrote:
>
> > As I understand the protocol the userspace task writes it's pid into
> > the lock atomically when locking it and erases it atomically when it
> > leaves the lock. If it is killed inbetween the pid is still there. Now
> > if another task comes along it reads the pid, sets the wait flag and
> > goes into the kernel. The kernel will now be able to see that the pid
> > is no longer valid and therefore the owner must be dead.
>
> this is racy - we cannot know whether the PID wrapped around.
>
What about adding more bits to check on? The PID to lookup the task_t and
then some extra bits to uniquely identify the actual task.
> nor does this method offer any solution for the case where there are
> already waiters pending: they might be hung forever.
It was for this case I suggested maintaining a list of waiters within the
kernel on each task_t. The adding has to be done FUTEX_WAIT so the adding
operation needs to be protected.
> With our solution
> one of those waiters gets woken up and notice that the lock is dead.
> (and in the unlikely even of that thread dying too while trying to
> recover the data, the kernel will do yet another wakeup, of the next
> waiter.)
>
I admit your solution is a good one. The only drawback - besides being
untraditional - is that memory corruption can leave futexes locked at
exit.
Esben
> Ingo
> -
> 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/
>
next prev parent reply other threads:[~2006-02-16 23:24 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-16 9:41 [patch 0/6] lightweight robust futexes: -V3 Ingo Molnar
2006-02-16 16:33 ` Daniel Walker
2006-02-16 17:24 ` Ingo Molnar
2006-02-16 17:34 ` Daniel Walker
2006-02-16 19:06 ` [patch 0/6] lightweight robust futexes: -V3 - Why in userspace? Esben Nielsen
2006-02-16 19:34 ` Arjan van de Ven
2006-02-16 20:04 ` Esben Nielsen
2006-02-16 20:17 ` Esben Nielsen
2006-02-16 20:23 ` Christopher Friesen
2006-02-16 20:36 ` Ingo Molnar
2006-02-16 22:32 ` Esben Nielsen
2006-02-16 22:36 ` Ingo Molnar
2006-02-16 23:20 ` Esben Nielsen [this message]
2006-02-16 23:39 ` Ingo Molnar
2006-02-17 0:20 ` Esben Nielsen
2006-02-17 0:42 ` Ingo Molnar
2006-02-17 23:47 ` Andrew James Wade
2006-02-16 20:23 ` [patch 0/6] lightweight robust futexes: -V3 Ingo Molnar
2006-02-16 20:54 ` Daniel Walker
2006-02-16 21:26 ` Ingo Molnar
2006-02-16 21:50 ` Christopher Friesen
2006-02-16 21:55 ` Ingo Molnar
2006-02-16 20:47 ` Paul Jackson
2006-02-16 21:35 ` Ingo Molnar
2006-02-16 21:23 ` Paul Jackson
2006-02-16 21:50 ` Ingo Molnar
2006-02-17 4:56 ` Paul Jackson
2006-02-17 9:41 ` Ingo Molnar
2006-02-17 11:59 ` Ingo Molnar
2006-02-17 20:50 ` Paul Jackson
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=Pine.OSF.4.05.10602170003380.22107-100000@da410 \
--to=simlo@phys.au.dk \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=drepper@redhat.com \
--cc=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®