Skip to content

Commit

Permalink
perf_counter: call atomic64_set for counter->count
Browse files Browse the repository at this point in the history
A compile warning triggered because we are calling
atomic_set(&counter->count). But since counter->count
is an atomic64_t, we have to use atomic64_set.

So the count can be set short, resulting in the reset ioctl
only resetting the low word.

[ Impact: clear counter properly during the reset ioctl ]

Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
LKML-Reference: <18951.48285.270311.981806@drongo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Paul Mackerras authored and Ingo Molnar committed May 11, 2009
1 parent a08b159 commit 615a3f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ static unsigned int perf_poll(struct file *file, poll_table *wait)
static void perf_counter_reset(struct perf_counter *counter)
{
(void)perf_counter_read(counter);
atomic_set(&counter->count, 0);
atomic64_set(&counter->count, 0);
perf_counter_update_userpage(counter);
}

Expand Down

0 comments on commit 615a3f1

Please sign in to comment.