16 Jan, 2006

1 commit


12 Jan, 2006

1 commit


11 Jan, 2006

1 commit


10 Jan, 2006

1 commit

  • Add three (generic) mutex fastpath implementations.

    The mutex-xchg.h implementation is atomic_xchg() based, and should
    work fine on every architecture.

    The mutex-dec.h implementation is atomic_dec_return() based - this
    one too should work on every architecture, but might not perform the
    most optimally on architectures that have no atomic-dec/inc instructions.

    The mutex-null.h implementation forces all calls into the slowpath. This
    is used for mutex debugging, but it can also be used on platforms that do
    not want (or need) a fastpath at all.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Arjan van de Ven

    Ingo Molnar
     

09 Jan, 2006

3 commits

  • Most of the architectures have the same asm/futex.h. This consolidates them
    into asm-generic, with the arches including it from their own asm/futex.h.

    In the case of UML, this reverts the old broken futex.h and goes back to using
    the same one as almost everyone else.

    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     
  • Kill L1_CACHE_SHIFT from all arches. Since L1_CACHE_SHIFT_MAX is not used
    anymore with the introduction of INTERNODE_CACHE, kill L1_CACHE_SHIFT_MAX.

    Signed-off-by: Ravikiran Thirumalai
    Signed-off-by: Shai Fultheim
    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ravikiran G Thirumalai
     
  • For BITS_PER_LONG

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

07 Jan, 2006

2 commits

  • Generic prep-work for marking the .rodata section readonly:
    * Align the rodata section at 4Kb boundary
    * call the mark_rodata_ro() function when available

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Signed-off-by: Adrian Bunk
    Cc: Andi Kleen
    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Several counters already have the need to use 64 atomic variables on 64 bit
    platforms (see mm_counter_t in sched.h). We have to do ugly ifdefs to fall
    back to 32 bit atomic on 32 bit platforms.

    The VM statistics patch that I am working on will also make more extensive
    use of atomic64.

    This patch introduces a new type atomic_long_t by providing definitions in
    asm-generic/atomic.h that works similar to the c "long" type. Its 32 bits
    on 32 bit platforms and 64 bits on 64 bit platforms.

    Also cleans up the determination of the mm_counter_t in sched.h.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

04 Jan, 2006

1 commit


15 Nov, 2005

2 commits


07 Nov, 2005

2 commits

  • Adds a RapidIO subsystem to the kernel. RIO is a switched fabric interconnect
    used in higher-end embedded applications. The curious can look at the specs
    over at http://www.rapidio.org

    The core code implements enumeration/discovery, management of
    devices/resources, and interfaces for RIO drivers.

    There's a lot more to do to take advantages of all the hardware features.
    However, this should provide a good base for folks with RIO hardware to start
    contributing.

    Signed-off-by: Matt Porter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Porter
     
  • Fix more include file problems that surfaced since I submitted the previous
    fix-missing-includes.patch. This should now allow not to include sched.h
    from module.h, which is done by a followup patch.

    Signed-off-by: Tim Schmielau
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

30 Oct, 2005

