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:56:18 +1000	[thread overview]
Message-ID: <4465F392.60102@yahoo.com.au> (raw)
In-Reply-To: <Pine.LNX.4.58.0605131051160.27751@gandalf.stny.rr.com>

Steven Rostedt wrote:
> 
>>>+/*
>>>+ * 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))
>>>
>>
> 
> What do you think of the following comment, better?

Cool, thanks.

> 
> -- Steve
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> 
> 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:50:44.000000000 -0400
> @@ -192,6 +192,13 @@ 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.
> + *  BITMAP_SIZE is the minimum number of longs that holds MAX_PRIO+1 bits:
> + *   size-in-bytes = ceiling((MAX_PRIO+1) / BITS_PER_BYTE)
> + *   size-in-longs = ceiling(size-in-bytes / sizeof(long))
> + */
>  #define BITMAP_SIZE ((((MAX_PRIO+1+7)/8)+sizeof(long)-1)/sizeof(long))
> 
>  typedef struct runqueue runqueue_t;
> 


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

  reply	other threads:[~2006-05-13 14:56 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
2006-05-13 14:53         ` Steven Rostedt
2006-05-13 14:56           ` Nick Piggin [this message]
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=4465F392.60102@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