lkml.org 
[lkml]   [1999]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: wait-queues vs socket-locking
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.038 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site