Re: [PATCH 2/2] net: Update alloc frag to reduce get/put page usage and recycle pages
On 7/11/2012 5:29 PM, Eric Dumazet wrote:
The gain will be minimal if any with the 1500 byte allocations, however there shouldn't be a performance degradation.On Wed, 2012-07-11 at 17:18 -0700, Alexander Duyck wrote:This patch does several things. First it reorders the netdev_alloc_frag code so that only one conditional check is needed in most cases instead of 2. Second it incorporates the atomic_set and atomic_sub_return logic from an earlier proposed patch by Eric Dumazet allowing for a reduction in the get_page/put_page overhead when dealing with frags. Finally it also incorporates the page reuse code so that if the page count is dropped to 0 we can just reinitialize the page and reuse it. Cc: Eric Dumazet<edumazet@xxxxxxxxxx> Signed-off-by: Alexander Duyck<alexander.h.duyck@xxxxxxxxx> ---Hmm, I was working on a version using order-3 pages if available. (or more exactly 32768 bytes chunks) I am not sure how your version can help with typical 1500 allocations (2 skbs per page)
I was thinking more of the ixgbe case where we are working with only 256 byte allocations and can recycle pages in the case of GRO or TCP. For ixgbe the advantages are significant since we drop a number of the get_page calls and get the advantage of the page recycling. So for example with GRO enabled we should only have to allocate 1 page for headers every 16 buffers, and the 6 slots we use in that page have a good likelihood of being warm in the cache since we just keep looping on the same page.
Thanks, Alex -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Kernel Discussion] [Ethernet Bridging] [Linux Wireless Networking] [Linux Bluetooth Networking] [Linux Networking Users] [VLAN] [Git] [IETF Annouce] [Linux Assembly] [Security] [Bugtraq] [Photo] [Singles Social Networking] [Yosemite Information] [MIPS Linux] [ARM Linux Kernel] [ARM Linux] [Linux Virtualization] [Linux Security] [Linux IDE] [Linux RAID] [Linux SCSI] [Free Dating]