Re: RFC: BSD system call revoke?

Alexander Viro (viro@math.psu.edu)
Fri, 25 Jun 1999 01:10:25 -0400 (EDT)


On Fri, 25 Jun 1999, Bernhard Kaindl wrote:

> for (filp = inuse_filps; filp; filp = filp->f_next)
^^^^^^^^^^^^^^^^
He's dead, Jim. Common inuse_filps sucks boulders through the straw - it
makes open("/dev/tty",O_RDWR); O(number of opened files) long. It's
horribly bad. It becomes untolerable on SMP - you can't do anything with
the list (i.e. add/remove struct file) while you are scanning the bloody
thing. Proposed scheme (see the posted patch) being: per-fs list +
anything that driver might want + anonymous list for pipes and sockets. In
other words, correct code would open the file, grab the file->f_list->fl_lock
and scan file->f_list->fl_list (with the lock being held). Then release
the spinlock.
Please, look at the patch at ftp.math.psu.edu/pub/viro/smp-patch-11.gz.
It's not a final version by any means, but it's pretty much final wrt
struct file handling. Whether Linux will accept is another question,
indeed, but *any* scanning of the global list will bite us hard wrt big
lock lifting.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/