Subject: [tracing vs percpu-next] use this_cpu_ptr We can use this_cpu_ptr in some places. Signed-off-by: Christoph Lameter --- kernel/trace/blktrace.c | 4 ++-- kernel/trace/trace_syscalls.c | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) Index: linux-2.6/kernel/trace/blktrace.c =================================================================== --- linux-2.6.orig/kernel/trace/blktrace.c 2009-10-09 11:52:52.000000000 -0500 +++ linux-2.6/kernel/trace/blktrace.c 2009-10-09 11:53:09.000000000 -0500 @@ -139,7 +139,7 @@ void __trace_note_message(struct blk_tra return; local_irq_save(flags); - buf = per_cpu_ptr(bt->msg_data, smp_processor_id()); + buf = this_cpu_ptr(bt->msg_data); va_start(args, fmt); n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); va_end(args); @@ -230,7 +230,7 @@ static void __blk_add_trace(struct blk_t t = relay_reserve(bt->rchan, sizeof(*t) + pdu_len); if (t) { - sequence = per_cpu_ptr(bt->sequence, cpu); + sequence = this_cpu_ptr(bt->sequence); t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION; t->sequence = ++(*sequence); Index: linux-2.6/kernel/trace/trace_syscalls.c =================================================================== --- linux-2.6.orig/kernel/trace/trace_syscalls.c 2009-10-09 11:52:52.000000000 -0500 +++ linux-2.6/kernel/trace/trace_syscalls.c 2009-10-09 11:53:09.000000000 -0500 @@ -390,7 +390,6 @@ static void prof_syscall_enter(struct pt char *raw_data; int syscall_nr; int size; - int cpu; syscall_nr = syscall_get_nr(current, regs); if (!test_bit(syscall_nr, enabled_prof_enter_syscalls)) @@ -412,8 +411,6 @@ static void prof_syscall_enter(struct pt /* Protect the per cpu buffer, begin the rcu read side */ local_irq_save(flags); - cpu = smp_processor_id(); - if (in_nmi()) raw_data = rcu_dereference(trace_profile_buf_nmi); else @@ -422,7 +419,7 @@ static void prof_syscall_enter(struct pt if (!raw_data) goto end; - raw_data = per_cpu_ptr(raw_data, cpu); + raw_data = this_cpu_ptr(raw_data); /* zero the dead bytes from align to not leak stack to user */ *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL; @@ -486,7 +483,6 @@ static void prof_syscall_exit(struct pt_ int syscall_nr; char *raw_data; int size; - int cpu; syscall_nr = syscall_get_nr(current, regs); if (!test_bit(syscall_nr, enabled_prof_exit_syscalls)) @@ -510,7 +506,6 @@ static void prof_syscall_exit(struct pt_ /* Protect the per cpu buffer, begin the rcu read side */ local_irq_save(flags); - cpu = smp_processor_id(); if (in_nmi()) raw_data = rcu_dereference(trace_profile_buf_nmi); @@ -520,7 +515,7 @@ static void prof_syscall_exit(struct pt_ if (!raw_data) goto end; - raw_data = per_cpu_ptr(raw_data, cpu); + raw_data = this_cpu_ptr(raw_data); /* zero the dead bytes from align to not leak stack to user */ *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL;