From 412ba71a358043dc2e7e0fae1808c92d7e8260f6 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Wed, 27 Feb 2013 17:05:06 -0800 Subject: [PATCH] --- yaml --- r: 359384 b: refs/heads/master c: 050a6b47d98e2bcea909c1129111e721668aaa2c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/idr.h | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 1d0857bbecb8..e8babd0ab4f2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1d9b2e1e663719d406e3a770979a19ba4233bba0 +refs/heads/master: 050a6b47d98e2bcea909c1129111e721668aaa2c diff --git a/trunk/include/linux/idr.h b/trunk/include/linux/idr.h index 63aa542da49b..43b87b1c77a3 100644 --- a/trunk/include/linux/idr.h +++ b/trunk/include/linux/idr.h @@ -17,14 +17,13 @@ #include #include -#if BITS_PER_LONG == 32 -# define IDR_BITS 5 -#elif BITS_PER_LONG == 64 -# define IDR_BITS 6 -#else -# error "BITS_PER_LONG is not 32 or 64" -#endif - +/* + * We want shallower trees and thus more bits covered at each layer. 8 + * bits gives us large enough first layer for most use cases and maximum + * tree depth of 4. Each idr_layer is slightly larger than 2k on 64bit and + * 1k on 32bit. + */ +#define IDR_BITS 8 #define IDR_SIZE (1 << IDR_BITS) #define IDR_MASK ((1 << IDR_BITS)-1)