Re: [PATCH, RFC] Remove fasync() BKL usage, take 3325

From: Jonathan Corbet
Date: Wed Jan 28 2009 - 16:05:39 EST


On Wed, 28 Jan 2009 12:13:47 -0600
Matt Mackall <mpm@xxxxxxxxxxx> wrote:

> Maybe we can just demote f_ep_lock to f_lock and share it?

We'd have to move it out of the CONFIG_EPOLL ifdef, but that could be
done. The bigger problem is that there is resistance to putting a lock
around accesses to f_flags. I've tried that before...

It also doesn't solve the FASYNC atomicity problem unless we decide to
call ->fasync() with the lock held, and that opens yet another can of
worms.

> Or extend flags and have two independent bitlocks in it. This actually
> shrinks struct_file for most users.

That has some potential. We'd only need one bitlock (for epoll).
Biggest problem might be preventing the regular file flags from
expanding into the lock bit, especially since those flags are defined
in a pile of architecture-dependent .h files. I'll look into it.

(That's somebody's cue to tell me why this approach is all wrong
too...:)

Thanks,

jon
--
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/