problem in do_tcp_sendpages

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

 



Hi all,
I am currently using a sendpage interface in linux kernel
2.6.14.Earlier i was using sendmsg interface but switched to sendpage
to avoid data copying.
On using sendpage, i have encountered a problem of memory leak due to
page count not getting decremented.

On looking at the linux source code for kernel 2.6.14 i found out that
in the following code a call is being made to "get_page" which
increments the page reference count, but there is no corresponding
"put_page" or other function which decrement the page count.

558  if (can_coalesce)
559      skb_shinfo(skb)->frags[i-1].size += copy;
560  } else {
561       get_page(page);
562       skb_fill_page_desc(skb, i, page, offset, copy);
563  }

Because of this "get_page" call, page count is getting incremented and
since visibly there is no call for decrementing the page count, pages
are not getting freed. This is resulting in a memory leak. I have
checked out that this code is actually getting executed in my case.
Please let me know if this is a kernel bug or I am missing something.

Thanks
kSanjay
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux