1. 08 Sep, 2008 24 commits
  2. 07 Sep, 2008 5 commits
  3. 06 Sep, 2008 11 commits
    • Ingo Molnar's avatar
      291c54ff
    • Andreas Herrmann's avatar
      x86: cpu_init(): fix memory leak when using CPU hotplug · 23952a96
      Andreas Herrmann authored
      Exception stacks are allocated each time a CPU is set online.
      But the allocated space is never freed. Thus with one CPU hotplug
      offline/online cycle there is a memory leak of 24K (6 pages) for
      a CPU.
      
      Fix is to allocate exception stacks only once -- when the CPU is
      set online for the first time.
      Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
      Cc: akpm@linux-foundation.org
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      23952a96
    • Andreas Herrmann's avatar
      x86: pda_init(): fix memory leak when using CPU hotplug · d04ec773
      Andreas Herrmann authored
      pda->irqstackptr is allocated whenever a CPU is set online.
      But it is never freed. This results in a memory leak of 16K
      for each CPU offline/online cycle.
      
      Fix is to allocate pda->irqstackptr only once.
      Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
      Cc: akpm@linux-foundation.org
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d04ec773
    • Eduardo Habkost's avatar
      x86, xen: Use native_pte_flags instead of native_pte_val for .pte_flags · e4a6be4d
      Eduardo Habkost authored
      Using native_pte_val triggers the BUG_ON() in the paravirt_ops
      version of pte_flags().
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Acked-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e4a6be4d
    • Max Krasnyansky's avatar
      sched: arch_reinit_sched_domains() must destroy domains to force rebuild · dfb512ec
      Max Krasnyansky authored
      What I realized recently is that calling rebuild_sched_domains() in
      arch_reinit_sched_domains() by itself is not enough when cpusets are enabled.
      partition_sched_domains() code is trying to avoid unnecessary domain rebuilds
      and will not actually rebuild anything if new domain masks match the old ones.
      
      What this means is that doing
           echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
      on a system with cpusets enabled will not take affect untill something changes
      in the cpuset setup (ie new sets created or deleted).
      
      This patch fixes restore correct behaviour where domains must be rebuilt in
      order to enable MC powersaving flags.
      
      Test on quad-core Core2 box with both CONFIG_CPUSETS and !CONFIG_CPUSETS.
      Also tested on dual-core Core2 laptop. Lockdep is happy and things are working
      as expected.
      Signed-off-by: default avatarMax Krasnyansky <maxk@qualcomm.com>
      Tested-by: default avatarVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      dfb512ec
    • Yinghai Lu's avatar
      x86: move mtrr cpu cap setting early in early_init_xxxx · dd786dd1
      Yinghai Lu authored
      Krzysztof Helt found MTRR is not detected on k6-2
      
      root cause:
      	we moved mtrr_bp_init() early for mtrr trimming,
      and in early_detect we only read the CPU capability from cpuid,
      so some cpu doesn't have that bit in cpuid.
      
      So we need to add early_init_xxxx to preset those bit before mtrr_bp_init
      for those earlier cpus.
      
      this patch is for v2.6.27
      Reported-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
      Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      dd786dd1
    • Krzysztof Helt's avatar
      x86: delay early cpu initialization until cpuid is done · 12cf105c
      Krzysztof Helt authored
      Move early cpu initialization after cpu early get cap so the
      early cpu initialization can fix up cpu caps.
      Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
      Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      12cf105c
    • Dominik Brodowski's avatar
      clocksource, acpi_pm.c: check for monotonicity · 4ab6a219
      Dominik Brodowski authored
      The current check for monotonicity is way too weak: Andreas Mohr reports (
      http://lkml.org/lkml/2008/8/10/77 ) that on one of his test systems the
      current check only triggers in 50% of all cases, leading to catastrophic
      timer behaviour.  To fix this issue, expand the check for monotonicity by
      doing ten consecutive tests instead of one.
      Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4ab6a219
    • Dominik Brodowski's avatar
      clocksource, acpi_pm.c: use proper read function also in errata mode · dfdf748a
      Dominik Brodowski authored
      On all hardware (some Intel ICH4, PIIX4 and PIIX4E chipsets) affected by a
      hardware errata there's about a 4.2% chance that initialization of the
      ACPI PMTMR fails.  On those chipsets, we need to read out the timer value
      at least three times to get a correct result, for every once in a while
      (i.e.  within a 3 ns window every 69.8 ns) the read returns a bogus
      result.  During normal operation we work around this issue, but during
      initialization reading a bogus value may lead to -EINVAL even though the
      hardware is usable.
      
      Thanks to Andreas Mohr for spotting this issue.
      Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      dfdf748a
    • Maciej W. Rozycki's avatar
      ntp: fix calculation of the next jiffie to trigger RTC sync · 4ff4b9e1
      Maciej W. Rozycki authored
      We have a bug in the calculation of the next jiffie to trigger the RTC
      synchronisation.  The aim here is to run sync_cmos_clock() as close as
      possible to the middle of a second.  Which means we want this function to
      be called less than or equal to half a jiffie away from when now.tv_nsec
      equals 5e8 (500000000).
      
      If this is not the case for a given call to the function, for this purpose
      instead of updating the RTC we calculate the offset in nanoseconds to the
      next point in time where now.tv_nsec will be equal 5e8.  The calculated
      offset is then converted to jiffies as these are the unit used by the
      timer.
      
      Hovewer timespec_to_jiffies() used here uses a ceil()-type rounding mode,
      where the resulting value is rounded up.  As a result the range of
      now.tv_nsec when the timer will trigger is from 5e8 to 5e8 + TICK_NSEC
      rather than the desired 5e8 - TICK_NSEC / 2 to 5e8 + TICK_NSEC / 2.
      
      As a result if for example sync_cmos_clock() happens to be called at the
      time when now.tv_nsec is between 5e8 + TICK_NSEC / 2 and 5e8 to 5e8 +
      TICK_NSEC, it will simply be rescheduled HZ jiffies later, falling in the
      same range of now.tv_nsec again.  Similarly for cases offsetted by an
      integer multiple of TICK_NSEC.
      
      This change addresses the problem by subtracting TICK_NSEC / 2 from the
      nanosecond offset to the next point in time where now.tv_nsec will be
      equal 5e8, effectively shifting the following rounding in
      timespec_to_jiffies() so that it produces a rounded-to-nearest result.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4ff4b9e1
    • Lennert Buytenhek's avatar
      [ARM] 5241/1: provide ioremap_wc() · 1ad77a87
      Lennert Buytenhek authored
      This patch provides an ARM implementation of ioremap_wc().
      
      We use different page table attributes depending on which CPU we
      are running on:
      
      - Non-XScale ARMv5 and earlier systems: The ARMv5 ARM documents four
        possible mapping types (CB=00/01/10/11).  We can't use any of the
        cached memory types (CB=10/11), since that breaks coherency with
        peripheral devices.  Both CB=00 and CB=01 are suitable for _wc, and
        CB=01 (Uncached/Buffered) allows the hardware more freedom than
        CB=00, so we'll use that.
      
        (The ARMv5 ARM seems to suggest that CB=01 is allowed to delay stores
        but isn't allowed to merge them, but there is no other mapping type
        we can use that allows the hardware to delay and merge stores, so
        we'll go with CB=01.)
      
      - XScale v1/v2 (ARMv5): same as the ARMv5 case above, with the slight
        difference that on these platforms, CB=01 actually _does_ allow
        merging stores.  (If you want noncoalescing bufferable behavior
        on Xscale v1/v2, you need to use XCB=101.)
      
      - Xscale v3 (ARMv5) and ARMv6+: on these systems, we use TEXCB=00100
        mappings (Inner/Outer Uncacheable in xsc3 parlance, Uncached Normal
        in ARMv6 parlance).
      
        The ARMv6 ARM explicitly says that any accesses to Normal memory can
        be merged, which makes Normal memory more suitable for _wc mappings
        than Device or Strongly Ordered memory, as the latter two mapping
        types are guaranteed to maintain transaction number, size and order.
        We use the Uncached variety of Normal mappings for the same reason
        that we can't use C=1 mappings on ARMv5.
      
        The xsc3 Architecture Specification documents TEXCB=00100 as being
        Uncacheable and allowing coalescing of writes, which is also just
        what we need.
      Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      1ad77a87