public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	akpm@osdl.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Silly bitmap size accounting fix
Date: Sun, 14 May 2006 00:38:56 +1000	[thread overview]
Message-ID: <4465EF80.6010106@yahoo.com.au> (raw)
In-Reply-To: <Pine.LNX.4.58.0605131010110.27003@gandalf.stny.rr.com>

Steven Rostedt wrote:
> On Sat, 13 May 2006, Nick Piggin wrote:
> 
> 
>>Ingo Molnar wrote:
>>
>>>* Steven Rostedt <rostedt@goodmis.org> wrote:
>>>
>>>
>>>
>>>>-#define BITMAP_SIZE ((((MAX_PRIO+1+7)/8)+sizeof(long)-1)/sizeof(long))
>>>>+#define BITMAP_SIZE ((((MAX_PRIO+7)/8)+sizeof(long)-1)/sizeof(long))
>>>
>>>
>>>Acked-by: Ingo Molnar <mingo@elte.hu>
>>
>>Really?! What about the delimiter bit set at MAX_PRIO?
> 
> 
> 
> 		// delimiter for bitsearch
> 		__set_bit(MAX_PRIO, array->bitmap);
> 
> 
> Ah! I see what you mean.  New patch (add a comment).

That would have caused someone a world of pain 3 years ahead ;)

> 
> -- Steve
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

OK I guess. Does it help to also spell out exactly what's going on there?

> 
> Index: linux-2.6.17-rc3-mm1/kernel/sched.c
> ===================================================================
> --- linux-2.6.17-rc3-mm1.orig/kernel/sched.c	2006-05-12 04:02:32.000000000 -0400
> +++ linux-2.6.17-rc3-mm1/kernel/sched.c	2006-05-13 10:09:15.000000000 -0400
> @@ -192,6 +192,10 @@ static inline unsigned int task_timeslic
>   * These are the runqueue data structures:
>   */
> 
> +/*
> + * Calculate BITMAP_SIZE.
> + *  The bitmask holds MAX_PRIO bits + 1 for the delimiter.

+ * Calculation is to find the minimum number of longs that holds MAX_PRIO+1 bits:
+ *  size-in-chars = ceiling((MAX_PRIO+1) / CHAR_BITS)
+ *  size-in-longs = ceiling(size-in-chars / sizeof(long))

> + */
>  #define BITMAP_SIZE ((((MAX_PRIO+1+7)/8)+sizeof(long)-1)/sizeof(long))
> 

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2006-05-13 14:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-12  8:31 [PATCH] Silly bitmap size accounting fix Steven Rostedt
2006-05-12  9:14 ` Ingo Molnar
2006-05-13  1:37   ` Nick Piggin
2006-05-13 14:12     ` Steven Rostedt
2006-05-13 14:38       ` Nick Piggin [this message]
2006-05-13 14:53         ` Steven Rostedt
2006-05-13 14:56           ` Nick Piggin
2006-05-13 15:36       ` Takashi Iwai
2006-05-13 15:45         ` Nick Piggin
2006-05-13 15:59           ` Steven Rostedt
2006-05-14  8:13             ` Ingo Molnar

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=4465EF80.6010106@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.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