Skip to contentSkip to conversation

Unserializing ioctl() system calls

DISCUSSION Spinka, Kristofer 2 participants 3 messages May 22, 2004

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 12 lines · Kristofer

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.

Quoted 5 lines

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().

#2 lore raw

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: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Friday, May 21, 2004 7:54 PM
To: Spinka, Kristofer
Cc: [email protected]
Subject: Re: Unserializing ioctl() system calls

Quoted 12 lines · Kristofer

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.

Quoted 5 lines

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().