Re: [SOCK] Avoid integer divides where not necessary in include/net/sock.h

2007-12-21 Thread Herbert Xu
David Miller <[EMAIL PROTECTED]> wrote: > > When I was playing with this crap a long time ago I > think I remember that sk->sk_forward_alloc can become > negative in some circumstances. > > Or maybe that was just a bug :-) Yeah we had a few bugs there in the early days of TSO but it's been quiet

Re: [SOCK] Avoid integer divides where not necessary in include/net/sock.h

2007-12-21 Thread David Miller
uture bisection anyway... > > [SOCK] Avoid integer divides where not necessary in include/net/sock.h > > Because sk_wmem_queued, sk_sndbuf are signed, a divide per two > may force compiler to use an integer divide. > > We can instead use a right shift. > > Signed-off-by:

Re: [SOCK] Avoid integer divides where not necessary in include/net/sock.h

2007-12-21 Thread Eric Dumazet
e patch handling the change on sk_wmem_queued, sk_sndbuf. Keeping small patches may help future bisection anyway... [SOCK] Avoid integer divides where not necessary in include/net/sock.h Because sk_wmem_queued, sk_sndbuf are signed, a divide per two may force compiler to use an integer divide. We ca

Re: [SOCK] Avoid integer divides where not necessary in include/net/sock.h

2007-12-21 Thread David Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Fri, 21 Dec 2007 07:18:40 +0100 > Because sk_wmem_queued, sk_sndbuf are signed, a divide per two > forces compiler to use an integer divide. We can instead use > a right shift. > > SK_STREAM_MEM_QUANTUM deserves to be declared as an unsigned > quantity

[SOCK] Avoid integer divides where not necessary in include/net/sock.h

2007-12-20 Thread Eric Dumazet
Because sk_wmem_queued, sk_sndbuf are signed, a divide per two forces compiler to use an integer divide. We can instead use a right shift. SK_STREAM_MEM_QUANTUM deserves to be declared as an unsigned quantity, so that sk_stream_pages() and __sk_stream_mem_reclaim() can use right shifts instead of