From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Subject: Re: [linux-pm] acpi_idle and max_cpus Date: Tue, 19 Jun 2012 09:18:04 +0200 Message-ID: <4FE027AC.8010607@linaro.org> References: <4FDB549F.1020002@linaro.org> <4FDE3B96.8030306@linaro.org> <4FDF1E3A.6010200@linux.vnet.ibm.com> <4FDF24FE.1010108@linaro.org> <4FE02233.2060809@linux.vnet.ibm.com> <4FE0243C.4040600@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-bk0-f46.google.com ([209.85.214.46]:41312 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146Ab2FSHSJ (ORCPT ); Tue, 19 Jun 2012 03:18:09 -0400 Received: by bkcji2 with SMTP id ji2so4767087bkc.19 for ; Tue, 19 Jun 2012 00:18:07 -0700 (PDT) In-Reply-To: <4FE0243C.4040600@linux.vnet.ibm.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Srivatsa S. Bhat" Cc: Deepthi Dharwar , linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org, trenn@suse.de On 06/19/2012 09:03 AM, Srivatsa S. Bhat wrote: > On 06/19/2012 12:24 PM, Deepthi Dharwar wrote: >=20 >> On 06/18/2012 06:24 PM, Daniel Lezcano wrote: >> >>> On 06/18/2012 02:25 PM, Deepthi Dharwar wrote: >>>> Hi Daniel, >>>> >>>> On 06/18/2012 01:48 AM, Daniel Lezcano wrote: >>>> >>>>> On 06/15/2012 05:28 PM, Daniel Lezcano wrote: >>>>>> >>>>>> Hi all, >>>>>> >>>>>> I have a dual core Intel T9500. >>>>>> >>>>>> I boot the cpu with the acpi_idle driver and intel_idle enabled = in the >>>>>> config. >>>>>> >>>>>> The kernel is booted with maxcpus=3D1. >>>>>> >>>>>> After the system has boot, I put cpu1 online via sysfs. >>>>>> >>>>>> But I don't see any 'cpuidle' directory in the cpu's sysfs entry= : >>>>>> >>>>>> /sys/devices/system/cpu/cpu1/cpuidle (?) >>>>>> >>>>>> When I look at the code I see the notifier is present for hotplu= g in >>>>>> processor_driver.c and the cpuidle intel init routine should be = called >>>>>> there. >>>>>> >>>> >>>> >>>> Yes, we have a hotplug notifier. >>>> Commit 99b72508 by Thomas Renninger fixed this issue. >>>> >>>> Please let me know which kernel version you are running and what i= s idle >>>> driver registered ? >>> >>> The kernel version is 3.5.0-rc1 >>> The registered driver is acpi_idle (with intel_idle if I am not wro= ng). >>> >>> Thomas's patch is in this version. >>> >>> Maybe I am wrong but I think the patch is not correct because: >>> >>> static int __cpuinit acpi_processor_add(struct acpi_device *device) >>> { >>> >>> ... >>> >>> #ifdef CONFIG_SMP >>> if (pr->id >=3D setup_max_cpus && pr->id !=3D 0) >>> return 0; >>> #endif >>> >>> ... >>> >>> per_cpu(processors, pr->id) =3D pr; >>> >>> ... >>> } >>> >>> With max_cpus=3D1 we exit before setting up 'pr'. >>> >>> So the condition in: >>> >>> static int acpi_cpu_soft_notify(...) >>> { >>> >>> unsigned int cpu =3D (unsigned long)hcpu; >>> struct acpi_processor *pr =3D per_cpu(processors, cpu); >>> >>> if (action =3D=3D CPU_ONLINE && pr) { >>> >>> ... >>> } >>> >>> Is always false because pr =3D=3D NULL >>> >>> I did the change but I don't still see the 'cpuidle' directory >>> appearing, I suspect also pr->flags.need_hotplug_init is not correc= tly >>> initialized but I did not investigate more. >>> >> >> >> Well looks like variable maxcpus holds the key here. >> >=20 >=20 > Whose equivalent is setup_max_cpus inside the kernel, as Daniel menti= oned. >=20 >> When I am booting the system, say with 2 out of 4 available cpus, >> set via maxcpus variable with intel_idle or acpi_idle and onlining t= he >> other 2 cpus later via sysfs, I dont see cpufreq or cpuidle dir in t= he >> sysfs path. >> >> # cd /sys/devices/system/cpu/cpu2 >> xxx:/sys/devices/system/cpu/cpu2# ls >> crash_notes node0 online >> xxx:/sys/devices/system/cpu/cpu2# echo 1 > online >> xxx:/sys/devices/system/cpu/cpu2# ls >> cache crash_notes node0 online thermal_throttle topology >> >> So looks like its designed that way for now. >=20 >=20 > I don't think so. Looks more like a bug than a design ;-) >=20 >> So if maxcpus=3DX, X> Enabling the Y-X cpus later after the boot via sysfs is not enabling >> cpuidle and cpufreq . >> >> The question is, do we want to modify this behavior ? >> >=20 >=20 > Yes we do, and that's Daniel's pain point as well. I don't think ther= e is > any good reason why the cpuidle directory must _not_ be exported for = cpus > that are onlined later. Yes and if I refer to the code, it is supposed to do that. I added Thomas in Cc. Thanks -- Daniel --=20 Linaro.org =E2=94=82 Open source software for= ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html