mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhu Yanhai <zhu.yanhai@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Wu Fengguang <wfg@linux.intel.com>, Jiri Kosina <jkosina@suse.cz>,
	Huang Shijie <shijie8@gmail.com>
Cc: linux-kernel@vger.kernel.org, Zhu Yanhai <yanhai.zhu@linux.intel.com>
Subject: [PATCH] Make radix_tree_preload alloc one more slot
Date: Thu, 27 Aug 2009 20:10:41 +0800	[thread overview]
Message-ID: <4A9677C1.3090804@gmail.com> (raw)

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

             reply	other threads:[~2009-08-27 12:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 12:10 Zhu Yanhai [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9677C1.3090804@gmail.com \
    --to=zhu.yanhai@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shijie8@gmail.com \
    --cc=wfg@linux.intel.com \
    --cc=yanhai.zhu@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome