summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-07-17 19:33:18 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:20:27 (GMT)
commit745883cee668bc33ca7984fba827ac75dada34e2 (patch)
tree663f00de5998e653e7421a8a2ad7364c1ea49b02
parent3f136daf25d7b44c9077dac0ca3eedc3b69df779 (diff)
downloadlinux-fsl-qoriq-745883cee668bc33ca7984fba827ac75dada34e2.tar.xz
radix-tree-rt-aware.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/linux/radix-tree.h7
-rw-r--r--lib/radix-tree.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index e8be53e..ab8263e 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -227,8 +227,13 @@ radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root,
void ***results, unsigned long *indices,
unsigned long first_index, unsigned int max_items);
+#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);
@@ -253,7 +258,7 @@ unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item);
static inline void radix_tree_preload_end(void)
{
- preempt_enable();
+ preempt_enable_nort();
}
/**
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index e8adb5d..b7ab981 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -221,12 +221,13 @@ radix_tree_node_alloc(struct radix_tree_root *root)
* 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_node *node)
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_mask)
return 0;
}
EXPORT_SYMBOL(radix_tree_maybe_preload);
+#endif
/*
* Return the maximum key which can be store into a