netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: netdev@vger.kernel.org, dborkman@redhat.com,
	eric.dumazet@gmail.com, linux-kernel@vger.kernel.org,
	darkjames-ws@darkjames.pl
Subject: Re: [PATCH RFC] reciprocal_divide: correction/update of the algorithm
Date: Tue, 14 Jan 2014 10:02:19 -0800	[thread overview]
Message-ID: <52D57BAB.5070709@infradead.org> (raw)
In-Reply-To: <20140113214249.GK6586@order.stressinduktion.org>

On 01/13/2014 01:42 PM, Hannes Frederic Sowa wrote:
> 
> I propose an correction/update of the algorithm
> based on the paper "T. Granlund and P. L. Montgomery:
> Division by Invariant Integers Using Multiplication"
> <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.1.2556>
> 
> The assembler implementation from Agner Fog, found here
> <http://www.agner.org/optimize/asmlib.zip>, helped a lot while
> implementing.
> 
> I would like to have feedback if people see problems with this patch or
> have concerns about performance. I did some testing on x86-64 and found
> no problems so far but did no performance evaluation, yet.
> 
> The current code does break the call-sides of reciprocal_divide. The necessary
> changes will be part of the full series, then.
> 
> Thanks!
> ---
>  include/linux/reciprocal_div.h | 12 +++++++++---
>  lib/reciprocal_div.c           | 22 ++++++++++++++++++----
>  2 files changed, 27 insertions(+), 7 deletions(-)

Just trivia (coding style and spelling):

> diff --git a/lib/reciprocal_div.c b/lib/reciprocal_div.c
> index 75510e9..b741b30 100644
> --- a/lib/reciprocal_div.c
> +++ b/lib/reciprocal_div.c
> @@ -1,11 +1,25 @@
> +#include <linux/kernel.h>
>  #include <asm/div64.h>
>  #include <linux/reciprocal_div.h>
>  #include <linux/export.h>
>  
> -u32 reciprocal_value(u32 k)
> +/* For a description of the algorithmus please look at

                               algorithms

> + * linux/reciprocal_div.h
> + */

and kernel coding style for multi-line comments is like so:

/*
 * For a description of the algorithms, please look at
 * linux/reciprocal_div.h
 */

> +
> +struct reciprocal_value reciprocal_value(u32 d)
>  {



-- 
~Randy

  reply	other threads:[~2014-01-14 18:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 21:42 [PATCH RFC] reciprocal_divide: correction/update of the algorithm Hannes Frederic Sowa
2014-01-14 18:02 ` Randy Dunlap [this message]
2014-01-15 15:02   ` Hannes Frederic Sowa
2014-01-14 18:07 ` Eric Dumazet
2014-01-14 19:22   ` Austin S Hemmelgarn
2014-01-14 19:50     ` Eric Dumazet
2014-01-14 20:10       ` Hannes Frederic Sowa
2014-01-14 20:53       ` Austin S Hemmelgarn
2014-01-14 22:45         ` Eric Dumazet
2014-01-14 23:25           ` Borislav Petkov
2014-01-15  2:51             ` Austin S. Hemmelgarn
2014-01-14 22:39   ` Hannes Frederic Sowa
2014-01-15  7:02 ` [PATCH net] bpf: do not use reciprocal divide Eric Dumazet
2014-01-15  7:28   ` David Miller
2014-01-15  7:39     ` Eric Dumazet
2014-01-15  8:00   ` Heiko Carstens
2014-01-15  8:13     ` Martin Schwidefsky
2014-01-15 10:51       ` Heiko Carstens
2014-01-15 14:21         ` Eric Dumazet
2014-01-15 14:25           ` Eric Dumazet
2014-01-15 14:50             ` [PATCH v2 " Eric Dumazet
2014-01-15 15:10               ` Matt Evans
2014-01-15 16:09                 ` Eric Dumazet
2014-01-16  1:02               ` David Miller
2014-01-17  8:59                 ` Heiko Carstens
2014-01-18  2:56                   ` David Miller
2014-01-18 10:12                     ` Heiko Carstens
2014-01-15 15:35             ` [PATCH " Martin Schwidefsky
2014-01-15 15:26           ` Martin Schwidefsky
2014-01-15 16:07             ` Eric Dumazet
2014-01-15 14:16     ` Eric Dumazet
2014-01-15 15:10       ` Heiko Carstens

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=52D57BAB.5070709@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=darkjames-ws@darkjames.pl \
    --cc=dborkman@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).