diff options
author | Christoph Lameter <cl@linux.com> | 2010-12-08 11:42:22 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-17 09:18:05 -0500 |
commit | cd85fc58cd71bf6b89612efafb9a84e655ed7d66 (patch) | |
tree | 263a03558fec644dfaa6b389106bb6f7d6bacfbd /kernel/taskstats.c | |
parent | b29c617af3b09d150d3889836c24d39564b39180 (diff) |
taskstats: Use this_cpu_ops
Use this_cpu_inc_return in one place and avoid ugly __raw_get_cpu in
another.
V3->V4:
- Fix off by one.
V4-V4f:
- Use &listener_array
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/taskstats.c')
-rw-r--r-- | kernel/taskstats.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index c8231fb15708..5f82ccd10392 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
@@ -89,8 +89,7 @@ static int prepare_reply(struct genl_info *info, u8 cmd, struct sk_buff **skbp, | |||
89 | return -ENOMEM; | 89 | return -ENOMEM; |
90 | 90 | ||
91 | if (!info) { | 91 | if (!info) { |
92 | int seq = get_cpu_var(taskstats_seqnum)++; | 92 | int seq = this_cpu_inc_return(taskstats_seqnum) - 1; |
93 | put_cpu_var(taskstats_seqnum); | ||
94 | 93 | ||
95 | reply = genlmsg_put(skb, 0, seq, &family, 0, cmd); | 94 | reply = genlmsg_put(skb, 0, seq, &family, 0, cmd); |
96 | } else | 95 | } else |
@@ -581,7 +580,7 @@ void taskstats_exit(struct task_struct *tsk, int group_dead) | |||
581 | fill_tgid_exit(tsk); | 580 | fill_tgid_exit(tsk); |
582 | } | 581 | } |
583 | 582 | ||
584 | listeners = &__raw_get_cpu_var(listener_array); | 583 | listeners = __this_cpu_ptr(&listener_array); |
585 | if (list_empty(&listeners->list)) | 584 | if (list_empty(&listeners->list)) |
586 | return; | 585 | return; |
587 | 586 | ||