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

Jonathan Corbet
2009-01-28T21:05:39Z

On Wed, 28 Jan 2009 12:13:47 -0600
Matt Mackall <mpm@selenic.com> 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