ida: document IDA_BITMAP_LONGS calculation
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
@@ -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
Quoted 18 lines · Namhyung Kim
IDA_BITMAP_LONGSvalue is calculated take into account structida_bitmapnot to waste memory space. Comment it.Signed-off-by Namhyung Kim <[email protected]>Acked-by Tejun Heo <[email protected]>--- include/linux/idr.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)include/linux/idr.h +1
-0@@ -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.
Quoted 28 lines · Jiri Kosina
Quoted 26 lines · Namhyung Kim
IDA_BITMAP_LONGSvalue is calculated take into account structida_bitmapnot to waste memory space. Comment it.Signed-off-by Namhyung Kim <[email protected]>Acked-by Tejun Heo <[email protected]>--- include/linux/idr.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)include/linux/idr.h +4
-1@@ -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
-0struct 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
Quoted 23 lines · Tejun Heo
Quoted 23 lines
Quoted 23 lines
Signed-off-by Namhyung Kim <[email protected]>Acked-by Tejun Heo <[email protected]>--- include/linux/idr.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)include/linux/idr.h +4
-1@@ -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
-0struct 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.