5 commits

  • Updated several references to page_table_lock in common code comments.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • It seems odd to me that, whereas pud_alloc and pmd_alloc test inline, only
    calling out-of-line __pud_alloc __pmd_alloc if allocation needed,
    pte_alloc_map and pte_alloc_kernel are entirely out-of-line. Though it does
    add a little to kernel size, change them to macros testing inline, calling
    __pte_alloc or __pte_alloc_kernel to allocate out-of-line. Mark none of them
    as fastcalls, leave that to CONFIG_REGPARM or not.

    It also seems more natural for the out-of-line functions to leave the offset
    calculation and map to the inline, which has to do it anyway for the common
    case. At least mremap move wants __pte_alloc without _map.

    Macros rather than inline functions, certainly to avoid the header file issues
    which arise from CONFIG_HIGHPTE needing kmap_types.h, but also in case any
    architectures I haven't built would have other such problems.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • zap_pte_range has been counting the pages it frees in tlb->freed, then
    tlb_finish_mmu has used that to update the mm's rss. That got stranger when I
    added anon_rss, yet updated it by a different route; and stranger when rss and
    anon_rss became mm_counters with special access macros. And it would no
    longer be viable if we're relying on page_table_lock to stabilize the
    mm_counter, but calling tlb_finish_mmu outside that lock.

    Remove the mmu_gather's freed field, let tlb_finish_mmu stick to its own
    business, just decrement the rss mm_counter in zap_pte_range (yes, there was
    some point to batching the update, and a subsequent patch restores that). And
    forget the anal paranoia of first reading the counter to avoid going negative
    - if rss does go negative, just fix that bug.

    Remove the mmu_gather's flushes and avoided_flushes from arm and arm26: no use
    was being made of them. But arm26 alone was actually using the freed, in the
    way some others use need_flush: give it a need_flush. arm26 seems to prefer
    spaces to tabs here: respect that.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • tlb_is_full_mm? What does that mean? The TLB is full? No, it means that the
    mm's last user has gone and the whole mm is being torn down. And it's an
    inline function because sparc64 uses a different (slightly better)
    "tlb_frozen" name for the flag others call "fullmm".

    And now the ptep_get_and_clear_full macro used in zap_pte_range refers
    directly to tlb->fullmm, which would be wrong for sparc64. Rather than
    correct that, I'd prefer to scrap tlb_is_full_mm altogether, and change
    sparc64 to just use the same poor name as everyone else - is that okay?

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • tlb_gather_mmu dates from before kernel preemption was allowed, and uses
    smp_processor_id or __get_cpu_var to find its per-cpu mmu_gather. That works
    because it's currently only called after getting page_table_lock, which is not
    dropped until after the matching tlb_finish_mmu. But don't rely on that, it
    will soon change: now disable preemption internally by proper get_cpu_var in
    tlb_gather_mmu, put_cpu_var in tlb_finish_mmu.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     

28 Oct, 2005

1 commit


09 Oct, 2005

1 commit

  • - added typedef unsigned int __nocast gfp_t;

    - replaced __nocast uses for gfp flags with gfp_t - it gives exactly
    the same warnings as far as sparse is concerned, doesn't change
    generated code (from gcc point of view we replaced unsigned int with
    typedef) and documents what's going on far better.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

28 Sep, 2005

1 commit

  • Move the ZERO_PAGE remapping complexity to the move_pte macro in
    asm-generic, have it conditionally depend on
    __HAVE_ARCH_MULTIPLE_ZERO_PAGE, which gets defined for MIPS.

    For architectures without __HAVE_ARCH_MULTIPLE_ZERO_PAGE, move_pte becomes
    a noop.

    From: Hugh Dickins

    Fix nasty little bug we've missed in Nick's mremap move ZERO_PAGE patch.
    The "pte" at that point may be a swap entry or a pte_file entry: we must
    check pte_present before perhaps corrupting such an entry.

    Patch below against 2.6.14-rc2-mm1, but the same bug is in 2.6.14-rc2's
    mm/mremap.c, and more dangerous there since it's affecting all arches: I
    think the safest course is to send Nick's patch and Yoichi's build fix and
    this fix (build tested) on to Linus - so only MIPS can be affected.

    Signed-off-by: Nick Piggin
    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

13 Sep, 2005

1 commit

  • The generic TLB flush functions kept upto 506 pages per
    CPU to avoid too frequent IPIs.

    This value was done for the L1 cache of older x86 CPUs,
    but with modern CPUs it does not make much sense anymore.
    TLB flushing is slow enough that using the L2 cache is fine.

    This patch increases the flush array on x86-64 to cache
    5350 pages. That is roughly 20MB with 4K pages. It speeds
    up large munmaps in multithreaded processes on SMP considerably.

    The cost is roughly 42k of memory per CPU, which is reasonable.

    I only increased it on x86-64 for now, but it would probably
    make sense to increase it everywhere. Embedded architectures
    with SMP may keep it smaller to save some memory per CPU.

    Signed-off-by: Andi Kleen
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

