10 Mar, 2009

1 commit


09 Mar, 2009

1 commit

  • Impact: fix kernel crash when using trace_printk()

    trace_printk_fmt section is defined into the readonly section.
    But we do:

    trace_printk_fmt = fmt;

    to fill in that table of format strings - which is not read-only.
    Under CONFIG_DEBUG_RODATA=y this crashes ...

    Cc: Frederic Weisbecker
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

08 Mar, 2009

1 commit


07 Mar, 2009

1 commit

  • Impact: add a generic printk() for tracing, like trace_printk()

    trace_bprintk() uses the infrastructure to record events on ring_buffer.

    [ fweisbec@gmail.com: ported to latest -tip, made it work if
    !CONFIG_MODULES, never free the format strings from modules
    because we can't keep track of them and conditionnaly create
    the ftrace format strings section (reported by Steven Rostedt) ]

    Signed-off-by: Lai Jiangshan
    Signed-off-by: Frederic Weisbecker
    Acked-by: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Lai Jiangshan
     

06 Mar, 2009

1 commit


25 Feb, 2009

1 commit

  • This patch creates the event tracing infrastructure of ftrace.
    It will create the files:

    /debug/tracing/available_events
    /debug/tracing/set_event

    The available_events will list the trace points that have been
    registered with the event tracer.

    set_events will allow the user to enable or disable an event hook.

    example:

    # echo sched_wakeup > /debug/tracing/set_event

    Will enable the sched_wakeup event (if it is registered).

    # echo "!sched_wakeup" >> /debug/tracing/set_event

    Will disable the sched_wakeup event (and only that event).

    # echo > /debug/tracing/set_event

    Will disable all events (notice the '>')

    # cat /debug/tracing/available_events > /debug/tracing/set_event

    Will enable all registered event hooks.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

31 Jan, 2009

1 commit

  • Impact: fix linker screwup on x86_32

    Recent x86_64 zerobased patches introduced PERCPU_VADDR() to put
    .data.percpu to a predefined address and re-defined PERCPU() in terms
    of it. The new macro defined one extra symbol, __per_cpu_load, for
    LMA of the section so that the init data could be accessed. This new
    symbol introduced the following problems to x86_32.

    1. If __per_cpu_load is defined outside of .data.percpu as an absolute
    symbol, relocation generation for relocatable kernel fails due to
    absolute relocation.

    2. If __per_cpu_load is put inside .data.percpu with absolute address
    assignment to work around #1, linker gets confused and under
    certain configurations ends up relocating the symbol against
    .data.percpu such that the load address gets added on top of
    already set load address.

    As x86_32 doesn't use predefined address for .data.percpu, there's no
    need for it to care about the possibility of __per_cpu_load being
    different from __per_cpu_start.

    This patch defines PERCPU() separately so that __per_cpu_load is
    defined inside .data.percpu so that everything is ordinary
    linking-wise.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     

30 Jan, 2009

1 commit

  • This reverts commit 5a611268b69f05262936dd177205acbce4471358.

    It is causing occasional boot crashes, caused by certain
    linker versions (GNU ld version 2.18.50.0.6-2 20080403) messing up:

    82dcc000 D __per_cpu_load
    c16e6000 A __per_cpu_load_abs

    The __per_cpu_load value is out of whack. Hpa noticed the following
    detail:

    * (gdb) p/x -(0xc16e6000-0x82dcc000)
    * $2 = 0xc16e6000
    * I.e. one is the other << 1

    The two symbols should be equal.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

27 Jan, 2009

1 commit

  • …git/tip/linux-2.6-tip

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (29 commits)
    xen: unitialised return value in xenbus_write_transaction
    x86: fix section mismatch warning
    x86: unmask CPUID levels on Intel CPUs, fix
    x86: work around PAGE_KERNEL_WC not getting WC in iomap_atomic_prot_pfn.
    x86: use standard PIT frequency
    xen: handle highmem pages correctly when shrinking a domain
    x86, mm: fix pte_free()
    xen: actually release memory when shrinking domain
    x86: unmask CPUID levels on Intel CPUs
    x86: add MSR_IA32_MISC_ENABLE bits to <asm/msr-index.h>
    x86: fix PTE corruption issue while mapping RAM using /dev/mem
    x86: mtrr fix debug boot parameter
    x86: fix page attribute corruption with cpa()
    Revert "x86: signal: change type of paramter for sys_rt_sigreturn()"
    x86: use early clobbers in usercopy*.c
    x86: remove kernel_physical_mapping_init() from init section
    fix: crash: IP: __bitmap_intersects+0x48/0x73
    cpufreq: use work_on_cpu in acpi-cpufreq.c for drv_read and drv_write
    work_on_cpu: Use our own workqueue.
    work_on_cpu: don't try to get_online_cpus() in work_on_cpu.
    ...

    Linus Torvalds
     

26 Jan, 2009

1 commit

  • This patch fixes this linker error:

    WARNING: Absolute relocations present
    Offset Info Type Sym.Value Sym.Name
    c0a4e07d 00e78001 R_386_32 c0ab0000 __per_cpu_load

    Now, __per_cpu_load is a section-relative symbol:

    c0aa4000 D __per_cpu_load
    c0aa4000 A __per_cpu_load_abs

    Signed-off-by: Brian Gerst
    Signed-off-by: Ingo Molnar

    Brian Gerst
     

21 Jan, 2009

1 commit


20 Jan, 2009

2 commits


17 Jan, 2009

1 commit

  • The newly added PERCPU_*() macros define and use __per_cpu_load but
    VMLINUX_SYMBOL() was missing from usages causing build failures on
    archs where linker visible symbol is different from C symbols
    (e.g. blackfin).

    Signed-off-by: Tejun Heo

    Tejun Heo
     

16 Jan, 2009

4 commits

  • It is an optimization and a cleanup, and adds the following new
    generic percpu methods:

    percpu_read()
    percpu_write()
    percpu_add()
    percpu_sub()
    percpu_and()
    percpu_or()
    percpu_xor()

    and implements support for them on x86. (other architectures will fall
    back to a default implementation)

    The advantage is that for example to read a local percpu variable,
    instead of this sequence:

    return __get_cpu_var(var);

    ffffffff8102ca2b: 48 8b 14 fd 80 09 74 mov -0x7e8bf680(,%rdi,8),%rdx
    ffffffff8102ca32: 81
    ffffffff8102ca33: 48 c7 c0 d8 59 00 00 mov $0x59d8,%rax
    ffffffff8102ca3a: 48 8b 04 10 mov (%rax,%rdx,1),%rax

    We can get a single instruction by using the optimized variants:

    return percpu_read(var);

    ffffffff8102ca3f: 65 48 8b 05 91 8f fd mov %gs:0x7efd8f91(%rip),%rax

    I also cleaned up the x86-specific APIs and made the x86 code use
    these new generic percpu primitives.

    tj: * fixed generic percpu_sub() definition as Roel Kluin pointed out
    * added percpu_and() for completeness's sake
    * made generic percpu ops atomic against preemption

    Signed-off-by: Ingo Molnar
    Signed-off-by: Tejun Heo

    Ingo Molnar
     
  • [ Based on original patch from Christoph Lameter and Mike Travis. ]

    Currently pdas and percpu areas are allocated separately. %gs points
    to local pda and percpu area can be reached using pda->data_offset.
    This patch folds pda into percpu area.

    Due to strange gcc requirement, pda needs to be at the beginning of
    the percpu area so that pda->stack_canary is at %gs:40. To achieve
    this, a new percpu output section macro - PERCPU_VADDR_PREALLOC() - is
    added and used to reserve pda sized chunk at the start of the percpu
    area.

    After this change, for boot cpu, %gs first points to pda in the
    data.init area and later during setup_per_cpu_areas() gets updated to
    point to the actual pda. This means that setup_per_cpu_areas() need
    to reload %gs for CPU0 while clearing pda area for other cpus as cpu0
    already has modified it when control reaches setup_per_cpu_areas().

    This patch also removes now unnecessary get_local_pda() and its call
    sites.

    A lot of this patch is taken from Mike Travis' "x86_64: Fold pda into
    per cpu area" patch.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • [ Based on original patch from Christoph Lameter and Mike Travis. ]

    This patch makes percpu symbols zerobased on x86_64 SMP by adding
    PERCPU_VADDR() to vmlinux.lds.h which helps setting explicit vaddr on
    the percpu output section and using it in vmlinux_64.lds.S. A new
    PHDR is added as existing ones cannot contain sections near address
    zero. PERCPU_VADDR() also adds a new symbol __per_cpu_load which
    always points to the vaddr of the loaded percpu data.init region.

    The following adjustments have been made to accomodate the address
    change.

    * code to locate percpu gdt_page in head_64.S is updated to add the
    load address to the gdt_page offset.

    * __per_cpu_load is used in places where access to the init data area
    is necessary.

    * pda->data_offset is initialized soon after C code is entered as zero
    value doesn't work anymore.

    This patch is mostly taken from Mike Travis' "x86_64: Base percpu
    variables at zero" patch.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Unlike other alphas, marvel doesn't have real PC-style CMOS clock hardware
    - RTC accesses are emulated via PAL calls. Unfortunately, for unknown
    reason these calls work only on CPU #0. So current implementation for
    arbitrary CPU makes CMOS_READ/WRITE to be executed on CPU #0 via IPI.
    However, for obvious reason this doesn't work with standard
    get/set_rtc_time() functions, where a bunch of CMOS accesses is done with
    disabled interrupts.

    Solved by making the IPI calls for entire get/set_rtc_time() functions,
    not for individual CMOS accesses. Which is also a lot more effective
    performance-wise.

    The patch is largely based on the code from Jay Estabrook.
    My changes:
    - tweak asm-generic/rtc.h by adding a couple of #defines to
    avoid a massive code duplication in arch/alpha/include/asm/rtc.h;
    - sys_marvel.c: fix get/set_rtc_time() return values (Jay's FIXMEs).

    NOTE: this fixes *only* LIB_RTC drivers. Legacy (CONFIG_RTC) driver
    wont't work on marvel. Actually I think that we should just disable
    CONFIG_RTC on alpha (maybe in 2.6.30?), like most other arches - AFAIK,
    all modern distributions use LIB_RTC anyway.

    Signed-off-by: Ivan Kokshaysky
    Cc: Richard Henderson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ivan Kokshaysky
     

15 Jan, 2009

2 commits


14 Jan, 2009

2 commits

  • Impact: cleanup

    Change the protection parameter for track_pfn_vma_new() into a pgprot_t pointer.
    Subsequent patch changes the x86 PAT handling to return a compatible
    memtype in pgprot_t, if what was requested cannot be allowed due to conflicts.
    No fuctionality change in this patch.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Suresh Siddha
    Signed-off-by: Ingo Molnar

    venkatesh.pallipadi@intel.com
     
  • Impact: reduce kernel image size

    Hugh Dickins noticed that older gcc versions when the kernel
    is built for code size didn't inline some of the bitops.

    Mark all complex x86 bitops that have more than a single
    asm statement or two as always inline to avoid this problem.

    Probably should be done for other architectures too.

    Ingo then found a better fix that only requires
    a single line change, but it unfortunately only
    works on gcc 4.3.

    On older gccs the original patch still makes a ~0.3% defconfig
    difference with CONFIG_OPTIMIZE_INLINING=y.

    With gcc 4.1 and a defconfig like build:

    6116998 1138540 883788 8139326 7c323e vmlinux-oi-with-patch
    6137043 1138540 883788 8159371 7c808b vmlinux-optimize-inlining

    ~20k / 0.3% difference.

    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Andi Kleen
     

07 Jan, 2009

3 commits

  • While looking at reducing the amount of architecture namespace pollution
    in the generic kernel, I found that asm/irq.h is included in the vast
    majority of compilations on ARM (around 650 files.)

    Since asm/irq.h includes a sub-architecture include file on ARM, this
    causes a negative impact on the ccache's ability to re-use the build
    results from other sub-architectures, so we have a desire to reduce the
    dependencies on asm/irq.h.

    It turns out that a major cause of this is the needless include of
    linux/hardirq.h into asm-generic/local.h. The patch below removes this
    include, resulting in some 250 to 300 files (around half) of the kernel
    then omitting asm/irq.h.

    My test builds still succeed, provided two ARM files are fixed
    (arch/arm/kernel/traps.c and arch/arm/mm/fault.c) - so there may be
    negative impacts for this on other architectures.

    Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
    asm/local.h, so this patch can be viewed as bringing the generic version
    into line with the x86 version.

    [kosaki.motohiro@jp.fujitsu.com: add #include to acpi/processor_idle.c]
    [adobriyan@gmail.com: fix sparc64]
    Signed-off-by: Russell King
    Signed-off-by: KOSAKI Motohiro
    Cc: Steven Rostedt
    Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Russell King
     
  • Provide some basic advice about when to use BUG()/BUG_ON(): never, unless
    there's really no better option.

    This matches my understanding of the standard policy ... which seems not
    to be written down so far, outside of LKML messages that I haven't
    bookmarked.

    Signed-off-by: David Brownell
    Cc: Hans Verkuil
    Cc: Ingo Molnar
    Cc: Arjan van de Ven
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • No architectures use CONFIG_OUT_OF_LINE_PFN_TO_PAGE - it can be removed.

    Signed-off-by: KOSAKI Motohiro
    Cc: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     

03 Jan, 2009

1 commit

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

    * 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (66 commits)
    x86: export vector_used_by_percpu_irq
    x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()
    sched: nominate preferred wakeup cpu, fix
    x86: fix lguest used_vectors breakage, -v2
    x86: fix warning in arch/x86/kernel/io_apic.c
    sched: fix warning in kernel/sched.c
    sched: move test_sd_parent() to an SMP section of sched.h
    sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0
    sched: activate active load balancing in new idle cpus
    sched: bias task wakeups to preferred semi-idle packages
    sched: nominate preferred wakeup cpu
    sched: favour lower logical cpu number for sched_mc balance
    sched: framework for sched_mc/smt_power_savings=N
    sched: convert BALANCE_FOR_xx_POWER to inline functions
    x86: use possible_cpus=NUM to extend the possible cpus allowed
    x86: fix cpu_mask_to_apicid_and to include cpu_online_mask
    x86: update io_apic.c to the new cpumask code
    x86: Introduce topology_core_cpumask()/topology_thread_cpumask()
    x86: xen: use smp_call_function_many()
    x86: use work_on_cpu in x86/kernel/cpu/mcheck/mce_amd_64.c
    ...

    Fixed up trivial conflict in kernel/time/tick-sched.c manually

    Linus Torvalds
     

31 Dec, 2008

1 commit

  • * 'core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (63 commits)
    stacktrace: provide save_stack_trace_tsk() weak alias
    rcu: provide RCU options on non-preempt architectures too
    printk: fix discarding message when recursion_bug
    futex: clean up futex_(un)lock_pi fault handling
    "Tree RCU": scalable classic RCU implementation
    futex: rename field in futex_q to clarify single waiter semantics
    x86/swiotlb: add default swiotlb_arch_range_needs_mapping
    x86/swiotlb: add default physbus conversion
    x86: unify pci iommu setup and allow swiotlb to compile for 32 bit
    x86: add swiotlb allocation functions
    swiotlb: consolidate swiotlb info message printing
    swiotlb: support bouncing of HighMem pages
    swiotlb: factor out copy to/from device
    swiotlb: add arch hook to force mapping
    swiotlb: allow architectures to override physbusphys conversions
    swiotlb: add comment where we handle the overflow of a dma mask on 32 bit
    rcu: fix rcutorture behavior during reboot
    resources: skip sanity check of busy resources
    swiotlb: move some definitions to header
    swiotlb: allow architectures to override swiotlb pool allocation
    ...

    Fix up trivial conflicts in
    arch/x86/kernel/Makefile
    arch/x86/mm/init_32.c
    include/linux/hardirq.h
    as per Ingo's suggestions.

    Linus Torvalds
     

29 Dec, 2008

2 commits

  • * 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: (85 commits)
    [S390] provide documentation for hvc_iucv kernel parameter.
    [S390] convert ctcm printks to dev_xxx and pr_xxx macros.
    [S390] convert zfcp printks to pr_xxx macros.
    [S390] convert vmlogrdr printks to pr_xxx macros.
    [S390] convert zfcp dumper printks to pr_xxx macros.
    [S390] convert cpu related printks to pr_xxx macros.
    [S390] convert qeth printks to dev_xxx and pr_xxx macros.
    [S390] convert sclp printks to pr_xxx macros.
    [S390] convert iucv printks to dev_xxx and pr_xxx macros.
    [S390] convert ap_bus printks to pr_xxx macros.
    [S390] convert dcssblk and extmem printks messages to pr_xxx macros.
    [S390] convert monwriter printks to pr_xxx macros.
    [S390] convert s390 debug feature printks to pr_xxx macros.
    [S390] convert monreader printks to pr_xxx macros.
    [S390] convert appldata printks to pr_xxx macros.
    [S390] convert setup printks to pr_xxx macros.
    [S390] convert hypfs printks to pr_xxx macros.
    [S390] convert time printks to pr_xxx macros.
    [S390] convert cpacf printks to pr_xxx macros.
    [S390] convert cio printks to pr_xxx macros.
    ...

    Linus Torvalds
     
  • …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: (241 commits)
    sched, trace: update trace_sched_wakeup()
    tracing/ftrace: don't trace on early stage of a secondary cpu boot, v3
    Revert "x86: disable X86_PTRACE_BTS"
    ring-buffer: prevent false positive warning
    ring-buffer: fix dangling commit race
    ftrace: enable format arguments checking
    x86, bts: memory accounting
    x86, bts: add fork and exit handling
    ftrace: introduce tracing_reset_online_cpus() helper
    tracing: fix warnings in kernel/trace/trace_sched_switch.c
    tracing: fix warning in kernel/trace/trace.c
    tracing/ring-buffer: remove unused ring_buffer size
    trace: fix task state printout
    ftrace: add not to regex on filtering functions
    trace: better use of stack_trace_enabled for boot up code
    trace: add a way to enable or disable the stack tracer
    x86: entry_64 - introduce FTRACE_ frame macro v2
    tracing/ftrace: add the printk-msg-only option
    tracing/ftrace: use preempt_enable_no_resched_notrace in ring_buffer_time_stamp()
    x86, bts: correctly report invalid bts records
    ...

    Fixed up trivial conflict in scripts/recordmcount.pl due to SH bits
    being already partly merged by the SH merge.

    Linus Torvalds
     

25 Dec, 2008

2 commits


23 Dec, 2008

1 commit

  • …86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core

    Ingo Molnar
     

20 Dec, 2008

1 commit


19 Dec, 2008

2 commits


17 Dec, 2008

1 commit


13 Dec, 2008

2 commits


12 Dec, 2008

2 commits