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
Attachment:
signature.asc
Description: PGP signature