public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Namhyung Kim <namhyung@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ida: fix up bitmap size calculation
Date: Fri, 03 Sep 2010 11:14:04 +0200	[thread overview]
Message-ID: <4C80BC5C.2010804@kernel.org> (raw)
In-Reply-To: <87vd6o9fzf.fsf@gmail.com>

On 09/02/2010 08:07 PM, Namhyung Kim wrote:
> Namhyung Kim <namhyung@gmail.com> writes:
>> Got it. :-) I'll prepare new patch with that comment, then.
>> Thank you for the explanation.
> 
> How about this?

I'd prefer something with a bit more brevity.  If this looks good, can
you please send it to trivial@kernel.org?

Thanks.

diff --git a/include/linux/idr.h b/include/linux/idr.h
index e968db7..1208528 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -117,9 +117,12 @@ void idr_init(struct idr *idp);
 /*
  * IDA - IDR based id allocator, use when translation from id to
  * pointer isn't necessary.
+ *
+ * IDA_BITMAP_LONGS is calculated to be one less to accomodate
+ * ida_bitmap->nr_busy so that the whole struct fits in 128 bytes.
  */
 #define IDA_CHUNK_SIZE		128	/* 128 bytes per chunk */
-#define IDA_BITMAP_LONGS	(128 / sizeof(long) - 1)
+#define IDA_BITMAP_LONGS	(IDA_CHUNK_SIZE / sizeof(long) - 1)
 #define IDA_BITMAP_BITS		(IDA_BITMAP_LONGS * sizeof(long) * 8)

 struct ida_bitmap {


-- 
tejun

  reply	other threads:[~2010-09-03  9:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-02 17:00 [PATCH] ida: fix up bitmap size calculation Namhyung Kim
2010-09-02 17:20 ` Tejun Heo
2010-09-02 17:25   ` Namhyung Kim
2010-09-02 18:07     ` Namhyung Kim
2010-09-03  9:14       ` Tejun Heo [this message]
2010-09-03  9:26         ` Namhyung Kim
2010-09-03  9:29           ` Tejun Heo

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=4C80BC5C.2010804@kernel.org \
    --to=tj@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.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