24 Sep, 2009

1 commit


23 Sep, 2009

1 commit

  • Some 64bit arch has special segment for mapping kernel text. It should be
    entried to /proc/kcore in addtion to direct-linear-map, vmalloc area.
    This patch unifies KCORE_TEXT entry scattered under x86 and ia64.

    I'm not familiar with other archs (mips has its own even after this patch)
    but range of [_stext ..._end) is a valid area of text and it's not in
    direct-map area, defining CONFIG_ARCH_PROC_KCORE_TEXT is only a necessary
    thing to do.

    Note: I left mips as it is now.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     

21 Sep, 2009

1 commit

  • Bye-bye Performance Counters, welcome Performance Events!

    In the past few months the perfcounters subsystem has grown out its
    initial role of counting hardware events, and has become (and is
    becoming) a much broader generic event enumeration, reporting, logging,
    monitoring, analysis facility.

    Naming its core object 'perf_counter' and naming the subsystem
    'perfcounters' has become more and more of a misnomer. With pending
    code like hw-breakpoints support the 'counter' name is less and
    less appropriate.

    All in one, we've decided to rename the subsystem to 'performance
    events' and to propagate this rename through all fields, variables
    and API names. (in an ABI compatible fashion)

    The word 'event' is also a bit shorter than 'counter' - which makes
    it slightly more convenient to write/handle as well.

    Thanks goes to Stephane Eranian who first observed this misnomer and
    suggested a rename.

    User-space tooling and ABI compatibility is not affected - this patch
    should be function-invariant. (Also, defconfigs were not touched to
    keep the size down.)

    This patch has been generated via the following script:

    FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')

    sed -i \
    -e 's/PERF_EVENT_/PERF_RECORD_/g' \
    -e 's/PERF_COUNTER/PERF_EVENT/g' \
    -e 's/perf_counter/perf_event/g' \
    -e 's/nb_counters/nb_events/g' \
    -e 's/swcounter/swevent/g' \
    -e 's/tpcounter_event/tp_event/g' \
    $FILES

    for N in $(find . -name perf_counter.[ch]); do
    M=$(echo $N | sed 's/perf_counter/perf_event/g')
    mv $N $M
    done

    FILES=$(find . -name perf_event.*)

    sed -i \
    -e 's/COUNTER_MASK/REG_MASK/g' \
    -e 's/COUNTER/EVENT/g' \
    -e 's/\/event_id/g' \
    -e 's/counter/event/g' \
    -e 's/Counter/Event/g' \
    $FILES

    ... to keep it as correct as possible. This script can also be
    used by anyone who has pending perfcounters patches - it converts
    a Linux kernel tree over to the new naming. We tried to time this
    change to the point in time where the amount of pending patches
    is the smallest: the end of the merge window.

    Namespace clashes were fixed up in a preparatory patch - and some
    stylistic fallout will be fixed up in a subsequent patch.

    ( NOTE: 'counters' are still the proper terminology when we deal
    with hardware registers - and these sed scripts are a bit
    over-eager in renaming them. I've undone some of that, but
    in case there's something left where 'counter' would be
    better than 'event' we can undo that on an individual basis
    instead of touching an otherwise nicely automated patch. )

    Suggested-by: Stephane Eranian
    Acked-by: Peter Zijlstra
    Acked-by: Paul Mackerras
    Reviewed-by: Arjan van de Ven
    Cc: Mike Galbraith
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    Cc: Steven Rostedt
    Cc: Benjamin Herrenschmidt
    Cc: David Howells
    Cc: Kyle McMartin
    Cc: Martin Schwidefsky
    Cc: "David S. Miller"
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc:
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

19 Sep, 2009

2 commits

  • Conflicts:
    arch/x86/kernel/setup.c
    drivers/acpi/power.c
    init/main.c

    Signed-off-by: Len Brown

    Len Brown
     
  • …el/git/tip/linux-2.6-tip

    * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (38 commits)
    x86: Move get/set_wallclock to x86_platform_ops
    x86: platform: Fix section annotations
    x86: apic namespace cleanup
    x86: Distangle ioapic and i8259
    x86: Add Moorestown early detection
    x86: Add hardware_subarch ID for Moorestown
    x86: Add early platform detection
    x86: Move tsc_init to late_time_init
    x86: Move tsc_calibration to x86_init_ops
    x86: Replace the now identical time_32/64.c by time.c
    x86: time_32/64.c unify profile_pc
    x86: Move calibrate_cpu to tsc.c
    x86: Make timer setup and global variables the same in time_32/64.c
    x86: Remove mca bus ifdef from timer interrupt
    x86: Simplify timer_ack magic in time_32.c
    x86: Prepare unification of time_32/64.c
    x86: Remove do_timer hook
    x86: Add timer_init to x86_init_ops
    x86: Move percpu clockevents setup to x86_init_ops
    x86: Move xen_post_allocator_init into xen_pagetable_setup_done
    ...

    Fix up conflicts in arch/x86/include/asm/io_apic.h

    Linus Torvalds
     

18 Sep, 2009

1 commit

  • * 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (21 commits)
    x86, mce: Fix compilation with !CONFIG_DEBUG_FS in mce-severity.c
    x86, mce: CE in last bank prevents panic by unknown MCE
    x86, mce: Fake panic support for MCE testing
    x86, mce: Move debugfs mce dir creating to mce.c
    x86, mce: Support specifying raise mode for software MCE injection
    x86, mce: Support specifying context for software mce injection
    x86, mce: fix reporting of Thermal Monitoring mechanism enabled
    x86, mce: remove never executed code
    x86, mce: add missing __cpuinit tags
    x86, mce: fix "mce" boot option handling for CONFIG_X86_NEW_MCE
    x86, mce: don't log boot MCEs on Pentium M (model == 13) CPUs
    x86: mce: Lower maximum number of banks to architecture limit
    x86: mce: macros to compute banks MSRs
    x86: mce: Move per bank data in a single datastructure
    x86: mce: Move code in mce.c
    x86: mce: Rename CONFIG_X86_NEW_MCE to CONFIG_X86_MCE
    x86: mce: Remove old i386 machine check code
    x86: mce: Update X86_MCE description in x86/Kconfig
    x86: mce: Make CONFIG_X86_ANCIENT_MCE dependent on CONFIG_X86_MCE
    x86, mce: use atomic_inc_return() instead of add by 1
    ...

    Manually fixed up trivial conflicts:
    Documentation/feature-removal-schedule.txt
    arch/x86/kernel/cpu/mcheck/mce.c

    Linus Torvalds
     

16 Sep, 2009

3 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (46 commits)
    powerpc64: convert to dynamic percpu allocator
    sparc64: use embedding percpu first chunk allocator
    percpu: kill lpage first chunk allocator
    x86,percpu: use embedding for 64bit NUMA and page for 32bit NUMA
    percpu: update embedding first chunk allocator to handle sparse units
    percpu: use group information to allocate vmap areas sparsely
    vmalloc: implement pcpu_get_vm_areas()
    vmalloc: separate out insert_vmalloc_vm()
    percpu: add chunk->base_addr
    percpu: add pcpu_unit_offsets[]
    percpu: introduce pcpu_alloc_info and pcpu_group_info
    percpu: move pcpu_lpage_build_unit_map() and pcpul_lpage_dump_cfg() upward
    percpu: add @align to pcpu_fc_alloc_fn_t
    percpu: make @dyn_size mandatory for pcpu_setup_first_chunk()
    percpu: drop @static_size from first chunk allocators
    percpu: generalize first chunk allocator selection
    percpu: build first chunk allocators selectively
    percpu: rename 4k first chunk allocator to page
    percpu: improve boot messages
    percpu: fix pcpu_reclaim() locking
    ...

    Fix trivial conflict as by Tejun Heo in kernel/sched.c

    Linus Torvalds
     
  • * 'x86-pat-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, pat: Fix cacheflush address in change_page_attr_set_clr()
    mm: remove !NUMA condition from PAGEFLAGS_EXTENDED condition set
    x86: Fix earlyprintk=dbgp for machines without NX
    x86, pat: Sanity check remap_pfn_range for RAM region
    x86, pat: Lookup the protection from memtype list on vm_insert_pfn()
    x86, pat: Add lookup_memtype to get the current memtype of a paddr
    x86, pat: Use page flags to track memtypes of RAM pages
    x86, pat: Generalize the use of page flag PG_uncached
    x86, pat: Add rbtree to do quick lookup in memtype tracking
    x86, pat: Add PAT reserve free to io_mapping* APIs
    x86, pat: New i/f for driver to request memtype for IO regions
    x86, pat: ioremap to follow same PAT restrictions as other PAT users
    x86, pat: Keep identity maps consistent with mmaps even when pat_disabled
    x86, mtrr: make mtrr_aps_delayed_init static bool
    x86, pat/mtrr: Rendezvous all the cpus for MTRR/PAT init
    generic-ipi: Allow cpus not yet online to call smp_call_function with irqs disabled
    x86: Fix an incorrect argument of reserve_bootmem()
    x86: Fix system crash when loading with "reservetop" parameter

    Linus Torvalds
     
  • * 'x86-txt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, intel_txt: clean up the impact on generic code, unbreak non-x86
    x86, intel_txt: Handle ACPI_SLEEP without X86_TRAMPOLINE
    x86, intel_txt: Fix typos in Kconfig help
    x86, intel_txt: Factor out the code for S3 setup
    x86, intel_txt: tboot.c needs
    intel_txt: Force IOMMU on for Intel TXT launch
    x86, intel_txt: Intel TXT Sx shutdown support
    x86, intel_txt: Intel TXT reboot/halt shutdown support
    x86, intel_txt: Intel TXT boot support

    Linus Torvalds
     