11 Sep, 2005

1 commit

  • Inside the linker script, insert the code for DWARF debug info sections. This
    may help GDB'ing a Uml binary. Actually, it seems that ld is able to guess
    what I added correctly, but normal linker scripts include this section so it
    should be correct anyway adding it.

    On request by Sam Ravnborg , I've added it to
    asm-generic/vmlinux.lds.s. I've also moved there the stabs debug section,
    used the new macro in i386 linker script and added DWARF debug section to
    that.

    In the truth, I've not been able to verify the difference in GDB behaviour
    after this change (I've seen large improvements with another patch). This
    may depend on my binutils version, older one may have worse defaults.

    However, this section is present in normal linker script, so add it at
    least for the sake of cleanness.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Acked-by: Sam Ravnborg
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     

09 Sep, 2005

1 commit

  • There were three changes necessary in order to allow
    sparc64 to use setup-res.c:

    1) Sparc64 roots the PCI I/O and MEM address space using
    parent resources contained in the PCI controller structure.
    I'm actually surprised no other platforms do this, especially
    ones like Alpha and PPC{,64}. These resources get linked into the
    iomem/ioport tree when PCI controllers are probed.

    So the hierarchy looks like this:

    iomem --|
    PCI controller 1 MEM space --|
    device 1
    device 2
    etc.
    PCI controller 2 MEM space --|
    ...
    ioport --|
    PCI controller 1 IO space --|
    ...
    PCI controller 2 IO space --|
    ...

    You get the idea. The drivers/pci/setup-res.c code allocates
    using plain iomem_space and ioport_space as the root, so that
    wouldn't work with the above setup.

    So I added a pcibios_select_root() that is used to handle this.
    It uses the PCI controller struct's io_space and mem_space on
    sparc64, and io{port,mem}_resource on every other platform to
    keep current behavior.

    2) quirk_io_region() is buggy. It takes in raw BUS view addresses
    and tries to use them as a PCI resource.

    pci_claim_resource() expects the resource to be fully formed when
    it gets called. The sparc64 implementation would do the translation
    but that's absolutely wrong, because if the same resource gets
    released then re-claimed we'll adjust things twice.

    So I fixed up quirk_io_region() to do the proper pcibios_bus_to_resource()
    conversion before passing it on to pci_claim_resource().

    3) I was mistakedly __init'ing the function methods the PCI controller
    drivers provide on sparc64 to implement some parts of these
    routines. This was, of course, easy to fix.

    So we end up with the following, and that nasty SPARC64 makefile
    ifdef in drivers/pci/Makefile is finally zapped.

    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    David S. Miller
     

08 Sep, 2005

8 commits

  • There are possible race conditions if probes are placed on routines within the
    kprobes files and routines used by the kprobes. For example if you put probe
    on get_kprobe() routines, the system can hang while inserting probes on any
    routine such as do_fork(). Because while inserting probes on do_fork(),
    register_kprobes() routine grabs the kprobes spin lock and executes
    get_kprobe() routine and to handle probe of get_kprobe(), kprobes_handler()
    gets executed and tries to grab kprobes spin lock, and spins forever. This
    patch avoids such possible race conditions by preventing probes on routines
    within the kprobes file and routines used by kprobes.

    I have modified the patches as per Andi Kleen's suggestion to move kprobes
    routines and other routines used by kprobes to a seperate section
    .kprobes.text.

    Also moved page fault and exception handlers, general protection fault to
    .kprobes.text section.

    These patches have been tested on i386, x86_64 and ppc64 architectures, also
    compiled on ia64 and sparc64 architectures.

    Signed-off-by: Prasanna S Panchamukhi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Prasanna S Panchamukhi
     
  • This patch gathers all the struct flock64 definitions (and the operations),
    puts them under !CONFIG_64BIT and cleans up the arch files.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • This patch just gathers together all the struct flock definitions except
    xtensa into asm-generic/fcntl.h.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • This patch puts the most popular of each fcntl operation/flag into
    asm-generic/fcntl.h and cleans up the arch files.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • This patch puts the most popular of each open flag into asm-generic/fcntl.h
    and cleans up the arch files.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • This set of patches creates asm-generic/fcntl.h and consolidates as much as
    possible from the asm-*/fcntl.h files into it.

    This patch just gathers all the identical bits of the asm-*/fcntl.h files into
    asm-generic/fcntl.h.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Yoichi Yuasa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • I've rewriten Atushi's fix for the 64-bit put_unaligned on 32-bit systems
    bug to generate more efficient code.

    This case has buzilla URL http://bugzilla.kernel.org/show_bug.cgi?id=5138.

    Signed-off-by: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • unused and useless..

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

