1. 02 4月, 2013 1 次提交
  2. 01 4月, 2013 3 次提交
    • V
      cpufreq: governor: Implement per policy instances of governors · 4d5dcc42
      Viresh Kumar 提交于
      Currently, there can't be multiple instances of single governor_type.
      If we have a multi-package system, where we have multiple instances
      of struct policy (per package), we can't have multiple instances of
      same governor. i.e. We can't have multiple instances of ondemand
      governor for multiple packages.
      
      Governors directory in sysfs is created at /sys/devices/system/cpu/cpufreq/
      governor-name/. Which again reflects that there can be only one
      instance of a governor_type in the system.
      
      This is a bottleneck for multicluster system, where we want different
      packages to use same governor type, but with different tunables.
      
      This patch uses the infrastructure provided by earlier patch and
      implements init/exit routines for ondemand and conservative
      governors.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4d5dcc42
    • V
      cpufreq: Add per policy governor-init/exit infrastructure · 7bd353a9
      Viresh Kumar 提交于
      Currently, there can't be multiple instances of single governor_type.
      If we have a multi-package system, where we have multiple instances
      of struct policy (per package), we can't have multiple instances of
      same governor. i.e. We can't have multiple instances of ondemand
      governor for multiple packages.
      
      Governors directory in sysfs is created at /sys/devices/system/cpu/cpufreq/
      governor-name/. Which again reflects that there can be only one
      instance of a governor_type in the system.
      
      This is a bottleneck for multicluster system, where we want different
      packages to use same governor type, but with different tunables.
      
      This patch is inclined towards providing this infrastructure. Because
      we are required to allocate governor's resources dynamically now, we
      must do it at policy creation and end. And so got
      CPUFREQ_GOV_POLICY_INIT/EXIT.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7bd353a9
    • N
      cpufreq: Convert the cpufreq_driver_lock to a rwlock · 0d1857a1
      Nathan Zimmer 提交于
      This eliminates the contention I am seeing in __cpufreq_cpu_get.
      It also nicely stages the lock to be replaced by the rcu.
      Signed-off-by: NNathan Zimmer <nzimmer@sgi.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0d1857a1
  3. 09 2月, 2013 8 次提交
  4. 06 2月, 2013 1 次提交
  5. 02 2月, 2013 9 次提交
  6. 26 1月, 2013 1 次提交
    • P
      PM / tracing: remove deprecated power trace API · 43720bd6
      Paul Gortmaker 提交于
      The text in Documentation said it would be removed in 2.6.41;
      the text in the Kconfig said removal in the 3.1 release.  Either
      way you look at it, we are well past both, so push it off a cliff.
      
      Note that the POWER_CSTATE and the POWER_PSTATE are part of the
      legacy tracing API.  Remove all tracepoints which use these flags.
      As can be seen from context, most already have a trace entry via
      trace_cpu_idle anyways.
      
      Also, the cpufreq/cpufreq.c PSTATE one is actually unpaired, as
      compared to the CSTATE ones which all have a clear start/stop.
      As part of this, the trace_power_frequency also becomes orphaned,
      so it too is deleted.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      43720bd6
  7. 15 11月, 2012 8 次提交
  8. 21 7月, 2012 1 次提交
    • S
      cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch · a9144436
      Stephen Boyd 提交于
      Running one program that continuously hotplugs and replugs a cpu
      concurrently with another program that continuously writes to the
      scaling_setspeed node eventually deadlocks with:
      
      =============================================
      [ INFO: possible recursive locking detected ]
      3.4.0 #37 Tainted: G        W
      ---------------------------------------------
      filemonkey/122 is trying to acquire lock:
       (s_active#13){++++.+}, at: [<c01a3d28>] sysfs_remove_dir+0x9c/0xb4
      
      but task is already holding lock:
       (s_active#13){++++.+}, at: [<c01a22f0>] sysfs_write_file+0xe8/0x140
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(s_active#13);
        lock(s_active#13);
      
       *** DEADLOCK ***
      
       May be due to missing lock nesting notation
      
      2 locks held by filemonkey/122:
       #0:  (&buffer->mutex){+.+.+.}, at: [<c01a2230>] sysfs_write_file+0x28/0x140
       #1:  (s_active#13){++++.+}, at: [<c01a22f0>] sysfs_write_file+0xe8/0x140
      
      stack backtrace:
      [<c0014fcc>] (unwind_backtrace+0x0/0x120) from [<c00ca600>] (validate_chain+0x6f8/0x1054)
      [<c00ca600>] (validate_chain+0x6f8/0x1054) from [<c00cb778>] (__lock_acquire+0x81c/0x8d8)
      [<c00cb778>] (__lock_acquire+0x81c/0x8d8) from [<c00cb9c0>] (lock_acquire+0x18c/0x1e8)
      [<c00cb9c0>] (lock_acquire+0x18c/0x1e8) from [<c01a3ba8>] (sysfs_addrm_finish+0xd0/0x180)
      [<c01a3ba8>] (sysfs_addrm_finish+0xd0/0x180) from [<c01a3d28>] (sysfs_remove_dir+0x9c/0xb4)
      [<c01a3d28>] (sysfs_remove_dir+0x9c/0xb4) from [<c02d0e5c>] (kobject_del+0x10/0x38)
      [<c02d0e5c>] (kobject_del+0x10/0x38) from [<c02d0f74>] (kobject_release+0xf0/0x194)
      [<c02d0f74>] (kobject_release+0xf0/0x194) from [<c0565a98>] (cpufreq_cpu_put+0xc/0x24)
      [<c0565a98>] (cpufreq_cpu_put+0xc/0x24) from [<c05683f0>] (store+0x6c/0x74)
      [<c05683f0>] (store+0x6c/0x74) from [<c01a2314>] (sysfs_write_file+0x10c/0x140)
      [<c01a2314>] (sysfs_write_file+0x10c/0x140) from [<c014af44>] (vfs_write+0xb0/0x128)
      [<c014af44>] (vfs_write+0xb0/0x128) from [<c014b06c>] (sys_write+0x3c/0x68)
      [<c014b06c>] (sys_write+0x3c/0x68) from [<c000e0e0>] (ret_fast_syscall+0x0/0x3c)
      
      This is because store() in cpufreq.c indirectly calls
      kobject_get() via cpufreq_cpu_get() and is the last one to call
      kobject_put() via cpufreq_cpu_put(). Sysfs code should not call
      kobject_get() or kobject_put() directly (see the comment around
      sysfs_schedule_callback() for more information).
      
      Fix this deadlock by introducing two new functions:
      
      	struct cpufreq_policy *cpufreq_cpu_get_sysfs(unsigned int cpu)
      	void cpufreq_cpu_put_sysfs(struct cpufreq_policy *data)
      
      which do the same thing as cpufreq_cpu_{get,put}() but don't call
      kobject functions.
      
      To easily trigger this deadlock you can insert an msleep() with a
      reasonably large value right after the fail label at the bottom
      of the store() function in cpufreq.c and then write
      scaling_setspeed in one task and offline the cpu in another. The
      first task will hang and be detected by the hung task detector.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      a9144436
  9. 21 3月, 2012 1 次提交
  10. 15 3月, 2012 1 次提交
  11. 06 1月, 2012 1 次提交
    • A
      [CPUFREQ] update lpj only if frequency has changed · d08de0c1
      Afzal Mohammed 提交于
      During scaling up of cpu frequency, loops_per_jiffy
      is updated upon invoking PRECHANGE notifier.
      If setting to new frequency fails in cpufreq driver,
      lpj is left at incorrect value.
      
      Hence update lpj only if cpu frequency is changed,
      i.e. upon invoking POSTCHANGE notifier.
      
      Penalty would be that during time period between
      changing cpu frequency & invocation of POSTCHANGE
      notifier, udelay(x) may not gurantee minimal delay
      of 'x' us for frequency scaling up operation.
      
      Perhaps a better solution would be to define
      CPUFREQ_ABORTCHANGE & handle accordingly, but then
      it would be more intrusive (using ABORTCHANGE may
      help drivers also; if any has registered notifier
      and expect POST for a PRECHANGE, their needs can
      be taken care using ABORT)
      Signed-off-by: NAfzal Mohammed <afzal@ti.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      d08de0c1
  12. 22 12月, 2011 1 次提交
    • K
      cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem · 8a25a2fd
      Kay Sievers 提交于
      This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem
      and converts the devices to regular devices. The sysdev drivers are
      implemented as subsystem interfaces now.
      
      After all sysdev classes are ported to regular driver core entities, the
      sysdev implementation will be entirely removed from the kernel.
      
      Userspace relies on events and generic sysfs subsystem infrastructure
      from sysdev devices, which are made available with this conversion.
      
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Borislav Petkov <bp@amd64.org>
      Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8a25a2fd
  13. 29 6月, 2011 1 次提交
  14. 04 5月, 2011 3 次提交
    • K
      [CPUFREQ] remove redundant sprintf from request_module call. · 1a8e1463
      Kees Cook 提交于
      Since format string handling is part of request_module, there is no
      need to construct the module name. As such, drop the redundant sprintf
      and heap usage.
      Signed-off-by: NKees Cook <kees.cook@canonical.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      1a8e1463
    • D
      [CPUFREQ] use dynamic debug instead of custom infrastructure · 2d06d8c4
      Dominik Brodowski 提交于
      With dynamic debug having gained the capability to report debug messages
      also during the boot process, it offers a far superior interface for
      debug messages than the custom cpufreq infrastructure. As a first step,
      remove the old cpufreq_debug_printk() function and replace it with a call
      to the generic pr_debug() function.
      
      How can dynamic debug be used on cpufreq? You need a kernel which has
      CONFIG_DYNAMIC_DEBUG enabled.
      
      To enabled debugging during runtime, mount debugfs and
      
      $ echo -n 'module cpufreq +p' > /sys/kernel/debug/dynamic_debug/control
      
      for debugging the complete "cpufreq" module. To achieve the same goal during
      boot, append
      
      	ddebug_query="module cpufreq +p"
      
      as a boot parameter to the kernel of your choice.
      
      For more detailled instructions, please see
      Documentation/dynamic-debug-howto.txt
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NDave Jones <davej@redhat.com>
      2d06d8c4
    • J
      [CPUFREQ] CPU hotplug, re-create sysfs directory and symlinks · 27ecddc2
      Jacob Shin 提交于
      When we discover CPUs that are affected by each other's
      frequency/voltage transitions, the first CPU gets a sysfs directory
      created, and rest of the siblings get symlinks. Currently, when we
      hotplug off only the first CPU, all of the symlinks and the sysfs
      directory gets removed. Even though rest of the siblings are still
      online and functional, they are orphaned, and no longer governed by
      cpufreq.
      
      This patch, given the above scenario, creates a sysfs directory for
      the first sibling and symlinks for the rest of the siblings.
      
      Please note the recursive call, it was rather too ugly to roll it
      out. And the removal of redundant NULL setting (it is already taken
      care of near the top of the function).
      Signed-off-by: NJacob Shin <jacob.shin@amd.com>
      Acked-by: NMark Langsdorf <mark.langsdorf@amd.com>
      Reviewed-by: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NDave Jones <davej@redhat.com>
      Cc: stable@kernel.org
      27ecddc2