sendfile / struct page confustion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reposting with some more information.

I traced sendfile call. tcp_sendmsg calls skb_add_data which call copy_from user function to copy data which is sendfiled.

So Linux TCP stack does not care if struct page (which was initially given, is freed or not, since it has already copied the data.

I am writing my own implementation of sendfile, I and not copying data from struct page, I am giving this pointer to lower layer which puts it on the wire.

I want to make sure that these buffers stay as it until I get ack from remote end. In case I have to retransmit the data.

Questions:

1. In Linux implementation who frees these buffer (i.e. who reduce ref count to these buffers)
===================================================================
I was trying to study flow of sendfile. I understand that sendfile first allocate pages and than call block layer to fill these pages with file image. After that, protocol related sendpage function is called (if it exist). I am interested in TCP IPv4.

My understanding is that same page is passed to TCP layer, and from there data is put on the wire. Now for TCP, it will want to keep this pages until it get ack from remote end.

Kernel will not attempt to release these pages until ref count on these pages goes to zero.

Is all of above correct ? where is TCP code ref count is decremented ? can you give code pointer.

Thanks

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux