Thread (2 messages) 2 messages, 2 authors, 2007-12-25

Re: [SOCK] Avoid divides in sk_stream_pages() and __sk_stream_mem_reclaim()

From: David Miller <davem@davemloft.net>
Date: 2007-12-25 04:58:10

From: Eric Dumazet <redacted>
Date: Fri, 21 Dec 2007 15:45:08 +0100
[SOCK] Avoid divides in sk_stream_pages() and __sk_stream_mem_reclaim()

sk_forward_alloc being signed, we should take care of divides by
SK_STREAM_MEM_QUANTUM we do in sk_stream_pages() and 
__sk_stream_mem_reclaim()

This patchs introduces SK_STREAM_MEM_QUANTUM_SHIFT, defined
as ilog2(SK_STREAM_MEM_QUANTUM), to be able to use right
shifts instead of plain divides.

This should help compiler to choose right shifts instead of
expensive divides (as seen with CONFIG_CC_OPTIMIZE_FOR_SIZE=y on x86)

Signed-off-by: Eric Dumazet <redacted>
Applied, thanks Eric.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help