30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

13 Mar, 2010

3 commits

  • Use the generic ptrace_resume code for PTRACE_SYSCALL, PTRACE_CONT,
    PTRACE_KILL and PTRACE_SINGLESTEP. This implies defining
    arch_has_single_step in and implementing the
    user_enable_single_step and user_disable_single_step functions, which also
    causes the breakpoint information to be cleared on fork, which could be
    considered a bug fix.

    Also the TIF_SYSCALL_TRACE thread flag is now cleared on PTRACE_KILL which
    it previously wasn't, which is consistent with all architectures using the
    modern ptrace code.

    The old code only disables the breakpoints on PTRACE_KILL, while after
    this patch this also happens for PTRACE_CONT and PTRACE_SYSCALL which
    matches the behaviour of the other architetures. I think this is a
    bugfixes, but please double verify this is correct.

    Signed-off-by: Christoph Hellwig
    Cc: Oleg Nesterov
    Cc: Roland McGrath
    Cc: Hirokazu Takata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Add generic implementations of the old and really old uname system calls.
    Note that sh only implements sys_olduname but not sys_oldolduname, but I'm
    not going to bother with another ifdef for that special case.

    m32r implemented an old uname but never wired it up, so kill it, too.

    Signed-off-by: Christoph Hellwig
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Cc: Jeff Dike
    Cc: Hirokazu Takata
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Cc: Al Viro
    Cc: Arnd Bergmann
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: "Luck, Tony"
    Cc: James Morris
    Cc: Andreas Schwab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Add a generic implementation of the ipc demultiplexer syscall. Except for
    s390 and sparc64 all implementations of the sys_ipc are nearly identical.

    There are slight differences in the types of the parameters, where mips
    and powerpc as the only 64-bit architectures with sys_ipc use unsigned
    long for the "third" argument as it gets casted to a pointer later, while
    it traditionally is an "int" like most other paramters. frv goes even
    further and uses unsigned long for all parameters execept for "ptr" which
    is a pointer type everywhere. The change from int to unsigned long for
    "third" and back to "int" for the others on frv should be fine due to the
    in-register calling conventions for syscalls (we already had a similar
    issue with the generic sys_ptrace), but I'd prefer to have the arch
    maintainers looks over this in details.

    Except for that h8300, m68k and m68knommu lack an impplementation of the
    semtimedop sub call which this patch adds, and various architectures have
    gets used - at least on i386 it seems superflous as the compat code on
    x86-64 and ia64 doesn't even bother to implement it.

    [akpm@linux-foundation.org: add sys_ipc to sys_ni.c]
    Signed-off-by: Christoph Hellwig
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Cc: Jeff Dike
    Cc: Hirokazu Takata
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Reviewed-by: H. Peter Anvin
    Cc: Al Viro
    Cc: Arnd Bergmann
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: "Luck, Tony"
    Cc: James Morris
    Cc: Andreas Schwab
    Acked-by: Jesper Nilsson
    Acked-by: Russell King
    Acked-by: David Howells
    Acked-by: Kyle McMartin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

03 Mar, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
    percpu: add __percpu sparse annotations to what's left
    percpu: add __percpu sparse annotations to fs
    percpu: add __percpu sparse annotations to core kernel subsystems
    local_t: Remove leftover local.h
    this_cpu: Remove pageset_notifier
    this_cpu: Page allocator conversion
    percpu, x86: Generic inc / dec percpu instructions
    local_t: Move local.h include to ringbuffer.c and ring_buffer_benchmark.c
    module: Use this_cpu_xx to dynamically allocate counters
    local_t: Remove cpu_local_xx macros
    percpu: refactor the code in pcpu_[de]populate_chunk()
    percpu: remove compile warnings caused by __verify_pcpu_ptr()
    percpu: make accessors check for percpu pointer in sparse
    percpu: add __percpu for sparse.
    percpu: make access macros universal
    percpu: remove per_cpu__ prefix.

    Linus Torvalds
     

21 Feb, 2010

