RE: [PATCH 2.6.27.7-9-pae #7 SMP 1/1] networking tcp: Writing tcp socket be atomic

From: John Ye
Date: Wed Feb 03 2010 - 21:03:54 EST


David,

Thanks.
The option TCP_ATOMIC is not a must.
We can make atomic be default if the data size is less than a fixed size, just the same as pipe.
For example, if the data size is less than 512, we don't split the data so it goes atomically.

John Ye


-----Original Message-----
From: David Miller [mailto:davem@xxxxxxxxxxxxx]
Sent: 2010年2月4日 0:53
To: John Ye
Cc: kuznet@xxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; jmorris@xxxxxxxxx; kaber@xxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH 2.6.27.7-9-pae #7 SMP 1/1] networking tcp: Writing tcp socket be atomic


Locking belongs inside of the application, not in the kernel.

As evidenced by the fact that you had to add new socket options, the
application needs to be modified anyways.

It's therefore just as easy to add the appropriate locking to the
sequences where the application writes over the TCP socket. And
it avoids having to modify the kernel at all.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/