Re: wait-queues vs socket-locking

kuznet@ms2.inr.ac.ru
Sat, 14 Aug 1999 19:05:11 +0400 (MSK DST)


Hello!

> tasks from the sk->sleep waitqueue. But wait_for_tcp_memory
> (/net/ipv4/tcp.c line 707) explicitly doesn't.

sk->sleep cannot change while you are inside wait_for_tcp_memory,
so that it is not essential.

> Is it required to "lock the sock" before modifing the sk->sleep waitqueue,
> or is it safe not to have the sock locked?

It is not safe to modify it at all. Particularly, in your case
locking socket is non-sense, because socket is accessed only
by your process and irq events are not serialized wrt. socket lock
in any case. So that, the lock does not make any useful work.

But you are right in large. Probably the crashes, which you observe
are really related to missing sk->sleep locking.
Try ftp://ftp.inr.ac.ru/ip-routing/smp-<whatever> (with corresponding modifications
to your code) to check this.

Alexey Kuznetsov

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