Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-11-05 Thread Christoph Lameter
On Sat, 3 Nov 2012, Shan Wei wrote: > return (char *)this_cpu_ptr(_buffer->buffer); Makes sense since buffer is the actual start of the bytes and not a pointer to a buffer like what I thought. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-11-05 Thread Christoph Lameter
On Sat, 3 Nov 2012, Shan Wei wrote: return (char *)this_cpu_ptr(percpu_buffer-buffer); Makes sense since buffer is the actual start of the bytes and not a pointer to a buffer like what I thought. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-11-02 Thread Shan Wei
Christoph Lameter said, at 2012/11/3 1:53: > > hmm what is actually returned is a pointer to char right? And buffer > is char[1024] so I guess then you need to pass a pointer to char to > this_cpu_read. > > return this_cpu_read(&(percpu_buffer->buffer)) still error

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-11-02 Thread Christoph Lameter
On Fri, 2 Nov 2012, Shan Wei wrote: > Christoph Lameter said, at 2012/11/1 1:50: > >> > >> - buffer = per_cpu_ptr(percpu_buffer, smp_processor_id()); > >> + buffer = this_cpu_ptr(percpu_buffer); > >> > >>return buffer->buffer; > > > > > > Just do a > > > > return

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-11-02 Thread Shan Wei
Christoph Lameter said, at 2012/11/1 1:50: >> >> -buffer = per_cpu_ptr(percpu_buffer, smp_processor_id()); >> +buffer = this_cpu_ptr(percpu_buffer); >> >> return buffer->buffer; > > > Just do a > > return this_cpu_read(percpu_buffer->buffer); > > and get rid of the

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-11-02 Thread Shan Wei
Christoph Lameter said, at 2012/11/1 1:50: -buffer = per_cpu_ptr(percpu_buffer, smp_processor_id()); +buffer = this_cpu_ptr(percpu_buffer); return buffer-buffer; Just do a return this_cpu_read(percpu_buffer-buffer); and get rid of the this_cpu_ptr op can not do

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-11-02 Thread Christoph Lameter
On Fri, 2 Nov 2012, Shan Wei wrote: Christoph Lameter said, at 2012/11/1 1:50: - buffer = per_cpu_ptr(percpu_buffer, smp_processor_id()); + buffer = this_cpu_ptr(percpu_buffer); return buffer-buffer; Just do a return this_cpu_read(percpu_buffer-buffer); and get

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-11-02 Thread Shan Wei
Christoph Lameter said, at 2012/11/3 1:53: hmm what is actually returned is a pointer to char right? And buffer is char[1024] so I guess then you need to pass a pointer to char to this_cpu_read. return this_cpu_read((percpu_buffer-buffer)) still error kernel/trace/trace.c: In

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-10-31 Thread Christoph Lameter
On Wed, 31 Oct 2012, Shan Wei wrote: > From: Shan Wei > > > Signed-off-by: Shan Wei > --- > kernel/trace/blktrace.c |2 +- > kernel/trace/trace.c|2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c > index

[PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-10-31 Thread Shan Wei
From: Shan Wei Signed-off-by: Shan Wei --- kernel/trace/blktrace.c |2 +- kernel/trace/trace.c|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index c0bd030..71259e2 100644 --- a/kernel/trace/blktrace.c +++

[PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-10-31 Thread Shan Wei
From: Shan Wei davids...@tencent.com Signed-off-by: Shan Wei davids...@tencent.com --- kernel/trace/blktrace.c |2 +- kernel/trace/trace.c|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index c0bd030..71259e2

Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

2012-10-31 Thread Christoph Lameter
On Wed, 31 Oct 2012, Shan Wei wrote: From: Shan Wei davids...@tencent.com Signed-off-by: Shan Wei davids...@tencent.com --- kernel/trace/blktrace.c |2 +- kernel/trace/trace.c|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/blktrace.c