LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: Unserializing ioctl() system calls
[not found] <1YuKj-2FZ-9@gated-at.bofh.it>
@ 2004-05-22 8:03 ` Andi Kleen
0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2004-05-22 8:03 UTC (permalink / raw)
To: Spinka, Kristofer; +Cc: linux-kernel
"Spinka, Kristofer" <kspinka@style.net> writes:
> I noticed that even in the 2.6.6 code, callers to ioctl system call
> (sys_ioctl in fs/ioctl.c) are serialized with {lock,unlock}_kernel().
>
> I realize that many kernel modules, and POSIX for that matter, may not
> be ready to make this more concurrent.
POSIX doesn't care how the kernel implements locking.
> I propose adding a flag to indicate that the underlying module would
> like to support its own concurrency management, and thus we avoid
> grabbing the BKL around the f_op->ioctl call.
Better would be probably a unlocked_ioctl() entry point in f_op. Should
be pretty easy to implement.
There is also the additional issue that on 64bit systems with 32bit
userland the ioctl emulation currently relies on the BKL.
-Andi
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Unserializing ioctl() system calls
2004-05-22 2:54 ` viro
@ 2004-05-22 3:35 ` Spinka, Kristofer
0 siblings, 0 replies; 4+ messages in thread
From: Spinka, Kristofer @ 2004-05-22 3:35 UTC (permalink / raw)
To: viro; +Cc: linux-kernel
It doesn't necessarily have to be a flag on a driver, just an example.
I was more interested in a transitional interface to wean current
modules/code off of any BKL expectations during an ioctl.
Why should the kernel take out the BKL for the module during an ioctl? Does
the kernel know how long this request might take?
/kristofer
-----Original Message-----
From: viro@www.linux.org.uk [mailto:viro@www.linux.org.uk] On Behalf Of
viro@parcelfarce.linux.theplanet.co.uk
Sent: Friday, May 21, 2004 7:54 PM
To: Spinka, Kristofer
Cc: linux-kernel@vger.kernel.org
Subject: Re: Unserializing ioctl() system calls
On Fri, May 21, 2004 at 10:46:45PM -0400, Spinka, Kristofer wrote:
> I noticed that even in the 2.6.6 code, callers to ioctl
> system call (sys_ioctl in fs/ioctl.c) are serialized with
> {lock,unlock}_kernel().
>
> I realize that many kernel modules, and POSIX for that
> matter, may not be ready to make this more concurrent.
>
> I propose adding a flag to indicate that the underlying
> module would like to support its own concurrency
> management, and thus we avoid grabbing the BKL around the
> f_op->ioctl call.
>
> The default behavior would adhere to existing standards,
> and if the flag is present (in the underlying module), we
> let the module (or modules) handle it.
>
> Reasonable?
No. Flags on drivers are never a good idea. What's more, if somebody
wants that shit parallelized they can always drop BKL upon entry and
reacquire on exit from their ->ioctl().
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Unserializing ioctl() system calls
2004-05-22 2:46 Spinka, Kristofer
@ 2004-05-22 2:54 ` viro
2004-05-22 3:35 ` Spinka, Kristofer
0 siblings, 1 reply; 4+ messages in thread
From: viro @ 2004-05-22 2:54 UTC (permalink / raw)
To: Spinka, Kristofer; +Cc: linux-kernel
On Fri, May 21, 2004 at 10:46:45PM -0400, Spinka, Kristofer wrote:
> I noticed that even in the 2.6.6 code, callers to ioctl
> system call (sys_ioctl in fs/ioctl.c) are serialized with
> {lock,unlock}_kernel().
>
> I realize that many kernel modules, and POSIX for that
> matter, may not be ready to make this more concurrent.
>
> I propose adding a flag to indicate that the underlying
> module would like to support its own concurrency
> management, and thus we avoid grabbing the BKL around the
> f_op->ioctl call.
>
> The default behavior would adhere to existing standards,
> and if the flag is present (in the underlying module), we
> let the module (or modules) handle it.
>
> Reasonable?
No. Flags on drivers are never a good idea. What's more, if somebody
wants that shit parallelized they can always drop BKL upon entry and
reacquire on exit from their ->ioctl().
^ permalink raw reply [flat|nested] 4+ messages in thread
* Unserializing ioctl() system calls
@ 2004-05-22 2:46 Spinka, Kristofer
2004-05-22 2:54 ` viro
0 siblings, 1 reply; 4+ messages in thread
From: Spinka, Kristofer @ 2004-05-22 2:46 UTC (permalink / raw)
To: linux-kernel
I noticed that even in the 2.6.6 code, callers to ioctl
system call (sys_ioctl in fs/ioctl.c) are serialized with
{lock,unlock}_kernel().
I realize that many kernel modules, and POSIX for that
matter, may not be ready to make this more concurrent.
I propose adding a flag to indicate that the underlying
module would like to support its own concurrency
management, and thus we avoid grabbing the BKL around the
f_op->ioctl call.
The default behavior would adhere to existing standards,
and if the flag is present (in the underlying module), we
let the module (or modules) handle it.
Reasonable?
/kristofer
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-05-22 8:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1YuKj-2FZ-9@gated-at.bofh.it>
2004-05-22 8:03 ` Unserializing ioctl() system calls Andi Kleen
2004-05-22 2:46 Spinka, Kristofer
2004-05-22 2:54 ` viro
2004-05-22 3:35 ` Spinka, Kristofer
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).