lkml.org 
[lkml]   [1999]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Concurrency in TCP stack.
From
Date
thomas.kelly@queens.oxford.ac.uk (Tom Kelly) writes:

> Hi!
>
> I've been hacking my way around the 2.2.13 TCP stack and I'm a bit
> confused about how the concurrency issues with the shared data (tcp_opt)
> in the socket struct are dealt with. For example, what ensures that the
> congestion window decisions are atomic?
>
> Anyone got any pointers for documentation or a quick overview?

The socket lock (sock_readers) ensures this. From user context
the kernel lock guarantees single entry as long as you don't sleep,
when you sleep (e.g. in a user space access) the TCP code is careful
enough to recheck everything. As long as sock_readers is > 0 the
network bh context rcv_* functions will not be executed for new
arriving packets, they are queued in the backlog instead and processed
in the release_sock.

In 2.3 lock_sock also does the synchronization for user context that
the big kernel lock does in 2.2.

Hope this help,
-Andi

--
This is like TV. I don't like TV.

-
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:55    [W:0.026 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site