1. 20 4月, 2009 2 次提交
    • T
      acpi-cpufreq: Cleanup: Use printk_once · e0e8c4e5
      Thomas Renninger 提交于
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      e0e8c4e5
    • P
      x86, acpi_cpufreq: Fix the NULL pointer dereference in get_measured_perf · 093f13e2
      Pallipadi, Venkatesh 提交于
      Fix for a regression that was introduced by earlier commit
      18b2646f on Mon Apr 6 11:26:08 2009
      
      Regression resulted in the below error happened on systems with
      software coordination where per_cpu acpi data will not be initiated for
      secondary CPUs in a P-state domain.
      
      On Tue, 2009-04-14 at 23:01 -0700, Zhang, Yanmin wrote:
       My machine hanged with kernel 2.6.30-rc2 when script read
      > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor.
      >
      > opps happens in get_measured_perf:
      >
      >         cur.aperf.whole = readin.aperf.whole -
      >                                 per_cpu(drv_data, cpu)->saved_aperf;
      >
      > Because per_cpu(drv_data, cpu)=NULL.
      >
      > So function get_measured_perf should check if (per_cpu(drv_data,
      > cpu)==NULL)
      > and return 0 if it's NULL.
      
      --------------sys log------------------
      
      BUG: unable to handle kernel NULL pointer dereference at
      0000000000000020
      IP: [<ffffffff8021af75>] get_measured_perf+0x4a/0xf9
      PGD a7dd88067 PUD a7ccf5067 PMD 0
      Oops: 0000 [#1] SMP
      last sysfs file: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      CPU 0
      Modules linked in: video output
      Pid: 2091, comm: kondemand/0 Not tainted 2.6.30-rc2 #1 MP Server
      RIP: 0010:[<ffffffff8021af75>]  [<ffffffff8021af75>]
      get_measured_perf+0x4a/0xf9
      RSP: 0018:ffff880a7d56de20  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: 00000046241a42b6 RCX: ffff88004d219000
      RDX: 000000000000b660 RSI: 0000000000000020 RDI: 0000000000000001
      RBP: ffff880a7f052000 R08: 00000046241a42b6 R09: ffffffff807639f0
      R10: 00000000ffffffea R11: ffffffff802207f4 R12: ffff880a7f052000
      R13: ffff88004d20e460 R14: 0000000000ddd5a6 R15: 0000000000000001
      FS:  0000000000000000(0000) GS:ffff88004d200000(0000)
      knlGS:0000000000000000
      CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
      CR2: 0000000000000020 CR3: 0000000a7f1bf000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process kondemand/0 (pid: 2091, threadinfo ffff880a7d56c000, task
      ffff880a7d4d18c0)
      Stack:
       ffff880a7f052078 ffffffff803efd54 00000046241a42b6 000000462ffa9e95
       0000000000000001 0000000000000001 00000000ffffffea ffffffff8064f41a
       0000000000000012 0000000000000012 ffff880a7f052000 ffffffff80650547
      Call Trace:
       [<ffffffff803efd54>] ? kobject_get+0x12/0x17
       [<ffffffff8064f41a>] ? __cpufreq_driver_getavg+0x42/0x57
       [<ffffffff80650547>] ? do_dbs_timer+0x147/0x272
       [<ffffffff80650400>] ? do_dbs_timer+0x0/0x272
       [<ffffffff802474ca>] ? worker_thread+0x15b/0x1f5
       [<ffffffff8024a02c>] ? autoremove_wake_function+0x0/0x2e
       [<ffffffff8024736f>] ? worker_thread+0x0/0x1f5
       [<ffffffff80249f0d>] ? kthread+0x54/0x83
       [<ffffffff8020c87a>] ? child_rip+0xa/0x20
       [<ffffffff80249eb9>] ? kthread+0x0/0x83
       [<ffffffff8020c870>] ? child_rip+0x0/0x20
      Code: 99 a6 03 00 31 c9 85 c0 0f 85 c3 00 00 00 89 df 4c 8b 44 24 10 48
      c7 c2 60 b6 00 00 48 8b 0c fd e0 30 a5 80 4c 89 c3 48 8b 04 0a <48> 2b
      58 20 48 8b 44 24 18 48 89 1c 24 48 8b 34 0a 48 2b 46 28
      RIP  [<ffffffff8021af75>] get_measured_perf+0x4a/0xf9
       RSP <ffff880a7d56de20>
      CR2: 0000000000000020
      ---[ end trace 2b8fac9a49e19ad4 ]---
      Tested-by: N"Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      093f13e2
  2. 15 4月, 2009 1 次提交
    • L
      acpi-cpufreq: fix 'smp_call_function_many()' confusion · ea34f43a
      Linus Torvalds 提交于
      It turns out that 'smp_call_function_many()' doesn't work at all like
      'smp_call_function_single()', and my change to Andrew's patch to use it
      rather than a loop over all CPU's acpi-cpufreq doesn't work.
      
      My bad.
      
      'smp_call_function_many()' has two "features" (aka "documented bugs"):
      
       (a) it needs to be called with preemption disabled, because it uses
           smp_processor_id() without guarding the CPU lookup with 'get_cpu()'
           and 'put_cpu()' like the 'single' variant does.
      
       (b) even if the current CPU is part of the CPU mask, it won't do the
           call on that CPU.
      
      Still, we're better off trying to use 'smp_call_function_many()' than
      looping over CPU's, since it at least in theory allows us to use a
      broadcast IPI and do it all in parallel.  So let's just work around the
      silly semantic bugs in that function.
      Reported-and-tested-by: NAli Gholami Rudi <ali@rudi.ir>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>,
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Dave Jones <davej@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ea34f43a
  3. 14 4月, 2009 2 次提交
  4. 08 4月, 2009 2 次提交
  5. 28 3月, 2009 1 次提交
    • P
      ACPI: cap off P-state transition latency from buggy BIOSes · a59d1637
      Pallipadi, Venkatesh 提交于
      Some BIOSes report very high frequency transition latency which are plainly
      wrong on CPus that can change frequency using native MSR interface.
      
      One such system is IBM T42 (2327-8ZU) as reported by Owen Taylor and
      Rik van Riel.
      
      cpufreq_ondemand driver uses this transition latency to come up with a
      reasonable sampling interval to sample CPU usage and with such high
      latency value, ondemand sampling interval ends up being very high
      (0.5 sec, in this particular case), resulting in performance impact due to
      slow response to increasing frequency.
      
      Fix it by capping-off the transition latency to 20uS for native MSR based
      frequency transitions.
      
      mjg: We've confirmed that this also helps on the X31
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Acked-by: NMatthew Garrett <mjg@redhat.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      a59d1637
  6. 25 2月, 2009 1 次提交
  7. 20 2月, 2009 1 次提交
  8. 13 2月, 2009 1 次提交
  9. 09 2月, 2009 1 次提交
  10. 20 1月, 2009 2 次提交
  11. 17 1月, 2009 1 次提交
  12. 15 1月, 2009 1 次提交
    • I
      fix: crash: IP: __bitmap_intersects+0x48/0x73 · 5cd73762
      Ingo Molnar 提交于
      -tip testing found this crash:
      
      > [   35.258515] calling  acpi_cpufreq_init+0x0/0x127 @ 1
      > [   35.264127] BUG: unable to handle kernel NULL pointer dereference at (null)
      > [   35.267554] IP: [<ffffffff80478092>] __bitmap_intersects+0x48/0x73
      > [   35.267554] PGD 0
      > [   35.267554] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
      
      arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c is still broken: there's no
      allocation of the variable mask, so we pass in an uninitialized cmd.mask
      field to drv_read(), which then passes it to the scheduler which then
      crashes ...
      
      Switch it over to the much simpler constant-cpumask-pointers approach.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5cd73762
  13. 13 1月, 2009 2 次提交
    • I
      x86, cpufreq: remove leftover copymask_copy() · 4a922a96
      Ingo Molnar 提交于
      Impact: fix potential boot crash on MAXSMP
      
      Remove code left over by:
      
        50c668d6: Revert "cpumask: use work_on_cpu in acpi-cpufreq.c for drv_read
      
      That cmd.cpumask is not allocated anymore. No impact on default !MAXSMP
      kernels.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4a922a96
    • I
      Revert "cpumask: use work_on_cpu in acpi-cpufreq.c for drv_read and drv_write" · 50c668d6
      Ingo Molnar 提交于
      This reverts commit 7503bfba.
      
      Dieter Ries reported bootup soft-hangs and bisected it back to
      this commit, and reverting this commit gave him a working system.
      
      The commit introduces work_on_cpu() use into the cpufreq code,
      but that is subtly problematic from a lock hierarchy POV: the
      hotplug-cpu lock is an highlevel lock that is taken before
      lowlevel locks, and in this codepath we are called with the
      policy lock taken.
      
      Dieter did not have lockdep enabled so we dont have a nice stack
      trace proof for this, but using work_on_cpu() in such a lowlevel
      place certainly looks wrong, so we revert the patch.
      
      work_on_cpu() needs to be reworked to be more generally usable.
      Reported-by: NDieter Ries <clip2@gmx.de>
      Tested-by: NDieter Ries <clip2@gmx.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      50c668d6
  14. 06 1月, 2009 4 次提交
  15. 04 1月, 2009 2 次提交
  16. 26 11月, 2008 1 次提交
    • A
      tracing: add "power-tracer": C/P state tracer to help power optimization · f3f47a67
      Arjan van de Ven 提交于
      Impact: new "power-tracer" ftrace plugin
      
      This patch adds a C/P-state ftrace plugin that will generate
      detailed statistics about the C/P-states that are being used,
      so that we can look at detailed decisions that the C/P-state
      code is making, rather than the too high level "average"
      that we have today.
      
      An example way of using this is:
      
       mount -t debugfs none /sys/kernel/debug
       echo cstate > /sys/kernel/debug/tracing/current_tracer
       echo 1 > /sys/kernel/debug/tracing/tracing_enabled
       sleep 1
       echo 0 > /sys/kernel/debug/tracing/tracing_enabled
       cat /sys/kernel/debug/tracing/trace | perl scripts/trace/cstate.pl > out.svg
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f3f47a67
  17. 11 10月, 2008 1 次提交
  18. 10 10月, 2008 2 次提交
  19. 26 7月, 2008 1 次提交
  20. 19 7月, 2008 1 次提交
    • M
      cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr · 65c01184
      Mike Travis 提交于
        * This patch replaces the dangerous lvalue version of cpumask_of_cpu
          with new cpumask_of_cpu_ptr macros.  These are patterned after the
          node_to_cpumask_ptr macros.
      
          In general terms, if there is a cpumask_of_cpu_map[] then a pointer to
          the cpumask_of_cpu_map[cpu] entry is used.  The cpumask_of_cpu_map
          is provided when there is a large NR_CPUS count, reducing
          greatly the amount of code generated and stack space used for
          cpumask_of_cpu().  The pointer to the cpumask_t value is needed for
          calling set_cpus_allowed_ptr() to reduce the amount of stack space
          needed to pass the cpumask_t value.
      
          If there isn't a cpumask_of_cpu_map[], then a temporary variable is
          declared and filled in with value from cpumask_of_cpu(cpu) as well as
          a pointer variable pointing to this temporary variable.  Afterwards,
          the pointer is used to reference the cpumask value.  The compiler
          will optimize out the extra dereference through the pointer as well
          as the stack space used for the pointer, resulting in identical code.
      
          A good example of the orthogonal usages is in net/sunrpc/svc.c:
      
      	case SVC_POOL_PERCPU:
      	{
      		unsigned int cpu = m->pool_to[pidx];
      		cpumask_of_cpu_ptr(cpumask, cpu);
      
      		*oldmask = current->cpus_allowed;
      		set_cpus_allowed_ptr(current, cpumask);
      		return 1;
      	}
      	case SVC_POOL_PERNODE:
      	{
      		unsigned int node = m->pool_to[pidx];
      		node_to_cpumask_ptr(nodecpumask, node);
      
      		*oldmask = current->cpus_allowed;
      		set_cpus_allowed_ptr(current, nodecpumask);
      		return 1;
      	}
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      65c01184
  21. 24 5月, 2008 1 次提交
  22. 29 4月, 2008 2 次提交
  23. 20 4月, 2008 1 次提交
    • M
      x86: use new set_cpus_allowed_ptr function · fc0e4748
      Mike Travis 提交于
        * Use new set_cpus_allowed_ptr() function added by previous patch,
          which instead of passing the "newly allowed cpus" cpumask_t arg
          by value,  pass it by pointer:
      
          -int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
          +int set_cpus_allowed_ptr(struct task_struct *p, const cpumask_t *new_mask)
      
        * Cleanup uses of CPU_MASK_ALL.
      
        * Collapse other NR_CPUS changes to arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
          Use pointers to cpumask_t arguments whenever possible.
      
      Depends on:
      	[sched-devel]: sched: add new set_cpus_allowed_ptr function
      
      Cc: Len Brown <len.brown@intel.com>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fc0e4748
  24. 30 1月, 2008 1 次提交
  25. 20 10月, 2007 1 次提交
    • M
      x86: convert cpuinfo_x86 array to a per_cpu array · 92cb7612
      Mike Travis 提交于
      cpu_data is currently an array defined using NR_CPUS.  This means that
      we overallocate since we will rarely really use maximum configured cpus.
      When NR_CPU count is raised to 4096 the size of cpu_data becomes
      3,145,728 bytes.
      
      These changes were adopted from the sparc64 (and ia64) code.  An
      additional field was added to cpuinfo_x86 to be a non-ambiguous cpu
      index.  This corresponds to the index into a cpumask_t as well as the
      per_cpu index.  It's used in various places like show_cpuinfo().
      
      cpu_data is defined to be the boot_cpu_data structure for the NON-SMP
      case.
      Signed-off-by: NMike Travis <travis@sgi.com>
      Acked-by: NChristoph Lameter <clameter@sgi.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Cc: Dmitry Torokhov <dtor@mail.ru>
      Cc: "Antonino A. Daplas" <adaplas@pol.net>
      Cc: Mark M. Hoffman <mhoffman@lightlink.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      92cb7612
  26. 17 10月, 2007 1 次提交
    • M
      x86: Convert cpu_core_map to be a per cpu variable · 08357611
      Mike Travis 提交于
      This is from an earlier message from 'Christoph Lameter':
      
          cpu_core_map is currently an array defined using NR_CPUS. This means that
          we overallocate since we will rarely really use maximum configured cpu.
      
          If we put the cpu_core_map into the per cpu area then it will be allocated
          for each processor as it comes online.
      
          This means that the core map cannot be accessed until the per cpu area
          has been allocated. Xen does a weird thing here looping over all processors
          and zeroing the masks that are not yet allocated and that will be zeroed
          when they are allocated. I commented the code out.
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Christoph Lameter <clameter@sgi.com>
      Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      08357611
  27. 11 10月, 2007 1 次提交
  28. 10 10月, 2007 1 次提交
    • J
      drivers/firmware: const-ify DMI API and internals · 1855256c
      Jeff Garzik 提交于
      Three main sets of changes:
      
      1) dmi_get_system_info() return value should have been marked const,
         since callers should not be changing that data.
      
      2) const-ify DMI internals, since DMI firmware tables should,
         whenever possible, be marked const to ensure we never ever write to
         that data area.
      
      3) const-ify DMI API, to enable marking tables const where possible
         in low-level drivers.
      
      And if we're really lucky, this might enable some additional
      optimizations on the part of the compiler.
      
      The bulk of the changes are #2 and #3, which are interrelated.  #1 could
      have been a separate patch, but it was so small compared to the others,
      it was easier to roll it into this changeset.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      1855256c
  29. 05 10月, 2007 1 次提交