1. 26 5月, 2009 1 次提交
  2. 22 5月, 2009 1 次提交
    • P
      perf_counter: Dynamically allocate tasks' perf_counter_context struct · a63eaf34
      Paul Mackerras 提交于
      This replaces the struct perf_counter_context in the task_struct with
      a pointer to a dynamically allocated perf_counter_context struct.  The
      main reason for doing is this is to allow us to transfer a
      perf_counter_context from one task to another when we do lazy PMU
      switching in a later patch.
      
      This has a few side-benefits: the task_struct becomes a little smaller,
      we save some memory because only tasks that have perf_counters attached
      get a perf_counter_context allocated for them, and we can remove the
      inclusion of <linux/perf_counter.h> in sched.h, meaning that we don't
      end up recompiling nearly everything whenever perf_counter.h changes.
      
      The perf_counter_context structures are reference-counted and freed
      when the last reference is dropped.  A context can have references
      from its task and the counters on its task.  Counters can outlive the
      task so it is possible that a context will be freed well after its
      task has exited.
      
      Contexts are allocated on fork if the parent had a context, or
      otherwise the first time that a per-task counter is created on a task.
      In the latter case, we set the context pointer in the task struct
      locklessly using an atomic compare-and-exchange operation in case we
      raced with some other task in creating a context for the subject task.
      
      This also removes the task pointer from the perf_counter struct.  The
      task pointer was not used anywhere and would make it harder to move a
      context from one task to another.  Anything that needed to know which
      task a counter was attached to was already using counter->ctx->task.
      
      The __perf_counter_init_context function moves up in perf_counter.c
      so that it can be called from find_get_context, and now initializes
      the refcount, but is otherwise unchanged.
      
      We were potentially calling list_del_counter twice: once from
      __perf_counter_exit_task when the task exits and once from
      __perf_counter_remove_from_context when the counter's fd gets closed.
      This adds a check in list_del_counter so it doesn't do anything if
      the counter has already been removed from the lists.
      
      Since perf_counter_task_sched_in doesn't do anything if the task doesn't
      have a context, and leaves cpuctx->task_ctx = NULL, this adds code to
      __perf_install_in_context to set cpuctx->task_ctx if necessary, i.e. in
      the case where the current task adds the first counter to itself and
      thus creates a context for itself.
      
      This also adds similar code to __perf_counter_enable to handle a
      similar situation which can arise when the counters have been disabled
      using prctl; that also leaves cpuctx->task_ctx = NULL.
      
      [ Impact: refactor counter context management to prepare for new feature ]
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <18966.10075.781053.231153@cargo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a63eaf34
  3. 08 4月, 2009 1 次提交
  4. 04 4月, 2009 1 次提交
  5. 18 3月, 2009 2 次提交
  6. 23 2月, 2009 2 次提交
    • I
      x86: refactor x86_quirks support · 8e6dafd6
      Ingo Molnar 提交于
      Impact: cleanup
      
      Make x86_quirks support more transparent. The highlevel
      methods are now named:
      
        extern void x86_quirk_pre_intr_init(void);
        extern void x86_quirk_intr_init(void);
      
        extern void x86_quirk_trap_init(void);
      
        extern void x86_quirk_pre_time_init(void);
        extern void x86_quirk_time_init(void);
      
      This makes it clear that if some platform extension has to
      do something here that it is considered ... weird, and is
      discouraged.
      
      Also remove arch_hooks.h and move it into setup.h (and other
      header files where appropriate).
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8e6dafd6
    • S
      x86: select x2apic ops in early apic probe only if x2apic mode is enabled · ef1f87aa
      Suresh Siddha 提交于
      If BIOS hands over the control to OS in legacy xapic mode, select
      legacy xapic related ops in the early apic probe and shift to x2apic
      ops later in the boot sequence, only after enabling x2apic mode.
      
      If BIOS hands over the control in x2apic mode, select x2apic related
      ops in the early apic probe.
      
      This fixes the early boot panic, where we were selecting x2apic ops,
      while the cpu is still in legacy xapic mode.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ef1f87aa
  7. 18 2月, 2009 3 次提交
  8. 17 2月, 2009 2 次提交
  9. 16 2月, 2009 1 次提交
  10. 15 2月, 2009 1 次提交
  11. 06 2月, 2009 2 次提交
  12. 04 2月, 2009 1 次提交
  13. 31 1月, 2009 3 次提交
  14. 30 1月, 2009 2 次提交
    • Y
      x86: unify PM-Timer messages · 39ba5d43
      Yasuaki Ishimatsu 提交于
      Impact: Cleans up printk formatting
      
      When LOCAL APIC was calibrated, the debug message is displayed as follows.
      
      	CPU0: Intel(R) Xeon(R) CPU            5110  @ 1.60GHz stepping 06
      	Using local APIC timer interrupts.
      	calibrating APIC timer ...
      	... lapic delta = 3773131
      	... PM timer delta = 812434
      	APIC calibration not consistent with PM Timer: 226ms instead of 100ms
      	APIC delta adjusted to PM-Timer: 1662420 (3773131)
      	TSC delta adjusted to PM-Timer: 159592409 (362220564)
      	..... delta 1662420
      	..... mult: 71411249
      	..... calibration result: 265987
      	..... CPU clock speed is 1595.0924 MHz.
      	..... host bus clock speed is 265.0987 MHz.
      
      There are three type of PM-Timer (PM-Timer, PM Timer, and PM timer),
      in this message. This patch unifies those messages to PM-Timer.
      Signed-off-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      39ba5d43
    • Y
      x86: fix debug message of CPU clock speed · 754ef0cd
      Yasuaki Ishimatsu 提交于
      Impact: Fixes incorrect printk
      
      LOCAL APIC is corrected by PM-Timer, when SMI occurred while LOCAL APIC is calibrated.
      In this case, LOCAL APIC debug message(Boot with apic=debug) is displayed correctly,
      however, CPU clock speed debug message is displayed wrongly .
      
      When SMI occured on my machine, which has 1.6GHz CPU, CPU clock speed is displayed
      3622.0205 MHz as follow.
      
      	CPU0: Intel(R) Xeon(R) CPU            5110  @ 1.60GHz stepping 06
      	Using local APIC timer interrupts.
      	calibrating APIC timer ...
      	... lapic delta = 3773130
      	... PM timer delta = 812434
      	APIC calibration not consistent with PM Timer: 226ms instead of 100ms
      	APIC delta adjusted to PM-Timer: 1662420 (3773130)
      	..... delta 1662420
      	..... mult: 71411249
      	..... calibration result: 265987
      	..... CPU clock speed is 3622.0205 MHz.  =====>  here
      	..... host bus clock speed is 265.0987 MHz.
      
      This patch fixes to displaying CPU clock speed correctly as follow.
      
      	CPU0: Intel(R) Xeon(R) CPU            5110  @ 1.60GHz stepping 06
      	Using local APIC timer interrupts.
      	calibrating APIC timer ...
      	... lapic delta = 3773131
      	... PM timer delta = 812434
      	APIC calibration not consistent with PM Timer: 226ms instead of 100ms
      	APIC delta adjusted to PM-Timer: 1662420 (3773131)
      	TSC delta adjusted to PM-Timer: 159592409 (362220564)
      	..... delta 1662420
      	..... mult: 71411249
      	..... calibration result: 265987
      	..... CPU clock speed is 1595.0924 MHz.
      	..... host bus clock speed is 265.0987 MHz.
      Signed-off-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      754ef0cd
  15. 29 1月, 2009 12 次提交
  16. 27 1月, 2009 1 次提交
  17. 23 1月, 2009 1 次提交
  18. 20 1月, 2009 1 次提交
  19. 19 1月, 2009 1 次提交
    • M
      x86: put trigger in to detect mismatched apic versions · b2b815d8
      Mike Travis 提交于
      Impact: add debug warning
      
      Fire off one message if two apic's discovered with different
      apic versions. (this code is only called during CPU init)
      
      The goal of this is to pave the way of the removal of the apic_version[]
      array. We dont expect any apic version incompatibilities in the x86
      landscape of systems [if so we dont handle them very well and probably
      never will handle deep apic version assymetries well], but it's prudent
      to have a debug check for one kernel cycle nevertheless.
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b2b815d8
  20. 17 1月, 2009 1 次提交