12 Sep, 2009

1 commit

  • …el/git/tip/linux-2.6-tip

    * 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (105 commits)
    ring-buffer: only enable ring_buffer_swap_cpu when needed
    ring-buffer: check for swapped buffers in start of committing
    tracing: report error in trace if we fail to swap latency buffer
    tracing: add trace_array_printk for internal tracers to use
    tracing: pass around ring buffer instead of tracer
    tracing: make tracing_reset safe for external use
    tracing: use timestamp to determine start of latency traces
    tracing: Remove mentioning of legacy latency_trace file from documentation
    tracing/filters: Defer pred allocation, fix memory leak
    tracing: remove users of tracing_reset
    tracing: disable buffers and synchronize_sched before resetting
    tracing: disable update max tracer while reading trace
    tracing: print out start and stop in latency traces
    ring-buffer: disable all cpu buffers when one finds a problem
    ring-buffer: do not count discarded events
    ring-buffer: remove ring_buffer_event_discard
    ring-buffer: fix ring_buffer_read crossing pages
    ring-buffer: remove unnecessary cpu_relax
    ring-buffer: do not swap buffers during a commit
    ring-buffer: do not reset while in a commit
    ...

    Linus Torvalds
     

06 Sep, 2009

1 commit


03 Sep, 2009

1 commit


02 Sep, 2009

2 commits


31 Aug, 2009

1 commit

  • Moorestown MID devices need to be detected early in the boot process
    to setup and do not call x86_default_early_setup as there is no EBDA
    region to reserve.

    [ Copied the minimal code from Jacobs latest MRST series ]

    Signed-off-by: Thomas Gleixner
    Cc: Jacob Pan

    Thomas Gleixner
     

29 Aug, 2009

2 commits

  • First check ACPI, and if that fails, ask SFI to find the MCFG.

    Signed-off-by: Feng Tang
    Signed-off-by: Len Brown
    Cc: Jesse Barnes

    Feng Tang
     
  • arch/x86/kernel/sfi.c serves the dual-purpose of supporting the
    SFI core with arch specific code, as well as a home for the
    arch-specific code that uses SFI.

    analogous to ACPI, drivers/sfi/Kconfig is pulled in by arch/x86/Kconfig

    Signed-off-by: Feng Tang
    Signed-off-by: Len Brown
    Cc: x86@kernel.org

    Feng Tang
     

27 Aug, 2009

2 commits


26 Aug, 2009

1 commit

  • s/HAVE_FTRACE_SYSCALLS/HAVE_SYSCALL_TRACEPOINTS/g
    s/TIF_SYSCALL_FTRACE/TIF_SYSCALL_TRACEPOINT/g

    The syscall enter/exit tracing is no longer specific to just ftrace, so
    they now have names that reflect their tie to tracepoints instead.

    Signed-off-by: Josh Stone
    Cc: Jason Baron
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Li Zefan
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Mathieu Desnoyers
    Cc: Jiaying Zhang
    Cc: Martin Bligh
    Cc: Lai Jiangshan
    Cc: Paul Mundt
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Josh Stone
     

14 Aug, 2009

3 commits

  • Embedding percpu first chunk allocator can now handle very sparse unit
    mapping. Use embedding allocator instead of lpage for 64bit NUMA.
    This removes extra TLB pressure and the need to do complex and fragile
    dancing when changing page attributes.

    For 32bit, using very sparse unit mapping isn't a good idea because
    the vmalloc space is very constrained. 32bit NUMA machines aren't
    exactly the focus of optimization and it isn't very clear whether
    lpage performs better than page. Use page first chunk allocator for
    32bit NUMAs.

    As this leaves setup_pcpu_*() functions pretty much empty, fold them
    into setup_per_cpu_areas().

    Signed-off-by: Tejun Heo
    Cc: Ingo Molnar
    Cc: Andi Kleen

    Tejun Heo
     
  • There's no need to build unused first chunk allocators in. Define
    CONFIG_NEED_PER_CPU_*_FIRST_CHUNK and let archs enable them
    selectively.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Conflicts:
    arch/sparc/kernel/smp_64.c
    arch/x86/kernel/cpu/perf_counter.c
    arch/x86/kernel/setup_percpu.c
    drivers/cpufreq/cpufreq_ondemand.c
    mm/percpu.c

    Conflicts in core and arch percpu codes are mostly from commit
    ed78e1e078dd44249f88b1dd8c76dafb39567161 which substituted many
    num_possible_cpus() with nr_cpu_ids. As for-next branch has moved all
    the first chunk allocators into mm/percpu.c, the changes are moved
    from arch code to mm/percpu.c.

    Signed-off-by: Tejun Heo

    Tejun Heo
     

12 Aug, 2009

1 commit

  • Johannes Stezenbach reported that his Pentium-M based
    laptop does not have the local APIC enabled by default,
    and hence perfcounters do not get initialized.

    Add a fallback for this case: allow non-sampled counters
    and return with an error on sampled counters. This allows
    'perf stat' to work out of box - and allows 'perf top'
    and 'perf record' to fall back on a hrtimer based sampling
    method.

    ( Passing 'lapic' on the boot line will allow hardware
    sampling to occur - but if the APIC is disabled
    permanently by the hardware then this fallback still
    allows more systems to use perfcounters. )

    Also decouple perfcounter support from X86_LOCAL_APIC.

    -v2: fix typo breaking counters on all other systems ...

    Reported-by: Johannes Stezenbach
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

10 Jul, 2009

4 commits


04 Jul, 2009

2 commits


29 Jun, 2009

1 commit

  • There's no need for the GFX workaround now we have 'iommu=pt' for the
    cases where people really care about performance. There's no need to
    have a special case for just one type of device.

    This also speeds up the iommu=pt path and reduces memory usage by
    setting up the si_domain _once_ and then using it for all devices,
    rather than giving each device its own private page tables.

    Signed-off-by: David Woodhouse

    David Woodhouse
     

24 Jun, 2009

