lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 27 Aug 2009 20:21:44 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	Zhu Yanhai <zhu.yanhai@...il.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Jiri Kosina <jkosina@...e.cz>,
	Huang Shijie <shijie8@...il.com>, linux-kernel@...r.kernel.org,
	Zhu Yanhai <yanhai.zhu@...ux.intel.com>,
	Nick Piggin <nickpiggin@...oo.com.au>
Subject: Re: [PATCH] Make radix_tree_preload alloc one more slot


Hi Yanhai,

[Nick CCed]

On Thu, Aug 27, 2009 at 08:10:41PM +0800, Zhu Yanhai wrote:
> 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.
 
Are you sure?  The comments read:

        /*
         * The radix tree path needs to be one longer than the maximum path
         * since the "list" is null terminated.
         */
        struct radix_tree_path path[RADIX_TREE_MAX_PATH + 1], *pathp = path;

Thanks,
Fengguang


> Signed-off-by: Zhu Yanhai <zhu.yanhai@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