From patchwork Thu Apr 26 18:36:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 8141 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 051DD23E47 for ; Thu, 26 Apr 2012 18:47:28 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7974CA1832D for ; Thu, 26 Apr 2012 18:47:25 +0000 (UTC) Received: by iage36 with SMTP id e36so2761625iag.11 for ; Thu, 26 Apr 2012 11:47:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:date:from :to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-content-scanned:x-cbid:x-gm-message-state; bh=oTY59/3u0zJKmyU+8ApJj2am4cZgR/7XExyrfEYd4IM=; b=CRlGyhTeGML183y8fB1Mvn7NYfviS5DhHTSCmyVSh6mIeNXw4EIxFwiPYfMs5xMuQ8 mySR8HmlRN9OOrU78tNqPHhcgjf0YWRv1dgLR8AITjENNOlnyyXNF2oVy0lQdgn3waoB 7IbJqTV7NBXkh9o2QZ/WNRx/BzpCcsn1ehydyjgr6qV9fPex47mwQshzcADAPLRUYSsZ BQatex/VFVuYRTyyxdEXGCQeFXlJ7hG65UeOTQM0YpdNIXjdBLZpFGgM6nYnQbUgfCd3 PlWJHX2dhLpCrJOmXC78wLoOMkoxEouOhoYnW+4xCMD3uIEhQhufiEGOqnendbBN5Zqc HM+g== Received: by 10.50.196.230 with SMTP id ip6mr8170783igc.49.1335466044860; Thu, 26 Apr 2012 11:47:24 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp358328ibt; Thu, 26 Apr 2012 11:47:23 -0700 (PDT) Received: by 10.50.17.134 with SMTP id o6mr6604317igd.28.1335466042725; Thu, 26 Apr 2012 11:47:22 -0700 (PDT) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com. [32.97.182.142]) by mx.google.com with ESMTPS id mi10si21137472igc.23.2012.04.26.11.47.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Apr 2012 11:47:22 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.142 as permitted sender) client-ip=32.97.182.142; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.142 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e2.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Apr 2012 14:47:20 -0400 Received: from d01dlp01.pok.ibm.com (9.56.224.56) by e2.ny.us.ibm.com (192.168.1.102) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 26 Apr 2012 14:46:39 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id B654438C805A; Thu, 26 Apr 2012 14:46:37 -0400 (EDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3QIkagY071442; Thu, 26 Apr 2012 14:46:37 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3QIkYg7027298; Thu, 26 Apr 2012 12:46:36 -0600 Received: from paulmck-ThinkPad-W500 ([9.47.24.152]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q3QIkYe4027245; Thu, 26 Apr 2012 12:46:34 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 07AD3E4D77; Thu, 26 Apr 2012 11:36:51 -0700 (PDT) Date: Thu, 26 Apr 2012 11:36:51 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, patches@linaro.org, "Paul E. McKenney" Subject: Re: [PATCH] timer: Fix mod_timer_pinned() header commen (was: [PATCH RFC tip/core/rcu 4/4] rcu: Ensure that RCU_FAST_NO_HZ timers expire on correct CPU) Message-ID: <20120426183651.GH2407@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20120423161539.GA6467@linux.vnet.ibm.com> <1335197761-6577-1-git-send-email-paulmck@linux.vnet.ibm.com> <1335197761-6577-4-git-send-email-paulmck@linux.vnet.ibm.com> <1335445496.13683.21.camel@twins> <20120426155450.GD2407@linux.vnet.ibm.com> <1335456539.28106.185.camel@gandalf.stny.rr.com> <20120426175608.GG2407@linux.vnet.ibm.com> <1335463819.28106.187.camel@gandalf.stny.rr.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1335463819.28106.187.camel@gandalf.stny.rr.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12042618-5112-0000-0000-00000773A5A1 X-Gm-Message-State: ALoCoQlD3VCkovkkhbI/Dga6Z1zGOKMdqKxV7fGDRH0EtjcvHIXVtwDQ9ctHPEoy26N9X3ZecYiu On Thu, Apr 26, 2012 at 02:10:19PM -0400, Steven Rostedt wrote: > > > ------------------------------------------------------------------------ > > > > timer: Fix mod_timer_pinned() header comment > > > > The mod_timer_pinned() header comment states that it prevents timers > > from being migrated to a different CPU. This is not the case, instead, > > it ensures that the timer is posted to the current CPU, but does nothing > > to prevent CPU-hotplug operations from migrating the timer. > > > > This commit therefore brings the comment header into alignment with > > reality. > > > > Signed-off-by: Paul E. McKenney > > Signed-off-by: Paul E. McKenney > > I'm seeing double :-) "Bartender, give me a double!" > > diff --git a/kernel/timer.c b/kernel/timer.c > > index a297ffc..7114336 100644 > > --- a/kernel/timer.c > > +++ b/kernel/timer.c > > @@ -861,7 +861,12 @@ EXPORT_SYMBOL(mod_timer); > > * > > * mod_timer_pinned() is a way to update the expire field of an > > * active timer (if the timer is inactive it will be activated) > > - * and not allow the timer to be migrated to a different CPU. > > + * and to ensure that the timer is scheduled on the current CPU. > > Add space here. > > + * Good point, done! > > + * Note that this does not prevent the timer from being migrated > > + * when the current CPU goes offline. If this is a problem for > > + * you, use CPU-hotplug notifiers to handle it correctly, for > > + * example, cancelling the timer when the corresponding CPU goes > > + * offline. > > * > > * mod_timer_pinned(timer, expires) is equivalent to: > > * > > Adding a space will make the "Note" stand out more, and more likely seen > by people who use this function. > > Other than that: > > Acked-by: Steven Rostedt Got it, thank you! Thanx, Paul ------------------------------------------------------------------------ timer: Fix mod_timer_pinned() header comment The mod_timer_pinned() header comment states that it prevents timers from being migrated to a different CPU. This is not the case, instead, it ensures that the timer is posted to the current CPU, but does nothing to prevent CPU-hotplug operations from migrating the timer. This commit therefore brings the comment header into alignment with reality. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney Acked-by: Steven Rostedt diff --git a/kernel/timer.c b/kernel/timer.c index a297ffc..837c552 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -861,7 +861,13 @@ EXPORT_SYMBOL(mod_timer); * * mod_timer_pinned() is a way to update the expire field of an * active timer (if the timer is inactive it will be activated) - * and not allow the timer to be migrated to a different CPU. + * and to ensure that the timer is scheduled on the current CPU. + * + * Note that this does not prevent the timer from being migrated + * when the current CPU goes offline. If this is a problem for + * you, use CPU-hotplug notifiers to handle it correctly, for + * example, cancelling the timer when the corresponding CPU goes + * offline. * * mod_timer_pinned(timer, expires) is equivalent to: *