1. 20 Mar, 2006 16 commits
    • David S. Miller's avatar
      [SPARC64]: Fix bogus flush instruction usage. · 4da808c3
      David S. Miller authored
      Some of the trap code was still assuming that alternate
      global %g6 was hard coded with current_thread_info().
      Let's just consistently flush at KERNBASE when we need
      a pipeline synchronization.  That's locked into the TLB
      and will always work.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4da808c3
    • David S. Miller's avatar
      [SPARC64]: Fix incorrect TSB lock bit handling. · 4753eb2a
      David S. Miller authored
      The TSB_LOCK_BIT define is actually a special
      value shifted down by 32-bits for the assembler
      code macros.
      
      In C code, this isn't what we want.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4753eb2a
    • David S. Miller's avatar
      [SPARC64]: Kill {save,restore}_alternate_globals() · 96c6e0d8
      David S. Miller authored
      No longer needed now that we no longer have hard-coded
      alternate global register usage.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      96c6e0d8
    • David S. Miller's avatar
    • David S. Miller's avatar
      [SPARC64]: Dynamically grow TSB in response to RSS growth. · bd40791e
      David S. Miller authored
      As the RSS grows, grow the TSB in order to reduce the likelyhood
      of hash collisions and thus poor hit rates in the TSB.
      
      This definitely needs some serious tuning.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd40791e
    • David S. Miller's avatar
      [SPARC64]: Add infrastructure for dynamic TSB sizing. · 98c5584c
      David S. Miller authored
      This also cleans up tsb_context_switch().  The assembler
      routine is now __tsb_context_switch() and the former is
      an inline function that picks out the bits from the mm_struct
      and passes it into the assembler code as arguments.
      
      setup_tsb_parms() computes the locked TLB entry to map the
      TSB.  Later when we support using the physical address quad
      load instructions of Cheetah+ and later, we'll simply use
      the physical address for the TSB register value and set
      the map virtual and PTE both to zero.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      98c5584c
    • David S. Miller's avatar
      [SPARC64]: TSB refinements. · 09f94287
      David S. Miller authored
      Move {init_new,destroy}_context() out of line.
      
      Do not put huge pages into the TSB, only base page size translations.
      There are some clever things we could do here, but for now let's be
      correct instead of fancy.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09f94287
    • David S. Miller's avatar
      [SPARC64]: Elminate all usage of hard-coded trap globals. · 56fb4df6
      David S. Miller authored
      UltraSPARC has special sets of global registers which are switched to
      for certain trap types.  There is one set for MMU related traps, one
      set of Interrupt Vector processing, and another set (called the
      Alternate globals) for all other trap types.
      
      For what seems like forever we've hard coded the values in some of
      these trap registers.  Some examples include:
      
      1) Interrupt Vector global %g6 holds current processors interrupt
         work struct where received interrupts are managed for IRQ handler
         dispatch.
      
      2) MMU global %g7 holds the base of the page tables of the currently
         active address space.
      
      3) Alternate global %g6 held the current_thread_info() value.
      
      Such hardcoding has resulted in some serious issues in many areas.
      There are some code sequences where having another register available
      would help clean up the implementation.  Taking traps such as
      cross-calls from the OBP firmware requires some trick code sequences
      wherein we have to save away and restore all of the special sets of
      global registers when we enter/exit OBP.
      
      We were also using the IMMU TSB register on SMP to hold the per-cpu
      area base address, which doesn't work any longer now that we actually
      use the TSB facility of the cpu.
      
      The implementation is pretty straight forward.  One tricky bit is
      getting the current processor ID as that is different on different cpu
      variants.  We use a stub with a fancy calling convention which we
      patch at boot time.  The calling convention is that the stub is
      branched to and the (PC - 4) to return to is in register %g1.  The cpu
      number is left in %g6.  This stub can be invoked by using the
      __GET_CPUID macro.
      
      We use an array of per-cpu trap state to store the current thread and
      physical address of the current address space's page tables.  The
      TRAP_LOAD_THREAD_REG loads %g6 with the current thread from this
      table, it uses __GET_CPUID and also clobbers %g1.
      
      TRAP_LOAD_IRQ_WORK is used by the interrupt vector processing to load
      the current processor's IRQ software state into %g6.  It also uses
      __GET_CPUID and clobbers %g1.
      
      Finally, TRAP_LOAD_PGD_PHYS loads the physical address base of the
      current address space's page tables into %g7, it clobbers %g1 and uses
      __GET_CPUID.
      
      Many refinements are possible, as well as some tuning, with this stuff
      in place.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      56fb4df6
    • David S. Miller's avatar
      [SPARC64]: Kill pgtable quicklists and use SLAB. · 3c936465
      David S. Miller authored
      Taking a nod from the powerpc port.
      
      With the per-cpu caching of both the page allocator and SLAB, the
      pgtable quicklist scheme becomes relatively silly and primitive.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c936465
    • David S. Miller's avatar
      [SPARC64]: No need to D-cache color page tables any longer. · 05e28f9d
      David S. Miller authored
      Unlike the virtual page tables, the new TSB scheme does not
      require this ugly hack.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05e28f9d
    • David S. Miller's avatar
      [SPARC64]: Move away from virtual page tables, part 1. · 74bf4312
      David S. Miller authored
      We now use the TSB hardware assist features of the UltraSPARC
      MMUs.
      
      SMP is currently knowingly broken, we need to find another place
      to store the per-cpu base pointers.  We hid them away in the TSB
      base register, and that obviously will not work any more :-)
      
      Another known broken case is non-8KB base page size.
      
      Also noticed that flush_tlb_all() is not referenced anywhere, only
      the internal __flush_tlb_all() (local cpu only) is used by the
      sparc64 port, so we can get rid of flush_tlb_all().
      
      The kernel gets it's own 8KB TSB (swapper_tsb) and each address space
      gets it's own private 8K TSB.  Later we can add code to dynamically
      increase the size of per-process TSB as the RSS grows.  An 8KB TSB is
      good enough for up to about a 4MB RSS, after which the TSB starts to
      incur many capacity and conflict misses.
      
      We even accumulate OBP translations into the kernel TSB.
      
      Another area for refinement is large page size support.  We could use
      a secondary address space TSB to handle those.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      74bf4312
    • Eric Sesterhenn's avatar
      [SPARC]: BUG_ON() Conversion in arch/sparc/kernel/ioport.c · 30d4d1ff
      Eric Sesterhenn authored
      this changes if() BUG(); constructs to BUG_ON() which is
      cleaner and can better optimized away
      Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      30d4d1ff
    • Bernhard R Link's avatar
      [SPARC64]: fix sparc_floppy_irq's auxio_register reseting · 94bbc176
      Bernhard R Link authored
      The patch "[SPARC64]: Get rid of fast IRQ feature"
      moved the the code from arch/sparc64/kernel/entry.S:
            lduba           [%g7] ASI_PHYS_BYPASS_EC_E, %g5
            or              %g5, AUXIO_AUX1_FTCNT, %g5
            stba            %g5, [%g7] ASI_PHYS_BYPASS_EC_E
            andn            %g5, AUXIO_AUX1_FTCNT, %g5
            stba            %g5, [%g7] ASI_PHYS_BYPASS_EC_E
      to arch/sparc64/kernel/irq.c:
                    val = readb(auxio_register);
                    val |= AUXIO_AUX1_FTCNT;
                    writeb(val, auxio_register);
                    val &= AUXIO_AUX1_FTCNT;
                    writeb(val, auxio_register);
      This looks like it it missing a bitwise not, which is reintroduced
      by this patch.
      
      Due to lack of a floppy device, I could not test it, but it looks
      evident.
      Signed-off-by: default avatarBernhard R Link <brlink@debian.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94bbc176
    • Linus Torvalds's avatar
      Linux 2.6.16 · 7705a879
      Linus Torvalds authored
      7705a879
    • Andrea Arcangeli's avatar
      [PATCH] Remove obsolete CREDITS address · 2be1aaf9
      Andrea Arcangeli authored
      This address is going to be obsolete, so I should update it.
      2be1aaf9
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus · 46571909
      Linus Torvalds authored
      * 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
        [MIPS] SB1: Check for -mno-sched-prolog if building corelis debug kernel.
        [MIPS] Sibyte: Fix race in sb1250_gettimeoffset().
        [MIPS] Sibyte: Fix interrupt timer off by one bug.
        [MIPS] Sibyte: Fix M_SCD_TIMER_INIT and M_SCD_TIMER_CNT wrong field width.
        [MIPS] Protect more of timer_interrupt() by xtime_lock.
        [MIPS] Work around bad code generation for <asm/io.h>.
        [MIPS] Simple patch to power off DBAU1200
        [MIPS] Fix DBAu1550 software power off.
        [MIPS] local_r4k_flush_cache_page fix
        [MIPS] SB1: Fix interrupt disable hazard.
        [MIPS] Get rid of the IP22-specific code in arclib.
        Update MAINTAINERS entry for MIPS.
      46571909
  2. 19 Mar, 2006 2 commits
    • Michael Chan's avatar
      [TG3]: 40-bit DMA workaround part 2 · 4a29cc2e
      Michael Chan authored
      The 40-bit DMA workaround recently implemented for 5714, 5715, and
      5780 needs to be expanded because there may be other tg3 devices
      behind the EPB Express to PCIX bridge in the 5780 class device.
      
      For example, some 4-port card or mother board designs have 5704 behind
      the 5714.
      
      All devices behind the EPB require the 40-bit DMA workaround.
      
      Thanks to Chris Elmquist again for reporting the problem and testing
      the patch.
      Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a29cc2e
    • Ralf Baechle DL5RB's avatar
      [AX.25]: Fix potencial memory hole. · c7c694d1
      Ralf Baechle DL5RB authored
      If the AX.25 dialect chosen by the sysadmin is set to DAMA master / 3
      (or DAMA slave / 2, if CONFIG_AX25_DAMA_SLAVE=n) ax25_kick() will fall
      through the switch statement without calling ax25_send_iframe() or any
      other function that would eventually free skbn thus leaking the packet.
      
      Fix by restricting the sysctl inferface to allow only actually supported
      AX.25 dialects.
      
      The system administration mistake needed for this to happen is rather
      unlikely, so this is an uncritical hole.
      
      Coverity #651.
      Signed-off-by: default avatarRalf Baechle DL5RB <ralf@linux-mips.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c7c694d1
  3. 18 Mar, 2006 16 commits
  4. 17 Mar, 2006 6 commits
    • Hugh Dickins's avatar
      [PATCH] fix free swap cache latency · 6f5e6b9e
      Hugh Dickins authored
      Lee Revell reported 28ms latency when process with lots of swapped memory
      exits.
      
      2.6.15 introduced a latency regression when unmapping: in accounting the
      zap_work latency breaker, pte_none counted 1, pte_present PAGE_SIZE, but a
      swap entry counted nothing at all.  We think of pages present as the slow
      case, but Lee's trace shows that free_swap_and_cache's radix tree lookup
      can make a lot of work - and we could have been doing it many thousands of
      times without a latency break.
      
      Move the zap_work update up to account swap entries like pages present.
      This does account non-linear pte_file entries, and unmap_mapping_range
      skipping over swap entries, by the same amount even though they're quick:
      but neither of those cases deserves complicating the code (and they're
      treated no worse than they were in 2.6.14).
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Acked-by: default avatarNick Piggin <npiggin@suse.de>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6f5e6b9e
    • Sam Ravnborg's avatar
      [PATCH] kbuild: fix buffer overflow in modpost · 7670f023
      Sam Ravnborg authored
      Jiri Benc <jbenc@suse.cz> reported that modpost would stop with SIGABRT if
      used with long filepaths.
      The error looked like:
      >   Building modules, stage 2.
      >   MODPOST
      > *** glibc detected *** scripts/mod/modpost: realloc(): invalid next size:
      +0x0809f588 ***
      > [...]
      
      Fix this by allocating at least the required memory + SZ bytes each time.
      Before we sometimes ended up allocating too little memory resuting in the
      glibc detected bug above.  Based on patch originally submitted by: Jiri
      Benc <jbenc@suse.cz>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      7670f023
    • Peter Staubach's avatar
      [PATCH] nfsservctl(): remove user-triggerable printk · 85c6932e
      Peter Staubach authored
      A user can use nfsservctl() to spam the logs.
      
      This can happen because the arguments to the nfsservctl() system call are
      versioned.  This is a good thing.  However, when a bad version is detected,
      the kernel prints a message and then returns an error.
      Signed-off-by: default avatarPeter Staubach <staubach@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Neil Brown <neilb@cse.unsw.edu.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      85c6932e
    • Christoph Lameter's avatar
      [PATCH] fix race in pagevec_strip? · 5b40dc78
      Christoph Lameter authored
      We can call try_to_release_page() with PagePrivate off and a valid
      page->mapping This may cause all sorts of trouble for the filesystem
      *_releasepage() handlers.  XFS bombs out in that case.
      
      Lock the page before checking for page private.
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      5b40dc78
    • Kevin Corry's avatar
      [PATCH] dm stripe: Fix bounds · 8ba32fde
      Kevin Corry authored
      The dm-stripe target currently does not enforce that the size of a stripe
      device be a multiple of the chunk-size.  Under certain conditions, this can
      lead to I/O requests going off the end of an underlying device.  This
      test-case shows one example.
      
      echo "0 100 linear /dev/hdb1 0" | dmsetup create linear0
      echo "0 100 linear /dev/hdb1 100" | dmsetup create linear1
      echo "0 200 striped 2 32 /dev/mapper/linear0 0 /dev/mapper/linear1 0" | \
         dmsetup create stripe0
      dd if=/dev/zero of=/dev/mapper/stripe0 bs=1k
      
      This will produce the output:
      dd: writing '/dev/mapper/stripe0': Input/output error
      97+0 records in
      96+0 records out
      
      And in the kernel log will be:
      attempt to access beyond end of device
      dm-0: rw=0, want=104, limit=100
      
      The patch will check that the table size is a multiple of the stripe
      chunk-size when the table is created, which will prevent the above striped
      device from being created.
      
      This should not affect tools like LVM or EVMS, since in all the cases I can
      think of, striped devices are always created with the sizes being a
      multiple of the chunk-size.
      
      The size of a stripe device must be a multiple of its chunk-size.
      
      (akpm: that typecast is quite gratuitous)
      Signed-off-by: default avatarKevin Corry <kevcorry@us.ibm.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8ba32fde
    • Srivatsa Vaddagiri's avatar
      [PATCH] x86: check for online cpus before bringing them up · 82c3c03a
      Srivatsa Vaddagiri authored
      Bryce reported a bug wherein offlining CPU0 (on x86 box) and then
      subsequently onlining it resulted in a lockup.
      
      On x86, CPU0 is never offlined.  The subsequent attempt to online CPU0
      doesn't take that into account.  It actually tries to bootup the already
      booted CPU.  Following patch fixes the problem (as acknowledged by Bryce).
      Please consider for inclusion in 2.6.16.
      
      Check if cpu is already online.
      Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@in.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      82c3c03a