Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: "Toke Høiland-Jørgensen" <toke@toke.dk>,
	"Jamal Hadi Salim" <jhs@mojatatu.com>,
	"Cong Wang" <xiyou.wangcong@gmail.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"Dave Taht" <dave.taht@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	cake@lists.bufferbloat.net, netdev@vger.kernel.org
Subject: Re: [Cake] [PATCH net-next] sch_cake: constify inverse square root cache
Date: Fri, 6 Sep 2024 18:14:15 -0700	[thread overview]
Message-ID: <20240906181415.11d34150@kernel.org> (raw)
In-Reply-To: <20240904100516.16926-1-toke@redhat.com>

On Wed,  4 Sep 2024 12:05:16 +0200 Toke Høiland-Jørgensen wrote:
> +/* There is a big difference in timing between the accurate values placed in the
> + * cache and the approximations given by a single Newton step for small count
> + * values, particularly when stepping from count 1 to 2 or vice versa. Hence,
> + * these values are calculated using eight Newton steps, using the implementation
> + * below. Above 16, a single Newton step gives sufficient accuracy in either
> + * direction, given the precision stored.

Please line wrap the comments at 80 chars.

> + * The magnitude of the error when stepping up to count 2 is such as to give
> + * the value that *should* have been produced at count 4.
> + */
> +
>  #define REC_INV_SQRT_CACHE (16)
> -static u32 cobalt_rec_inv_sqrt_cache[REC_INV_SQRT_CACHE] = {0};
> +static const u32 inv_sqrt_cache[REC_INV_SQRT_CACHE] = {
> +	        ~0,         ~0, 3037000500, 2479700525,
> +	2147483647, 1920767767, 1753413056, 1623345051,
> +	1518500250, 1431655765, 1358187914, 1294981364,
> +	1239850263, 1191209601, 1147878294, 1108955788

checkpatch asks to use tabs to indent the ~0, which seems fair
-- 
pw-bot: cr

      parent reply	other threads:[~2024-09-07  1:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 10:05 Toke Høiland-Jørgensen
2024-09-04 15:52 ` Dave Taht
2024-09-07  1:14 ` Jakub Kicinski [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

  List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/

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

  git send-email \
    --in-reply-to=20240906181415.11d34150@kernel.org \
    --to=kuba@kernel.org \
    --cc=cake@lists.bufferbloat.net \
    --cc=dave.taht@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=toke@redhat.com \
    --cc=toke@toke.dk \
    --cc=xiyou.wangcong@gmail.com \
    /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