From mboxrd@z Thu Jan 1 00:00:00 1970 From: Taniya Das Subject: ARM: idle sleep time for hotplugged cpu Date: Mon, 05 Nov 2012 09:23:38 +0530 Message-ID: <50973842.9010708@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:14879 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097Ab2KEDxl (ORCPT ); Sun, 4 Nov 2012 22:53:41 -0500 Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: linux-arm-kernel@lists.infradead.org Cc: linux-arm-msm@vger.kernel.org Hello, I was looking at the arch/arm/process.c:cpu_die, I was wondering why we do not exit from NOHZ for a hotplugged/offline cpu? If I understand correctly an offlined cpu too will enter NOHz(tick_nohz_idle_enter) and update the idle_entrytime. The cpu will die and it will reenter the idle thread and update idle_entrytime onces it comes back online and only then it will exit NOHz, but time spent in sleep idle_sleeptime will be wrongly calculated. void cpu_idle(void) { ..... /* endless idle loop with no priority at all */ while (1) { idle_notifier_call_chain(IDLE_START); tick_nohz_idle_enter();--> Offline CPU entering NOHZ rcu_idle_enter(); while (!need_resched()) { #ifdef CONFIG_HOTPLUG_CPU if (cpu_is_offline(smp_processor_id())) cpu_die(); ---> CPU becomes offline and re-enter the idle thread without exiting from NOHZ, #endif ... } Is it a good idea to exit from NOHZ before cpu_die() or it could be achieved in some other way? Please provide your comments. -- Thanks & Regards, Taniya Das. QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation.