Re: tcp_sendmsg atomicity?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

> Andi Kleen writes:
>  > It violates the definition of write() though if the TCP socket is
>  > accessed via write(2), because writes are guaranteed to be atomic.
>  > The later could be fixed by aquiring the inode semaphore in
>  > sock_write, but I'm not sure if it is worth the cycles.

BTW write() does not use inode semaphore in 2.4 for sockets,
so that write() has no differences.

Actually, behaviour of 2.2 is even bug: atomic write() (and uninterruptible(!)
semaphore used in 2.2) is a non-sense for descriptors which can block
for infinite time. On such descriptors atomicity is defined as minimal amount
of data written atomically (SO_SNDLOWAT, though even this is not defined
by a standard). Our atomicity threshold for TCP (and default in OSes
implementing variable threshold) is 1 byte.

Alexey
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux