Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203AbbFZL0D (ORCPT ); Fri, 26 Jun 2015 07:26:03 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:43011 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752167AbbFZLZ5 (ORCPT ); Fri, 26 Jun 2015 07:25:57 -0400 X-Helo: d03dlp03.boulder.ibm.com X-MailFrom: preeti@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Message-ID: <558D36BC.6090502@linux.vnet.ibm.com> Date: Fri, 26 Jun 2015 16:55:48 +0530 From: Preeti U Murthy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Thomas Gleixner 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 References: <1435228065-2428-1-git-send-email-sudeep.holla@arm.com> <558C1E97.4020206@arm.com> <558CDE57.3050008@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15062611-0009-0000-0000-00000C066F2E Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2253 Lines: 55 On 06/26/2015 01:17 PM, Thomas Gleixner wrote: > On Fri, 26 Jun 2015, Preeti U Murthy wrote: >> What about the case where GENERIC_CLOCKEVENTS_BROADCAST=y and >> TICK_ONESHOT=n (HZ_PERIODIC=y) ? Have you tested this ? >> >> This will hang the kernel at boot if you are using the hrtimer mode of >> broadcast. This is because the local timers of all cpus are shutdown >> when the cpuidle driver registers itself, on finding out that there are >> idle states where local tick devices stop. The broadcast tick device is >> then in charge of waking up the cpus at every period. In hrtimer mode of >> broadcast, there is no such real device and we hang. > > Hmm, no. tick-broadcast-hrtimer.o depends on TICK_ONESHOT=y. So this > is covered by the check for the broadcast device, which is NULL. > > But there is another variant: > > GENERIC_CLOCKEVENTS_BROADCAST=y TICK_ONESHOT=y and 'highres=off > nohz=off' on the kernel command line. Can this happen at all? It is during tick_init_highres() or tick_nohz_switch_to_nohz() that we switch to oneshot mode, not otherwise AFAICT. I was actually talking of the following scenario. In periodic mode, where GENERIC_CLOCKEVENTS_BROADCAST=y, the arch can execute tick_setup_hrtimer_broadcast(), which will return nothing as you point out above. So there is no broadcast clockevent device. When the cpuidle driver registers with the cpuidle core however, cpuidle_setup_broadcast_timer() on every cpu is executed if it finds that there is an idle state where ticks stop. cpuidle_setup_broadcast_timer() tick_broadcast_enable() tick_broadcast_control(BROADCAST_ON) bc = tick_broadcast_device.evtdev which is NULL in this case TICK_BROADCAST_ON: checks for periodic mode of the broadcast device - succeeds although we haven't registered a broadcast device because value of TICKDEV_PERIODIC is 0, the default value of td.mode. clockevents_shutdown(dev) At this point all cpus stop. Regards Preeti U Murthy -- 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/