mm: replace __get_cpu_var uses with this_cpu_ptr
Replace places where __get_cpu_var() is used for an address calculation with this_cpu_ptr(). Signed-off-by: Christoph Lameter <cl@linux.com> Cc: Tejun Heo <tj@kernel.org> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
dc6f6c97f1
commit
7c8e0181e6
@ -194,7 +194,7 @@ 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 = this_cpu_ptr(&radix_tree_preloads);
|
||||
if (rtp->nr) {
|
||||
ret = rtp->nodes[rtp->nr - 1];
|
||||
rtp->nodes[rtp->nr - 1] = NULL;
|
||||
@ -250,14 +250,14 @@ static int __radix_tree_preload(gfp_t gfp_mask)
|
||||
int ret = -ENOMEM;
|
||||
|
||||
preempt_disable();
|
||||
rtp = &__get_cpu_var(radix_tree_preloads);
|
||||
rtp = this_cpu_ptr(&radix_tree_preloads);
|
||||
while (rtp->nr < ARRAY_SIZE(rtp->nodes)) {
|
||||
preempt_enable();
|
||||
node = kmem_cache_alloc(radix_tree_node_cachep, gfp_mask);
|
||||
if (node == NULL)
|
||||
goto out;
|
||||
preempt_disable();
|
||||
rtp = &__get_cpu_var(radix_tree_preloads);
|
||||
rtp = this_cpu_ptr(&radix_tree_preloads);
|
||||
if (rtp->nr < ARRAY_SIZE(rtp->nodes))
|
||||
rtp->nodes[rtp->nr++] = node;
|
||||
else
|
||||
|
Reference in New Issue
Block a user