From: Subranshu P. - E. H. T. <Sub...@hc...> - 2012-02-27 15:42:46
|
> Because sendpage() invokes get_page() before returning and put_page() after sending finished. 1. Suppose if we use sendpage (instead of sock_no_sendpage) and don't use the patch while user space handler, there is chance that buffer will be resused/freed. Why is it so? Sendpage() works properly for kernel handlers, but not user space handler? From: bar...@gm... [mailto:bar...@gm...] On Behalf Of Bart Van Assche Sent: Monday, February 27, 2012 5:25 PM To: Subranshu Patel - ERS, HCL Tech Cc: Vlad; scs...@li... Subject: Re: [Scst-devel] scst_user handler On Mon, Feb 27, 2012 at 8:17 AM, Subranshu Patel - ERS, HCL Tech <Sub...@hc...<mailto:Sub...@hc...>> wrote: Suppose I am not using the put_page_callback patch. In case of kernel device handler, sock->ops->sendpage is invoked (zero copy); in case of userspace handler (scst_user) sock_no_sendpage is invoked. sock_no_sendpage invokes kernel_sendmsg which means an additional copy of data. 1. What is the reason that if we use kernel device handler, the buffer is not freed or reused until sendpage completes sending data? Because sendpage() invokes get_page() before returning and put_page() after sending finished. Bart. ________________________________ ::DISCLAIMER:: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- |