Thread (11 messages) 11 messages, 3 authors, 2021-02-08

Re: releasing result pages in svc_xprt_release()

From: NeilBrown <hidden>
Date: 2021-01-29 22:44:35

On Fri, Jan 29 2021, Chuck Lever wrote:
Hi Neil-

I'd like to reduce the amount of page allocation that NFSD does,
and was wondering about the release and reset of pages in
svc_xprt_release(). This logic was added when the socket transport
was converted to use kernel_sendpage() back in 2002. Do you
remember why releasing the result pages is necessary?
Hi Chuck,
 as I recall, kernel_sendpage() (or sock->ops->sendpage() as it was
 then) takes a reference to the page and will hold that reference until
 the content has been sent and ACKed.  nfsd has no way to know when the
 ACK comes, so cannot know when the page can be re-used, so it must
 release the page and allocate a new one.

 This is the price we pay for zero-copy, and I acknowledge that it is a
 real price.  I wouldn't be surprised if the trade-offs between
 zero-copy and single-copy change over time, and between different
 hardware.

NeilBrown

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help