Re: [PATCH RFC v2 00/12] socket sendmsg MSG_ZEROCOPY
From: David Miller <davem@davemloft.net>
Date: 2017-03-01 03:25:57
Also in:
linux-api
From: David Miller <davem@davemloft.net>
Date: 2017-03-01 03:25:57
Also in:
linux-api
From: Andy Lutomirski <luto@amacapital.net> Date: Tue, 28 Feb 2017 11:46:23 -0800
On Mon, Feb 27, 2017 at 10:57 AM, Michael Kerrisk [off-list ref] wrote:quoted
[CC += linux-api@vger.kernel.org] Hi Willemquoted
quoted
On a send call with MSG_ZEROCOPY, the kernel pins the user pages and creates skbuff fragments directly from these pages. On tx completion, it notifies the socket owner that it is safe to modify memory by queuing a completion notification onto the socket error queue.What happens if the user writes to the pages while it's not safe?
Just want to mention that this ability to write to data behind a network send's back is not a new thing added by MSG_ZEROCOPY. All of this is already possible with sendfile(). The pages can be written to completely asynchronously to the data being pulled out of the page cache into the transmit path. The crypto case is interesting, but that is a seperate discussion about an existing problem rather than something specifically new to the MSG_ZEROCOPY changes. Thanks.