1 commit

  • On VIVT ARM, when we have multiple shared mappings of the same file
    in the same MM, we need to ensure that we have coherency across all
    copies. We do this via make_coherent() by making the pages
    uncacheable.

    This used to work fine, until we allowed highmem with highpte - we
    now have a page table which is mapped as required, and is not available
    for modification via update_mmu_cache().

    Ralf Beache suggested getting rid of the PTE value passed to
    update_mmu_cache():

    On MIPS update_mmu_cache() calls __update_tlb() which walks pagetables
    to construct a pointer to the pte again. Passing a pte_t * is much
    more elegant. Maybe we might even replace the pte argument with the
    pte_t?

    Ben Herrenschmidt would also like the pte pointer for PowerPC:

    Passing the ptep in there is exactly what I want. I want that
    -instead- of the PTE value, because I have issue on some ppc cases,
    for I$/D$ coherency, where set_pte_at() may decide to mask out the
    _PAGE_EXEC.

    So, pass in the mapped page table pointer into update_mmu_cache(), and
    remove the PTE value, updating all implementations and call sites to
    suit.

    Includes a fix from Stephen Rothwell:

    sparc: fix fallout from update_mmu_cache API change

    Signed-off-by: Stephen Rothwell

    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Russell King

    Russell King
     

05 Jan, 2010

1 commit


16 Dec, 2009

1 commit

  • Currently all architectures but microblaze unconditionally define
    USE_ELF_CORE_DUMP. The microblaze omission seems like an error to me, so
    let's kill this ifdef and make sure we are the same everywhere.

    Signed-off-by: Christoph Hellwig
    Acked-by: Hugh Dickins
    Cc:
    Cc: Michal Simek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

15 Dec, 2009

6 commits


11 Dec, 2009

1 commit


09 Dec, 2009

1 commit

  • * 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block: (113 commits)
    cfq-iosched: Do not access cfqq after freeing it
    block: include linux/err.h to use ERR_PTR
    cfq-iosched: use call_rcu() instead of doing grace period stall on queue exit
    blkio: Allow CFQ group IO scheduling even when CFQ is a module
    blkio: Implement dynamic io controlling policy registration
    blkio: Export some symbols from blkio as its user CFQ can be a module
    block: Fix io_context leak after failure of clone with CLONE_IO
    block: Fix io_context leak after clone with CLONE_IO
    cfq-iosched: make nonrot check logic consistent
    io controller: quick fix for blk-cgroup and modular CFQ
    cfq-iosched: move IO controller declerations to a header file
    cfq-iosched: fix compile problem with !CONFIG_CGROUP
    blkio: Documentation
    blkio: Wait on sync-noidle queue even if rq_noidle = 1
    blkio: Implement group_isolation tunable
    blkio: Determine async workload length based on total number of queues
    blkio: Wait for cfq queue to get backlogged if group is empty
    blkio: Propagate cgroup weight updation to cfq groups
    blkio: Drop the reference to queue once the task changes cgroup
    blkio: Provide some isolation between groups
    ...

    Linus Torvalds
     

03 Dec, 2009

1 commit


26 Nov, 2009

1 commit

  • Mtdblock driver doesn't call flush_dcache_page for pages in request. So,
    this causes problems on architectures where the icache doesn't fill from
    the dcache or with dcache aliases. The patch fixes this.

    The ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE symbol was introduced to avoid
    pointless empty cache-thrashing loops on architectures for which
    flush_dcache_page() is a no-op. Every architecture was provided with this
    flush pages on architectires where ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE is
    equal 1 or do nothing otherwise.

    See "fix mtd_blkdevs problem with caches on some architectures" discussion
    on LKML for more information.

    Signed-off-by: Ilya Loginov
    Cc: Ingo Molnar
    Cc: David Woodhouse
    Cc: Peter Horton
    Cc: "Ed L. Cashin"
    Signed-off-by: Jens Axboe

    Ilya Loginov
     

19 Nov, 2009

1 commit


09 Nov, 2009

1 commit


04 Nov, 2009

