Re: [RFC,PATCH] use rcu for fasync_lock

Manfred Spraul
2003-12-21T21:55:14Z

Linus Torvalds wrote:

>Here's a big clue: if you make code worse than it is today, it won't be
>accepted. I don't even see why you'd bother in the first place.
>
>
fasync_helper != kill_fasync
fasync_helper is rare, and usually running under lock_kernel().
kill_fasync is far more common (every pipe_read and _write), I want to
remove the unconditional read_lock(&global_lock).

>So go back to the drawing board, and just do it _right_. Or don't do it at
>all. There's no point to making the code look and behave worse than it
>does today.
>
Today's solution is two copies of fasync_helper: one with lock_sock in
net/socket.c, one with write_lock_irq(&fasync_lock) in fs/fcntl.c.

Perhaps just a "if (*fp == NULL) return;" before grabbing the read_lock
in kill_fasync, without touching fasync_helper - that would be
sufficient to fix pipe_read and _write.

--
Manfred