public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make radix_tree_preload alloc one more slot
@ 2009-08-27 12:10 Zhu Yanhai
  2009-08-27 12:21 ` Wu Fengguang
  0 siblings, 1 reply; 7+ messages in thread
From: Zhu Yanhai @ 2009-08-27 12:10 UTC (permalink / raw)
  To: Andrew Morton, Wu Fengguang, Jiri Kosina, Huang Shijie
  Cc: linux-kernel, Zhu Yanhai

The operations against radix tree always use paths with RADIX_TREE_MAX_PATH
+ 1 slots, but radix_tree_preload only pre-allocs RADIX_TREE_MAX_PATH
slots at present, which causes radix_tree_node_alloc tries to do
kmem_cache_alloc at the last slot even if we don't have gfp_mask &
__GFP_WAIT in hand.

Signed-off-by: Zhu Yanhai <zhu.yanhai@gmail.com>

---
 lib/radix-tree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 23abbd9..72225a8 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -79,7 +79,7 @@ static struct kmem_cache *radix_tree_node_cachep;
  */
 struct radix_tree_preload {
 	int nr;
-	struct radix_tree_node *nodes[RADIX_TREE_MAX_PATH];
+	struct radix_tree_node *nodes[RADIX_TREE_MAX_PATH + 1];
 };
 static DEFINE_PER_CPU(struct radix_tree_preload, radix_tree_preloads) = { 0, };
 
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-08-28  5:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-27 12:10 [PATCH] Make radix_tree_preload alloc one more slot Zhu Yanhai
2009-08-27 12:21 ` Wu Fengguang
2009-08-27 16:46   ` Yan, Zheng 
2009-08-28  1:50     ` Wu Fengguang
2009-08-28  2:33       ` Yan, Zheng 
2009-08-28  3:31         ` Wu Fengguang
2009-08-28  5:58           ` Zhu Yanhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox