All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Schmielau <tim@physik3.uni-rostock.de>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] udivdi3: 64 bit divide
Date: Thu, 1 Mar 2007 02:29:19 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.63.0703010220210.21277@gockel.physik3.uni-rostock.de> (raw)
In-Reply-To: <20070227122437.da27c3cd.akpm@linux-foundation.org>

On Tue, 27 Feb 2007, Andrew Morton wrote:
> > On Mon, 26 Feb 2007 17:35:17 -0800 Stephen Hemminger <shemminger@linux-foundation.org> wrote:
> > The kernel already has several implmentations and usages of 64 by 64 
> > bit divide.
> > 
> > Although it is significantly slower, there are places that need it so
> > provide one generic version using scaling, and allow existing platform
> > versions to continue.
> 
> The reason we implement 64/32 via do_div() is, for better or for worse, to
> make people think before they use it.  And to make it stand out, and so
> that we discover places that are using it by accident, where they could use
> something cheaper.

IMHO it is even more important that the user of your 64/64 div is aware 
that it only returns an approximate result.

I certainly don't want to have any code in the kernel that by accident 
makes an allocation a few bytes short of the actual size of the object 
(just to make up a drastic example).

Tim

      parent reply	other threads:[~2007-03-01  1:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27  1:35 [PATCH] udivdi3: 64 bit divide Stephen Hemminger
2007-02-27 20:24 ` Andrew Morton
2007-02-27 21:18   ` Stephen Hemminger
2007-02-27 21:36     ` Andrew Morton
2007-02-27 22:24       ` Russell King
2007-02-27 22:39         ` Ian Molton
2007-02-28 22:30           ` Jan Engelhardt
2007-03-01 17:02             ` Ian Molton
2007-03-01  1:29   ` Tim Schmielau [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=Pine.LNX.4.63.0703010220210.21277@gockel.physik3.uni-rostock.de \
    --to=tim@physik3.uni-rostock.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.