From: Andi Kleen <andi@firstfloor.org>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Christoph Hellwig <hch@infradead.org>, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] Remove BKL from fs/locks.c
Date: Sun, 30 Dec 2007 16:17:11 +0100 [thread overview]
Message-ID: <p7363yg1abs.fsf@bingen.suse.de> (raw)
In-Reply-To: <20071230145158.GU11638@parisc-linux.org> (Matthew Wilcox's message of "Sun\, 30 Dec 2007 07\:51\:59 -0700")
Matthew Wilcox <matthew@wil.cx> writes:
>
> The blocked_list is a bit more complex since we need to check every lock
> on the blocked list, and would need to acquire all the sb_file_lock_locks
> to check this list consistently. I don't see a nice way to do this --
> particularly when you consider that we need to run this check every time
> someone takes out a POSIX lock that blocks on another lock.
Have you considered using a timeout approach? e.g. just start a timer
when aquiring the lock and when you can't get it in some short (user configurable)
time and only do then the expensive deadlock check. Timers are quite optimized
and have per cpu state so they should be cheap enough.
AFAIK that's a standard technique used in databases. Advantage is that it
keeps all that out of the fast path.
Disadvantage is that it takes at least timeout time to detect a deadlock, but
they should be infrequent anyways I guess so it's hopefully not a problem
(and if it was the user could reset the timeout to 0)
-Andi
next prev parent reply other threads:[~2007-12-30 15:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-30 6:16 [RFC] Remove BKL from fs/locks.c Matthew Wilcox
2007-12-30 9:36 ` Stephen Rothwell
2007-12-30 14:42 ` Matthew Wilcox
2007-12-31 0:47 ` Stephen Rothwell
2007-12-30 13:05 ` Christoph Hellwig
2007-12-30 14:51 ` Matthew Wilcox
2007-12-30 15:17 ` Andi Kleen [this message]
2007-12-30 18:44 ` Trond Myklebust
2007-12-30 19:18 ` Andi Kleen
2007-12-30 19:23 ` Trond Myklebust
2008-01-04 23:41 ` J. Bruce Fields
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=p7363yg1abs.fsf@bingen.suse.de \
--to=andi@firstfloor.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=matthew@wil.cx \
/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;
as well as URLs for NNTP newsgroup(s).