From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757922Ab0IXTfO (ORCPT ); Fri, 24 Sep 2010 15:35:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10794 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757729Ab0IXTfM (ORCPT ); Fri, 24 Sep 2010 15:35:12 -0400 Date: Fri, 24 Sep 2010 15:34:47 -0400 From: Don Zickus To: Sergey Senozhatsky Cc: Andrew Morton , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Cyrill Gorcunov , Frederic Weisbecker Subject: Re: [PATCH] avoid second smp_processor_id() call in __touch_watchdog Message-ID: <20100924193447.GT26290@redhat.com> References: <20100813102158.GA5434@swordfish.minsk.epam.com> <20100818123346.02028e96.akpm@linux-foundation.org> <20100922090012.GA5459@swordfish.minsk.epam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100922090012.GA5459@swordfish.minsk.epam.com> User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2010 at 12:00:12PM +0300, Sergey Senozhatsky wrote: > Hello, > > Per our previous conversation: > > Andrew Morton wrote: > > Fair enough, although strictly speaking this should be done in a > > separate and later patch. > > > > > Avoid double smp_processor_id() call in __touch_watchdog (smp_processor_id() > itself and later call in __get_cpu_var()) Dropping this patch then based on Peter's and Frederic's feedback that the compiler probably already optimizes for this, leaving readability as a good excuse not to change anything. Cheers, Don > > Signed-off-by: Sergey Senozhatsky > > --- > > diff --git a/kernel/watchdog.c b/kernel/watchdog.c > index 7f9c3c5..03d97c5 100644 > --- a/kernel/watchdog.c > +++ b/kernel/watchdog.c > @@ -116,8 +116,7 @@ static unsigned long get_sample_period(void) > static void __touch_watchdog(void) > { > int this_cpu = smp_processor_id(); > - > - __get_cpu_var(watchdog_touch_ts) = get_timestamp(this_cpu); > + per_cpu(watchdog_touch_ts, this_cpu) = get_timestamp(this_cpu); > } > > void touch_softlockup_watchdog(void) >