Skip to contentSkip to conversation

ida-in-place-ida-allocation.patch removed from -mm tree

nacked [email protected] 1 participant 1 message Apr 22, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [nacked] ida-in-place-ida-allocation.patch removed from -mm tree
To: [email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 22 Apr 2014 13:06:52 -0700

The patch titled
Subject: ida: in-place ida allocation
has been removed from the -mm tree. Its filename was
ida-in-place-ida-allocation.patch

This patch was dropped because it was nacked

------------------------------------------------------
From: Lai Jiangshan <[email protected]>
Subject: ida: in-place ida allocation

There are two stages of ida allocation/free, idr_layers and ida_bitmap. They add unneeded foot print and memory waste.

When a single ID is first allocated from an ida, this ida requires two big chunks of memory. One idr_layer and one ida_bitmap.

To reduce the footprint and memory, we reduce the ida_bitmap to a single "unsigned long" and place it in its own idr-slot and avoid allocating the ida_bitmap.

It also means ida bitmap is located on its corresponding idr-slot which has the same size as "unsigned long". Each ida bitmap(idr-slot) contains BITS_PER_LONG ida-slots.

The struct ida_bitmap is not needed any more, we use "unsigned long" directly and remove all the code of alloc/free struct ida_bitmap.

---

 include/linux/idr.h |   15 -------
 lib/idr.c           |   85 ++++++++++--------------------------------
 2 files changed, 23 insertions(+), 77 deletions(-)
include/linux/idr.h renamed from include/linux/idr.h~ida-in-place-ida-allocation +1 -14
diff -puN include/linux/idr.h~ida-in-place-ida-allocation include/linux/idr.h
@@ -135,25 +135,12 @@ static inline void *idr_find(struct idr
 /*
  * 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	(IDA_CHUNK_SIZE / sizeof(long) - 1)
-#define IDA_BITMAP_BITS 	(IDA_BITMAP_LONGS * sizeof(long) * 8)
-
-struct ida_bitmap {
-	long			nr_busy;
-	unsigned long		bitmap[IDA_BITMAP_LONGS];
-};
-
 struct ida {
 	struct idr		idr;
-	struct ida_bitmap	*free_bitmap;
 };
 
-#define IDA_INIT(name)		{ .idr = IDR_INIT((name).idr), .free_bitmap = NULL, }
+#define IDA_INIT(name)		{ .idr = IDR_INIT((name).idr), }
 #define DEFINE_IDA(name)	struct ida name = IDA_INIT(name)
 
 int ida_pre_get(struct ida *ida, gfp_t gfp_mask);
lib/idr.c renamed from lib/idr.c~ida-in-place-ida-allocation +22 -63

158 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

mem-hotplug-implement-get-put_online_mems.patch slab-get_online_mems-for-kmem_cache_createdestroyshrink.patch idr-fix-overflow-bug-during-maximum-id-calculation-at-maximum-height.patch idr-fix-unexpected-id-removal-when-idr_removeunallocated_id.patch idr-fix-null-pointer-dereference-when-ida_removeunallocated_id.patch idr-fix-idr_replaces-returned-error-code.patch idr-dont-need-to-shink-the-free-list-when-idr_remove.patch idr-reduce-the-unneeded-check-in-free_layer.patch idr-reorder-the-fields.patch
linux-next.patch