70 lines
2.2 KiB
Diff
70 lines
2.2 KiB
Diff
Subject: radix-tree-rt-aware.patch
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
Date: Sun, 17 Jul 2011 21:33:18 +0200
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/patches-3.14.0-rt1.tar.xz
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
---
|
|
include/linux/radix-tree.h | 7 ++++++-
|
|
lib/radix-tree.c | 5 ++++-
|
|
2 files changed, 10 insertions(+), 2 deletions(-)
|
|
|
|
--- a/include/linux/radix-tree.h
|
|
+++ b/include/linux/radix-tree.h
|
|
@@ -230,8 +230,13 @@ unsigned long radix_tree_next_hole(struc
|
|
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);
|
|
int radix_tree_maybe_preload(gfp_t gfp_mask);
|
|
+#else
|
|
+static inline int radix_tree_preload(gfp_t gm) { return 0; }
|
|
+static inline int radix_tree_maybe_preload(gfp_t gfp_mask) { return 0; }
|
|
+#endif
|
|
void radix_tree_init(void);
|
|
void *radix_tree_tag_set(struct radix_tree_root *root,
|
|
unsigned long index, unsigned int tag);
|
|
@@ -256,7 +261,7 @@ unsigned long radix_tree_locate_item(str
|
|
|
|
static inline void radix_tree_preload_end(void)
|
|
{
|
|
- preempt_enable();
|
|
+ preempt_enable_nort();
|
|
}
|
|
|
|
/**
|
|
--- a/lib/radix-tree.c
|
|
+++ b/lib/radix-tree.c
|
|
@@ -221,12 +221,13 @@ radix_tree_node_alloc(struct radix_tree_
|
|
* 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);
|
|
@@ -261,6 +262,7 @@ radix_tree_node_free(struct radix_tree_n
|
|
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
|
|
@@ -326,6 +328,7 @@ int radix_tree_maybe_preload(gfp_t gfp_m
|
|
return 0;
|
|
}
|
|
EXPORT_SYMBOL(radix_tree_maybe_preload);
|
|
+#endif
|
|
|
|
/*
|
|
* Return the maximum key which can be store into a
|