4 commits

  • Index `ipi_num' is signed, test whether it is negative to
    make sure we don't get a negative array element.

    Signed-off-by: Roel Kluin
    Signed-off-by: Hirokazu Takata

    Roel Kluin
     
  • - Support bzip2 and lzma kernel compression for m32r.
    - Clean up arch/m32r/boot/compressed/misc.c.

    Signed-off-by: Hirokazu Takata

    Hirokazu Takata
     
  • Building with --build-id option, .note.gnu.build-id section is added
    to vmlinux.bin. But some old buggy binutils creates a huge vmlinux.bin,
    and a bootloader fails to boot its zImage as well.

    This patch adds a NOTES macro to a linker script vmlinux.ld.S to put
    .note.gnu.build-id section into .note section.
    Then, the .note section will be removed, because "-R .note" option is
    specified in OBJCOPYFLAGS to make a vmlinux.bin binary.

    Signed-off-by: Hirokazu Takata

    Hirokazu Takata
     
  • The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d
    but is perhaps more readable.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @haskernel@
    @@

    @depends on haskernel@
    expression x,__divisor;
    @@

    - (((x) + ((__divisor) / 2)) / (__divisor))
    + DIV_ROUND_CLOSEST(x,__divisor)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Hirokazu Takata

    Julia Lawall
     

13 Oct, 2009

1 commit

  • Create a new socket level option to report number of queue overflows

    Recently I augmented the AF_PACKET protocol to report the number of frames lost
    on the socket receive queue between any two enqueued frames. This value was
    exported via a SOL_PACKET level cmsg. AFter I completed that work it was
    requested that this feature be generalized so that any datagram oriented socket
    could make use of this option. As such I've created this patch, It creates a
    new SOL_SOCKET level option called SO_RXQ_OVFL, which when enabled exports a
    SOL_SOCKET level cmsg that reports the nubmer of times the sk_receive_queue
    overflowed between any two given frames. It also augments the AF_PACKET
    protocol to take advantage of this new feature (as it previously did not touch
    sk->sk_drops, which this patch uses to record the overflow count). Tested
    successfully by me.

    Notes:

    1) Unlike my previous patch, this patch simply records the sk_drops value, which
    is not a number of drops between packets, but rather a total number of drops.
    Deltas must be computed in user space.

    2) While this patch currently works with datagram oriented protocols, it will
    also be accepted by non-datagram oriented protocols. I'm not sure if thats
    agreeable to everyone, but my argument in favor of doing so is that, for those
    protocols which aren't applicable to this option, sk_drops will always be zero,
    and reporting no drops on a receive queue that isn't used for those
    non-participating protocols seems reasonable to me. This also saves us having
    to code in a per-protocol opt in mechanism.

    3) This applies cleanly to net-next assuming that commit
    977750076d98c7ff6cbda51858bb5a5894a9d9ab (my af packet cmsg patch) is reverted

    Signed-off-by: Neil Horman
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Neil Horman
     

12 Oct, 2009

1 commit


04 Oct, 2009

6 commits

  • This patch fixes the m32r SMP kernel after 2.6.27.

    A part of the following patch breaks m32r SMP operation.
    > m32r: convert to generic helpers for IPI function calls
    > commit 7b7426c8a615cf61df9a77b9df7d5b75d91e3fa0

    In the above patch, a CALL_FUNC_SINGLE_IPI was newly introduced,
    but the its IPI vector number was wrong in the patch code.

    The m32r SMP kernel hanged-up during boot operation, because
    the CPU_BOOT_IPI was called instead of CALL_FUNC_SINGLE_IPI
    (CPU_BOOT_IPI had no side effect at that time because the 2nd
    core had already been started up),
    as a result, csd_unlock() was not called, then a dead lock
    occurred in csd_lock_wait() after the detection of Compact Flash
    memory as IDE generic disk.

    Signed-off-by: Toshihiro HANAWA
    Signed-off-by: Hirokazu Takata

    Toshihiro HANAWA
     
  • In case CONFIG_DISCONTIGMEM is set, the memory size of system was
    always determined by CONFIG_MEMORY_SIZE and was not changeable.

    This patch fixes set_memory() of arch/m32r/mm/discontig.c so that
    we can specify memory size by the "mem=" kernel parameter.

    Signed-off-by: Hirokazu Takata

    Hirokazu Takata
     
  • Add a spinlock variable "rtc_lock".
    This is taken from arch/arm/kernel/time.c.

    Signed-off-by: Hirokazu Takata

    Hirokazu Takata
     
  • Define ioread* and iowrite* macros to fix the following build errors:

    CC [M] drivers/uio/uio_smx.o
    drivers/uio/uio_smx.c: In function 'smx_handler':
    drivers/uio/uio_smx.c:31: error: implicit declaration of function 'ioread32'
    drivers/uio/uio_smx.c:37: error: implicit declaration of function 'iowrite32'

    Signed-off-by: Hirokazu Takata

    Hirokazu Takata
     
  • - Move EXPORT_SYMBOL lines of delay loop functions
    from arch/m32r/kernel/m32r_ksyms.c to arch/m32r/lib/delay.c.
    - Export __ndelay.

    Signed-off-by: Hirokazu Takata

    Hirokazu Takata
     
  • Fix pmd_bad check code of tme_handler (TLB Miss Exception handler).
    The correct _KERNPG_TABLE value is not 0x263(=611) but 0x163.

    Signed-off-by: Hirokazu Takata

    Hirokazu Takata
     

25 Sep, 2009

1 commit

  • * 'for-linus' of git://www.linux-m32r.org/git/takata/linux-2.6_dev:
    m32r: Cleanup linker script using new linker script macros.
    m32r: Move the spi_stack_top and spu_stack_top into .init.data section.
    m32r: Remove unused .altinstructions and .exit.* code from linker script.
    m32r: Move GET_THREAD_INFO definition out of asm/thread_info.h.
    m32r: Define THREAD_SIZE only once.
    m32r: make PAGE_SIZE available to assembly.

    Linus Torvalds
     

24 Sep, 2009

6 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (39 commits)
    cpumask: Move deprecated functions to end of header.
    cpumask: remove unused deprecated functions, avoid accusations of insanity
    cpumask: use new-style cpumask ops in mm/quicklist.
    cpumask: use mm_cpumask() wrapper: x86
    cpumask: use mm_cpumask() wrapper: um
    cpumask: use mm_cpumask() wrapper: mips
    cpumask: use mm_cpumask() wrapper: mn10300
    cpumask: use mm_cpumask() wrapper: m32r
    cpumask: use mm_cpumask() wrapper: arm
    cpumask: Use accessors for cpu_*_mask: um
    cpumask: Use accessors for cpu_*_mask: powerpc
    cpumask: Use accessors for cpu_*_mask: mips
    cpumask: Use accessors for cpu_*_mask: m32r
    cpumask: remove arch_send_call_function_ipi
    cpumask: arch_send_call_function_ipi_mask: s390
    cpumask: arch_send_call_function_ipi_mask: powerpc
    cpumask: arch_send_call_function_ipi_mask: mips
    cpumask: arch_send_call_function_ipi_mask: m32r
    cpumask: arch_send_call_function_ipi_mask: alpha
    cpumask: remove obsolete topology_core_siblings and topology_thread_siblings: ia64
    ...

    Linus Torvalds
     
  • Makes code futureproof against the impending change to mm->cpu_vm_mask.

    It's also a chance to use the new cpumask_ ops which take a pointer
    (the older ones are deprecated, but there's no hurry for arch code).

    Signed-off-by: Rusty Russell
    Acked-by: Hirokazu Takata (fixes)

    Rusty Russell
     
  • Use the accessors rather than frobbing bits directly (the new versions
    are const).

    Signed-off-by: Rusty Russell
    Signed-off-by: Mike Travis

    Rusty Russell
     
  • Now everyone is converted to arch_send_call_function_ipi_mask, remove
    the shim and the #defines.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • We're weaning the core code off handing cpumask's around on-stack.
    This introduces arch_send_call_function_ipi_mask(), and by defining
    it, the old arch_send_call_function_ipi is defined by the core code.

    We also take the chance to wean the implementations off the
    obsolescent for_each_cpu_mask(): making send_ipi_mask take the pointer
    seemed the most natural way to ensure all implementations used
    for_each_cpu.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (30 commits)
    Use macros for .data.page_aligned section.
    Use macros for .bss.page_aligned section.
    Use new __init_task_data macro in arch init_task.c files.
    kbuild: Don't define ALIGN and ENTRY when preprocessing linker scripts.
    arm, cris, mips, sparc, powerpc, um, xtensa: fix build with bash 4.0
    kbuild: add static to prototypes
    kbuild: fail build if recordmcount.pl fails
    kbuild: set -fconserve-stack option for gcc 4.5
    kbuild: echo the record_mcount command
    gconfig: disable "typeahead find" search in treeviews
    kbuild: fix cc1 options check to ensure we do not use -fPIC when compiling
    checkincludes.pl: add option to remove duplicates in place
    markup_oops: use modinfo to avoid confusion with underscored module names
    checkincludes.pl: provide usage helper
    checkincludes.pl: close file as soon as we're done with it
    ctags: usability fix
    kernel hacking: move STRIP_ASM_SYMS from General
    gitignore usr/initramfs_data.cpio.bz2 and usr/initramfs_data.cpio.lzma
    kbuild: Check if linker supports the -X option
    kbuild: introduce ld-option
    ...

    Fix trivial conflict in scripts/basic/fixdep.c

    Linus Torvalds
     

22 Sep, 2009

1 commit

  • This patch is largely a straightforward conversion. One thing to note
    is that the new macros use fewer separate output sections than the old
    code; this should have no functional impact but is relevant for people
    objdumping vmlinux files.

    Also note that it moves the .data.init_task output sections inside
    _edata.

    Signed-off-by: Tim Abbott
    Signed-off-by: Hirokazu Takata

    Tim Abbott