Bernard Metzler <BMT@xxxxxxxxxxxxxx> wrote: > > /* > > - * 0copy TCP transmit interface: Use do_tcp_sendpages. > > + * 0copy TCP transmit interface: Use MSG_SPLICE_PAGES. > > * > > * Using sendpage to push page by page appears to be less efficient > > * than using sendmsg, even if data are copied. > > That is an interesting observation. Is efficiency to be read as > CPU load, or throughput on the wire, or both? Um. The observation in the comment is one you made, not me according to git blame. I merely changed "do_tcp_sendpages" to "MSG_SPLICE_PAGES" in the first line of the comment. > Back in the days, I introduced that zcopy path for efficiency > reasons - getting both better throughput and less CPU load. > I looked at both WRITE and READ performance. Using > do_tcp_sendpages() is currently limited to processing work > which is not registered with local completion generation. > Replying to a remote READ request is a typical case. Did > you check with READ? Ah - you're talking about ksmbd there? I haven't tested the patch with that. > > - rv = do_tcp_sendpages(sk, page[i], offset, bytes, flags); > > + rv = tcp_sendmsg_locked(sk, &msg, size); > > Would that tcp_sendmsg_locked() with a msg flagged > MSG_SPLICE_PAGES still have zero copy semantics? Yes - though I am considering making it conditional on whether the pages in the iterator belong to the slab allocator (in which case they get copied) or not. David