lkml.org 
[lkml]   [2010]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@kernel.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


\
 
 \ /
  Last update: 2010-01-08 13:17    [W:0.234 / U:0.984 seconds]
©2003-2014 Jasper Spaans. Advertise on this site