[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100108121414.GB4967@lenovo>
Date: Fri, 8 Jan 2010 15:14:14 +0300
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] sparseirq: use radix_tree instead of ptrs array
On Fri, Jan 08, 2010 at 03:53:14AM -0800, Yinghai Lu wrote:
> use radix_tree irq_desc_tree instead of irq_desc_ptrs.
>
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
>
> ---
> kernel/irq/handle.c | 47 ++++++++++++++++++++++-------------------------
> 1 file changed, 22 insertions(+), 25 deletions(-)
>
> Index: linux-2.6/kernel/irq/handle.c
> ===================================================================
> --- linux-2.6.orig/kernel/irq/handle.c
> +++ linux-2.6/kernel/irq/handle.c
> @@ -19,6 +19,7 @@
> #include <linux/kernel_stat.h>
> #include <linux/rculist.h>
> #include <linux/hash.h>
> +#include <linux/radix-tree.h>
> #include <trace/events/irq.h>
>
> #include "internals.h"
> @@ -127,7 +128,23 @@ static void init_one_irq_desc(int irq, s
> */
> DEFINE_RAW_SPINLOCK(sparse_irq_lock);
>
> -static struct irq_desc **irq_desc_ptrs __read_mostly;
> +static RADIX_TREE(irq_desc_tree, GFP_KERNEL);
> +
> +static void set_irq_desc(unsigned int irq, struct irq_desc *desc)
> +{
> + radix_tree_insert(&irq_desc_tree, irq, desc);
> +}
> +
> +struct irq_desc *irq_to_desc(unsigned int irq)
> +{
> + return radix_tree_lookup(&irq_desc_tree, irq);
> +}
> +
> +void replace_irq_desc(unsigned int irq, struct irq_desc *desc)
> +{
> + radix_tree_delete(&irq_desc_tree, irq);
> + radix_tree_insert(&irq_desc_tree, irq, desc);
> +}
>
...
Hi Yinghai,
should not we printk\warn if radix_tree_insert() is get failed?
This is hardly (if ever) happen on machines with small number
of interrupts allocated but anyway.
Or I miss something?
-- Cyrill
--
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