2012-10-24 14:29:13 +00:00
|
|
|
Subject: radix-tree-rt-aware.patch
|
2011-11-20 00:01:55 +00:00
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
Date: Sun, 17 Jul 2011 21:33:18 +0200
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
---
|
|
|
|
include/linux/radix-tree.h | 8 +++++++-
|
|
|
|
lib/radix-tree.c | 5 ++++-
|
|
|
|
2 files changed, 11 insertions(+), 2 deletions(-)
|
|
|
|
|
2012-10-24 14:29:13 +00:00
|
|
|
Index: linux-stable/include/linux/radix-tree.h
|
|
|
|
===================================================================
|
|
|
|
--- linux-stable.orig/include/linux/radix-tree.h
|
|
|
|
+++ linux-stable/include/linux/radix-tree.h
|
|
|
|
@@ -230,7 +230,13 @@ unsigned long radix_tree_next_hole(struc
|
2011-11-20 00:01:55 +00:00
|
|
|
unsigned long index, unsigned long max_scan);
|
|
|
|
unsigned long radix_tree_prev_hole(struct radix_tree_root *root,
|
|
|
|
unsigned long index, unsigned long max_scan);
|
|
|
|
+
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
int radix_tree_preload(gfp_t gfp_mask);
|
|
|
|
+#else
|
|
|
|
+static inline int radix_tree_preload(gfp_t gm) { return 0; }
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
void radix_tree_init(void);
|
|
|
|
void *radix_tree_tag_set(struct radix_tree_root *root,
|
|
|
|
unsigned long index, unsigned int tag);
|
2012-10-24 14:29:13 +00:00
|
|
|
@@ -255,7 +261,7 @@ unsigned long radix_tree_locate_item(str
|
2011-11-20 00:01:55 +00:00
|
|
|
|
|
|
|
static inline void radix_tree_preload_end(void)
|
|
|
|
{
|
|
|
|
- preempt_enable();
|
|
|
|
+ preempt_enable_nort();
|
|
|
|
}
|
|
|
|
|
2012-06-04 21:20:09 +00:00
|
|
|
/**
|
2012-10-24 14:29:13 +00:00
|
|
|
Index: linux-stable/lib/radix-tree.c
|
|
|
|
===================================================================
|
|
|
|
--- linux-stable.orig/lib/radix-tree.c
|
|
|
|
+++ linux-stable/lib/radix-tree.c
|
|
|
|
@@ -215,12 +215,13 @@ radix_tree_node_alloc(struct radix_tree_
|
2011-11-20 00:01:55 +00:00
|
|
|
* succeed in getting a node here (and never reach
|
|
|
|
* kmem_cache_alloc)
|
|
|
|
*/
|
|
|
|
- rtp = &__get_cpu_var(radix_tree_preloads);
|
|
|
|
+ rtp = &get_cpu_var(radix_tree_preloads);
|
|
|
|
if (rtp->nr) {
|
|
|
|
ret = rtp->nodes[rtp->nr - 1];
|
|
|
|
rtp->nodes[rtp->nr - 1] = NULL;
|
|
|
|
rtp->nr--;
|
|
|
|
}
|
|
|
|
+ put_cpu_var(radix_tree_preloads);
|
|
|
|
}
|
|
|
|
if (ret == NULL)
|
|
|
|
ret = kmem_cache_alloc(radix_tree_node_cachep, gfp_mask);
|
2012-10-24 14:29:13 +00:00
|
|
|
@@ -255,6 +256,7 @@ radix_tree_node_free(struct radix_tree_n
|
2011-11-20 00:01:55 +00:00
|
|
|
call_rcu(&node->rcu_head, radix_tree_node_rcu_free);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
/*
|
|
|
|
* Load up this CPU's radix_tree_node buffer with sufficient objects to
|
|
|
|
* ensure that the addition of a single element in the tree cannot fail. On
|
2012-10-24 14:29:13 +00:00
|
|
|
@@ -289,6 +291,7 @@ out:
|
2011-11-20 00:01:55 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(radix_tree_preload);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the maximum key which can be store into a
|