diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-17 21:33:18 +0200 |
|---|---|---|
| committer | Clark Williams <williams@redhat.com> | 2012-02-15 10:32:43 -0600 |
| commit | db8d24368d2b765b4717db49dc99b0bf7e33e91e (patch) | |
| tree | e399f53fc841d35f5c4dc8b3e04a2a1ce81bfabd | |
| parent | 8a0095c4c00646d6c6593044eb887c09ac1c29a8 (diff) | |
radix-tree-rt-aware.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
| -rw-r--r-- | include/linux/radix-tree.h | 8 | ||||
| -rw-r--r-- | lib/radix-tree.c | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 9d4539c52e53..6b4bdf2097dd 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h @@ -231,7 +231,13 @@ unsigned long radix_tree_next_hole(struct radix_tree_root *root, 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); @@ -256,7 +262,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(); } #endif /* _LINUX_RADIX_TREE_H */ diff --git a/lib/radix-tree.c b/lib/radix-tree.c index d9df7454519c..770453ac61e9 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -166,12 +166,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); @@ -206,6 +207,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 @@ -240,6 +242,7 @@ out: return ret; } EXPORT_SYMBOL(radix_tree_preload); +#endif /* * Return the maximum key which can be store into a |
