On Mon, Mar 06, 2006 at 08:29:30PM -0300, Arnaldo Carvalho de Melo wrote:
> - clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
> + if (test_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags))
> + clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
>
> Something like fast_clear_bit() that does the above sequence in a inline
> function?
That might make sense. The general case tends to be better handled by
avoiding atomic bitops wherever possible. In the socket case, a better
approach may be to have a set of flags which are protected by the socket
lock instead of being atomic bitops.
> Something similar, no?
>
> fast_atomic_dec_and_test anyone? :-)
Yup. One of the other patches I've got which really helps networking is
to use that hack in the VM's put_page() function. The problem is that the
conditions under which it is okay tend to vary from case to case.
-ben
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html