1 commit

  • This patch makes most !CONFIG_HAVE_SETUP_PER_CPU_AREA archs use
    dynamic percpu allocator. The first chunk is allocated using
    embedding helper and 8k is reserved for modules. This ensures that
    the new allocator behaves almost identically to the original allocator
    as long as static percpu variables are concerned, so it shouldn't
    introduce much breakage.

    s390 and alpha use custom SHIFT_PERCPU_PTR() to work around addressing
    range limit the addressing model imposes. Unfortunately, this breaks
    if the address is specified using a variable, so for now, the two
    archs aren't converted.

    The following architectures are affected by this change.

    * sh
    * arm
    * cris
    * mips
    * sparc(32)
    * blackfin
    * avr32
    * parisc (broken, under investigation)
    * m32r
    * powerpc(32)

    As this change makes the dynamic allocator the default one,
    CONFIG_HAVE_DYNAMIC_PER_CPU_AREA is replaced with its invert -
    CONFIG_HAVE_LEGACY_PER_CPU_AREA, which is added to yet-to-be converted
    archs. These archs implement their own setup_per_cpu_areas() and the
    conversion is not trivial.

    * powerpc(64)
    * sparc(64)
    * ia64
    * alpha
    * s390

    Boot and batch alloc/free tests on x86_32 with debug code (x86_32
    doesn't use default first chunk initialization). Compile tested on
    sparc(32), powerpc(32), arm and alpha.

    Kyle McMartin reported that this change breaks parisc. The problem is
    still under investigation and he is okay with pushing this patch
    forward and fixing parisc later.

    [ Impact: use dynamic allocator for most archs w/o custom percpu setup ]

    Signed-off-by: Tejun Heo
    Acked-by: Rusty Russell
    Acked-by: David S. Miller
    Acked-by: Benjamin Herrenschmidt
    Acked-by: Martin Schwidefsky
    Reviewed-by: Christoph Lameter
    Cc: Paul Mundt
    Cc: Russell King
    Cc: Mikael Starvik
    Cc: Ralf Baechle
    Cc: Bryan Wu
    Cc: Kyle McMartin
    Cc: Matthew Wilcox
    Cc: Grant Grundler
    Cc: Hirokazu Takata
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Heiko Carstens
    Cc: Ingo Molnar

    Tejun Heo
     

21 Jun, 2009

1 commit

  • …nel/git/tip/linux-2.6-tip

    * 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (24 commits)
    tracing/urgent: warn in case of ftrace_start_up inbalance
    tracing/urgent: fix unbalanced ftrace_start_up
    function-graph: add stack frame test
    function-graph: disable when both x86_32 and optimize for size are configured
    ring-buffer: have benchmark test print to trace buffer
    ring-buffer: do not grab locks in nmi
    ring-buffer: add locks around rb_per_cpu_empty
    ring-buffer: check for less than two in size allocation
    ring-buffer: remove useless compile check for buffer_page size
    ring-buffer: remove useless warn on check
    ring-buffer: use BUF_PAGE_HDR_SIZE in calculating index
    tracing: update sample event documentation
    tracing/filters: fix race between filter setting and module unload
    tracing/filters: free filter_string in destroy_preds()
    ring-buffer: use commit counters for commit pointer accounting
    ring-buffer: remove unused variable
    ring-buffer: have benchmark test handle discarded events
    ring-buffer: prevent adding write in discarded area
    tracing/filters: strloc should be unsigned short
    tracing/filters: operand can be negative
    ...

    Fix up kmemcheck-induced conflict in kernel/trace/ring_buffer.c manually

    Linus Torvalds
     

19 Jun, 2009

2 commits

  • In case gcc does something funny with the stack frames, or the return
    from function code, we would like to detect that.

    An arch may implement passing of a variable that is unique to the
    function and can be saved on entering a function and can be tested
    when exiting the function. Usually the frame pointer can be used for
    this purpose.

    This patch also implements this for x86. Where it passes in the stack
    frame of the parent function, and will test that frame on exit.

    There was a case in x86_32 with optimize for size (-Os) where, for a
    few functions, gcc would align the stack frame and place a copy of the
    return address into it. The function graph tracer modified the copy and
    not the actual return address. On return from the funtion, it did not go
    to the tracer hook, but returned to the parent. This broke the function
    graph tracer, because the return of the parent (where gcc did not do
    this funky manipulation) returned to the location that the child function
    was suppose to. This caused strange kernel crashes.

    This test detected the problem and pointed out where the issue was.

    This modifies the parameters of one of the functions that the arch
    specific code calls, so it includes changes to arch code to accommodate
    the new prototype.

    Note, I notice that the parsic arch implements its own push_return_trace.
    This is now a generic function and the ftrace_push_return_trace should be
    used instead. This patch does not touch that code.

    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Frederic Weisbecker
    Cc: Helge Deller
    Cc: Kyle McMartin
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • Signed-off-by: FUJITA Tomonori
    Acked-by: Joerg Roedel
    Acked-by: Ingo Molnar
    Cc: "Luck, Tony"
    Cc: Arnd Bergmann
    Cc: James Bottomley
    Cc: "David S. Miller"
    Cc: Catalin Marinas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     

15 Jun, 2009

2 commits


12 Jun, 2009

1 commit


11 Jun, 2009

2 commits

  • Conflicts:
    arch/x86/kernel/irqinit.c
    arch/x86/kernel/irqinit_64.c
    arch/x86/kernel/traps.c
    arch/x86/mm/fault.c
    include/linux/sched.h
    kernel/exit.c

    Ingo Molnar
     
  • …/git/tip/linux-2.6-tip

    * 'x86-kbuild-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (46 commits)
    x86, boot: add new generated files to the appropriate .gitignore files
    x86, boot: correct the calculation of ZO_INIT_SIZE
    x86-64: align __PHYSICAL_START, remove __KERNEL_ALIGN
    x86, boot: correct sanity checks in boot/compressed/misc.c
    x86: add extension fields for bootloader type and version
    x86, defconfig: update kernel position parameters
    x86, defconfig: update to current, no material changes
    x86: make CONFIG_RELOCATABLE the default
    x86: default CONFIG_PHYSICAL_START and CONFIG_PHYSICAL_ALIGN to 16 MB
    x86: document new bzImage fields
    x86, boot: make kernel_alignment adjustable; new bzImage fields
    x86, boot: remove dead code from boot/compressed/head_*.S
    x86, boot: use LOAD_PHYSICAL_ADDR on 64 bits
    x86, boot: make symbols from the main vmlinux available
    x86, boot: determine compressed code offset at compile time
    x86, boot: use appropriate rep string for move and clear
    x86, boot: zero EFLAGS on 32 bits
    x86, boot: set up the decompression stack as early as possible
    x86, boot: straighten out ranges to copy/zero in compressed/head*.S
    x86, boot: stylistic cleanups for boot/compressed/head_64.S
    ...

    Fixed trivial conflict in arch/x86/configs/x86_64_defconfig manually

    Linus Torvalds