Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dada1@cosmosbay.com
Cc: netdev@vger.kernel.org
Subject: Re: [SOCK] Avoid divides in sk_stream_pages() and __sk_stream_mem_reclaim()
Date: Mon, 24 Dec 2007 20:58:09 -0800 (PST)	[thread overview]
Message-ID: <20071224.205809.56016548.davem@davemloft.net> (raw)
In-Reply-To: <20071221154508.97aef5d9.dada1@cosmosbay.com>

From: Eric Dumazet <dada1@cosmosbay.com>
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 <dada1@cosmosbay.com>

Applied, thanks Eric.

      reply	other threads:[~2007-12-25  4:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21 14:45 [SOCK] Avoid divides in sk_stream_pages() and __sk_stream_mem_reclaim() Eric Dumazet
2007-12-25  4:58 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071224.205809.56016548.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dada1@cosmosbay.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox