Re: [RFC, PATCH] locks: remove posix deadlock detection
- From: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 29 Oct 2007 08:06:04 +0000
On Sun, 28 Oct 2007 13:43:21 -0400
"J. Bruce Fields" <bfields@xxxxxxxxxxxx> wrote:
From: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>
We currently attempt to return -EDEALK to blocking fcntl() file locking
requests that would create a cycle in the graph of tasks waiting on
locks.
This is inefficient: in the general case it requires us determining
whether we're adding a cycle to an arbitrary directed acyclic graph.
And this calculation has to be performed while holding a lock (currently
the BKL) that prevents that graph from changing.
It has historically been a source of bugs; most recently it was noticed
that it could loop indefinitely while holding the BKL.
It seems unlikely to be useful to applications:
- The difficulty of implementation has kept standards from
requiring it. (E.g. SUSv3 : "Since implementation of full
deadlock detection is not always feasible, the [EDEADLK] error
was made optional.") So portable applications may not be able to
depend on it.
- It only detects deadlocks that involve nothing but local posix
file locks; deadlocks involving network filesystems or other kinds
of locks or resources are missed.
It therefore seems best to remove deadlock detection.
Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>
NAK. This is an ABI change and one that was rejected before when this was
last discussed in detail. Moving it out of BKL makes a ton of sense, even
adding a "don't check" flag makes a lot of sense. Removing the checking
does not.
I'd much rather see
if (flags & FL_NODLCHECK)
posix_deadlock_detect(....)
The failure case for removing this feature is obscure and hard to debug
application hangs for the afflicted programs - not nice for users at all.
Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [RFC, PATCH] locks: remove posix deadlock detection
- From: J. Bruce Fields
- Re: [RFC, PATCH] locks: remove posix deadlock detection
- References:
- [RFC][PATCH] Fix hang in posix_locks_deadlock()
- From: George G. Davis
- Re: [RFC][PATCH] Fix hang in posix_locks_deadlock()
- From: George G. Davis
- Re: [RFC][PATCH] Fix hang in posix_locks_deadlock()
- From: J. Bruce Fields
- Re: [RFC][PATCH] Fix hang in posix_locks_deadlock()
- From: J. Bruce Fields
- [PATCH] locks: fix possible infinite loop in posix deadlock detection
- From: J. Bruce Fields
- [RFC, PATCH] locks: remove posix deadlock detection
- From: J. Bruce Fields
- [RFC][PATCH] Fix hang in posix_locks_deadlock()
- Prev by Date: Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device
- Next by Date: Re: [RFC, PATCH] locks: remove posix deadlock detection
- Previous by thread: Re: [RFC, PATCH] locks: remove posix deadlock detection
- Next by thread: Re: [RFC, PATCH] locks: remove posix deadlock detection
- Index(es):
Relevant Pages
|