public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: linux@horizon.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] tree-based bootmem
Date: Sat, 17 Nov 2001 17:24:37 -0800	[thread overview]
Message-ID: <20011117172437.B11913@holomorphy.com> (raw)
In-Reply-To: <20011118005819.3762.qmail@science.horizon.com>
In-Reply-To: <20011118005819.3762.qmail@science.horizon.com>; from linux@horizon.com on Sun, Nov 18, 2001 at 12:58:19AM -0000

In my bootmem patch, I wrote:
>> #define DIV_DN(x,n) (RND_DN(x,n) / (n))
>> #define DIV_UP(x,n) (RND_UP(x,n) / (n))

On Sun, Nov 18, 2001 at 12:58:19AM -0000, linux@horizon.com wrote:
> Eww.  I realize it's not performance-critical, but how about
> the simpler
> #define DIV_DN(x,n) ((x) / (n))
> #define DIV_UP(x,n) DIV_DN((x)+(n)-1, n)
> 
> There are some alternate definitions of RND_UP available, as well:
> #define RND_UP(x,n) (-RND_DN(-(x),n))
> or
> #define RND_UP(x,n) (~(~(x) | (n)-1))

I hope you don't mind my Cc:'ing lkml in my reply.

These are both excellent points. In the interest of economy of CPU, I
will follow your suggestions in the next installment (and list you in
the changelog =).


Thanks,
Bill

       reply	other threads:[~2001-11-18  1:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20011118005819.3762.qmail@science.horizon.com>
2001-11-18  1:24 ` William Lee Irwin III [this message]
2001-11-17  9:14 [RFC] tree-based bootmem William Lee Irwin III
     [not found] ` <20011118001657.A467@ucw.cz>
2001-11-18  0:01   ` William Lee Irwin III
2001-11-19  8:08     ` Robert Love
2001-11-26 21:02       ` Martin Mares
2001-11-21 16:20 ` William Lee Irwin III
2001-11-23  9:30 ` William Lee Irwin III
2001-11-28  9:04 ` Chris Wright
2001-11-28 12:40   ` William Lee Irwin III
2001-11-29  0:33     ` Chris Wright
2001-11-29  1:23   ` William Lee Irwin III
2001-11-30  2:29     ` Robert Love
2001-12-02  6:59       ` William Lee Irwin III
2001-12-02  7:08         ` Anton Blanchard

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=20011117172437.B11913@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.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