06 Sep, 2005

1 commit


05 Sep, 2005

2 commits

  • Add a new accessor for PTEs, which passes the full hint from the mmu_gather
    struct; this allows architectures with hardware pagetables to optimize away
    atomic PTE operations when destroying an address space. Removing the
    locked operation should allow better pipelining of memory access in this
    loop. I measured an average savings of 30-35 cycles per zap_pte_range on
    the first 500 destructions on Pentium-M, but I believe the optimization
    would win more on older processors which still assert the bus lock on xchg
    for an exclusive cacheline.

    Update: I made some new measurements, and this saves exactly 26 cycles over
    ptep_get_and_clear on Pentium M. On P4, with a PAE kernel, this saves 180
    cycles per ptep_get_and_clear, for a whopping 92160 cycles savings for a
    full address space destruction.

    pte_clear_full is not yet used, but is provided for future optimizations
    (in particular, when running inside of a hypervisor that queues page table
    updates, the full hint allows us to avoid queueing unnecessary page table
    update for an address space in the process of being destroyed.

    This is not a huge win, but it does help a bit, and sets the stage for
    further hypervisor optimization of the mm layer on all architectures.

    Signed-off-by: Zachary Amsden
    Cc: Christoph Lameter
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zachary Amsden
     
  • Someone mentioned that almost all the architectures used basically the same
    implementation of get_order. This patch consolidates them into
    asm-generic/page.h and includes that in the appropriate places. The
    exceptions are ia64 and ppc which have their own (presumably optimised)
    versions.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     

05 Aug, 2005

1 commit

  • In yenta_socket, we default to using the resource setting of the CardBus
    bridge. However, this is a PCI-bus-centric view of resources and thus needs
    to be converted to generic resources first. Therefore, add a call to
    pcibios_bus_to_resource() call in between. This function is a mere wrapper on
    x86 and friends, however on some others it already exists, is added in this
    patch (alpha, arm, ppc, ppc64) or still needs to be provided (parisc -- where
    is its pcibios_resource_to_bus() ?).

    Signed-off-by: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Linus Torvalds

    Dominik Brodowski
     

29 Jul, 2005

1 commit

  • Minor cleanup.

    Move things into their include files, remove obsolete includes, fix
    indentation, remove obsolete special cases etc.

    I also added the per cpu section to asm-generic/sections.h and fixed
    init/main.c to use it.

    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

27 Jul, 2005

1 commit

  • When the kernel is working well and we want to restart cleanly
    kernel_restart is the function to use. But in many instances
    the kernel wants to reboot when thing are expected to be working
    very badly such as from panic or a software watchdog handler.

    This patch adds the function emergency_restart() so that
    callers can be clear what semantics they expect when calling
    restart. emergency_restart() is expected to be callable
    from interrupt context and possibly reliable in even more
    trying circumstances.

    This is an initial generic implementation for all architectures.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

15 Jul, 2005

1 commit

  • Several reports on inconsistent kallsyms data has been caused by the aliased symbols
    __sched_text_start and __down to shift places in the output of nm.
    The root cause was that on second pass ld aligned __sched_text_start to a 4 byte boundary
    which is the function alignment on i386.
    sched.text and spinlock.text is now aligned to an 8 byte boundary to make sure they
    are aligned to a function alignemnt on most (all?) archs.

    Tested by: Paulo Marques
    Tested by: Alexander Stohr

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg