[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100922164703.GD5302@nowhere>
Date: Wed, 22 Sep 2010 18:47:05 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
Don Zickus <dzickus@...hat.com>,
Cyrill Gorcunov <gorcunov@...il.com>
Subject: Re: [PATCH] avoid second smp_processor_id() call in
__touch_watchdog
On Wed, Sep 22, 2010 at 06:39:19PM +0200, Peter Zijlstra wrote:
> On Wed, 2010-09-22 at 18:27 +0200, Frederic Weisbecker wrote:
> >
> > I'm not sure we want this. This is called by the watchdog internally,
> > from the timer or the cpu bound thread, so we probably should better
> > keep __get_cpu_var() because it checks that we are not in a preemptable
> > section.
>
> The smp_processor_id() right at the start already does that.
>
> That said, I doubt it really matter one way or the other, compilers have
> been known to do CSE for quite a while.
I don't mind personally. We indeed have this smp_processor_id() that
does the check already. But that's also for readability: reviewers
that are used to deal with per cpu datas are also used to see
per_cpu() for remote percpu data access and get_cpu_var() for local
percpu.
Plus some archs may override their __my_cpu_offset implementation
to provide a faster access.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists