[lkml]   [2001]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC] tree-based bootmem
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, 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 =).

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.045 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site