Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753349AbbGAJJI (ORCPT ); Wed, 1 Jul 2015 05:09:08 -0400 Received: from www.linutronix.de ([62.245.132.108]:37863 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbbGAJIy (ORCPT ); Wed, 1 Jul 2015 05:08:54 -0400 Date: Wed, 1 Jul 2015 11:08:49 +0200 (CEST) From: Thomas Gleixner To: Preeti U Murthy cc: Sudeep Holla , "linux-kernel@vger.kernel.org" , Suzuki Poulose , Lorenzo Pieralisi , Catalin Marinas , "Rafael J. Wysocki" Subject: Re: [PATCH] clockevents: return error from tick_broadcast_oneshot_control if !GENERIC_CLOCKEVENTS_BROADCAST In-Reply-To: Message-ID: References: <1435228065-2428-1-git-send-email-sudeep.holla@arm.com> <558C1E97.4020206@arm.com> <558CDE57.3050008@linux.vnet.ibm.com> <558D46C5.8080307@linux.vnet.ibm.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2238 Lines: 54 On Fri, 26 Jun 2015, Thomas Gleixner wrote: > On Fri, 26 Jun 2015, Preeti U Murthy wrote: > > On 06/26/2015 01:17 PM, Thomas Gleixner wrote: > > > if (state == TICK_BROADCAST_ENTER) { > > > + /* > > > + * If the current CPU owns the hrtimer broadcast > > > + * mechanism, it cannot go deep idle and we do not add > > > + * the CPU to the broadcast mask. We don't have to go > > > + * through the EXIT path as the local timer is not > > > + * shutdown. > > > + */ > > > + ret = broadcast_needs_cpu(bc, cpu); > > > + > > > + /* > > > + * If the hrtimer broadcast check tells us that the > > > + * cpu cannot go deep idle, or if the broadcast device > > > + * is in periodic mode, we just return. > > > + */ > > > + if (ret || tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC) > > > + goto out; > > > > The check on PERIODIC mode is good, but I don't see the point of moving > > broadcast_needs_cpu() up above. broadcast_shutdown_local() calls > > broadcast_needs_cpu() internally. > > > > Besides, by jumping to 'out', we will miss programming the broadcast > > hrtimer in tick_broadcast_set_event() below, if the cpu happen to be the > > broadcast cpu(which is why it was not allowed to go to deep idle). > > Hmm. Need to think a bit more about this convoluted maze ... Actually, that does not matter at all because the CPU which runs the broadcast does not need to program its own next event. That's just redundant because the next event on this cpu is already programmed in the cpu local timer device and the associated hrtimer is in the tree. The cpu does not go into deep idle so it just works and we spare the set/clear bit dance along with the hrtimer update. Now, there is another caveat. If the cpu is not holding the broadcast device and has the first expiring timer then the broadcast device might migrate over and we should clear the cpu in the broadcast_oneshot_mask. I so wish we had never invented that broadcast crap at all. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/