Skip to contentSkip to conversation

ida: document IDA_BITMAP_LONGS calculation

PATCH Superseded Namhyung Kim 3 participants 4 messages Sep 3, 2010 – Sep 23, 2010 Xarray

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ida: document IDA_BITMAP_LONGS calculation

IDA_BITMAP_LONGS value is calculated take into account struct ida_bitmap not to waste memory space. Comment it.

---
 include/linux/idr.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
include/linux/idr.h +4 -1
index e968db7..3f4b718 100644
@@ -117,10 +117,13 @@ 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 accommodate
+ * 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_BITS		(IDA_BITMAP_LONGS * sizeof(long) * 8)
+#define IDA_BITMAP_BITS 	(IDA_BITMAP_LONGS * sizeof(long) * 8)
 
 struct ida_bitmap {
 	long			nr_busy;
Signature · 1 line
1.7.2.2
#1 lore raw
Quoted 18 lines · Namhyung Kim

IDA_BITMAP_LONGS value is calculated take into account struct ida_bitmap not to waste memory space. Comment it.

---
 include/linux/idr.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
include/linux/idr.h +1 -0
index e968db7..3f4b718 100644
@@ -117,10 +117,13 @@ void idr_init(struct idr *idp);
 /*
  * IDA - IDR based id allocator, use when translation from id to
  * pointer isn't necessary.
+ *

include/linux/idr.h void idr_init(struct idr *idp); · line 129

Quoted 10 lines
include/linux/idr.h +3 -1
+ * IDA_BITMAP_LONGS is calculated to be one less to accommodate
+ * 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_BITS		(IDA_BITMAP_LONGS * sizeof(long) * 8)
+#define IDA_BITMAP_BITS 	(IDA_BITMAP_LONGS * sizeof(long) * 8)
 
 struct ida_bitmap {
 	long			nr_busy;

Tejun, any word on this patch? Doesn't seem to be present in linux-next.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#2 lore raw
Quoted 28 lines · Jiri Kosina
Quoted 26 lines · Namhyung Kim

IDA_BITMAP_LONGS value is calculated take into account struct ida_bitmap not to waste memory space. Comment it.

---
 include/linux/idr.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
include/linux/idr.h +4 -1
index e968db7..3f4b718 100644
@@ -117,10 +117,13 @@ 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 accommodate
+ * 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_BITS		(IDA_BITMAP_LONGS * sizeof(long) * 8)
+#define IDA_BITMAP_BITS 	(IDA_BITMAP_LONGS * sizeof(long) * 8)
 
Quoted 4 lines

include/linux/idr.h void idr_init(struct idr *idp); · line 129

Quoted 2 lines
include/linux/idr.h +0 -0
 struct ida_bitmap {
 	long			nr_busy;

Tejun, any word on this patch? Doesn't seem to be present in linux-next.

Ooh, I was hoping this one could go through the trivial tree. It would be great if you can pick up the patch.

Thank you.

Signature · 1 line
tejun
#3 lore raw
Quoted 23 lines · Tejun Heo
Quoted 23 lines
Quoted 23 lines
---
 include/linux/idr.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
include/linux/idr.h +4 -1
index e968db7..3f4b718 100644
@@ -117,10 +117,13 @@ 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 accommodate
+ * 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_BITS		(IDA_BITMAP_LONGS * sizeof(long) * 8)
+#define IDA_BITMAP_BITS 	(IDA_BITMAP_LONGS * sizeof(long) * 8)
 
Quoted 7 lines
Quoted 4 lines

include/linux/idr.h void idr_init(struct idr *idp); · line 129

Quoted 2 lines
include/linux/idr.h +0 -0
 struct ida_bitmap {
 	long			nr_busy;

Tejun, any word on this patch? Doesn't seem to be present in linux-next.

Ooh, I was hoping this one could go through the trivial tree. It would be great if you can pick up the patch.

Bah, I missed your Acked-by, sorry for the noise. Applied now, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.