1. 05 12月, 2008 3 次提交
  2. 05 8月, 2008 1 次提交
  3. 18 7月, 2008 1 次提交
    • D
      sparc64: Remove 4MB and 512K base page size options. · f7fe9334
      David S. Miller 提交于
      Adrian Bunk reported that enabling 4MB page size breaks the build.
      The problem is that MAX_ORDER combined with the page shift exceeds the
      SECTION_SIZE_BITS we use in asm-sparc64/sparsemem.h
      
      There are several ways I suppose we could work around this.  For one
      we could define a CONFIG_FORCE_MAX_ZONEORDER to decrease MAX_ORDER in
      these higher page size cases.
      
      But I also know that these page size cases are broken wrt. TLB miss
      handling especially on pre-hypervisor systems, and there isn't an easy
      way to fix that.
      
      These options were meant to be fun experimental hacks anyways, and
      only 8K and 64K make any sense to support.
      
      So remove 512K and 4M base page size support.  Of course, we still
      support these page sizes for huge pages.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7fe9334
  4. 24 4月, 2008 1 次提交
  5. 01 11月, 2007 1 次提交
  6. 20 7月, 2007 1 次提交
    • P
      mm: Remove slab destructors from kmem_cache_create(). · 20c2df83
      Paul Mundt 提交于
      Slab destructors were no longer supported after Christoph's
      c59def9f change. They've been
      BUGs for both slab and slub, and slob never supported them
      either.
      
      This rips out support for the dtor pointer from kmem_cache_create()
      completely and fixes up every single callsite in the kernel (there were
      about 224, not including the slab allocator definitions themselves,
      or the documentation references).
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      20c2df83
  7. 08 5月, 2007 3 次提交
  8. 08 12月, 2006 1 次提交
  9. 22 3月, 2006 1 次提交
  10. 20 3月, 2006 19 次提交
    • D
      [SPARC64]: Optimized TSB table initialization. · bb8646d8
      David S. Miller 提交于
      We only need to write an invalid tag every 16 bytes,
      so taking advantage of this can save many instructions
      compared to the simple memset() call we make now.
      
      A prefetching implementation is implemented for sun4u
      and a block-init store version if implemented for Niagara.
      
      The next trick is to be able to perform an init and
      a copy_tsb() in parallel when growing a TSB table.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb8646d8
    • D
      [SPARC64]: Use SLAB caches for TSB tables. · 9b4006dc
      David S. Miller 提交于
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9b4006dc
    • D
      [SPARC64]: Don't kill the page allocator when growing a TSB. · b52439c2
      David S. Miller 提交于
      Try only lightly on > 1 order allocations.
      
      If a grow fails, we are under memory pressure, so do not try
      to grow the TSB for this address space any more.
      
      If a > 0 order TSB allocation fails on a new fork, retry using
      a 0 order allocation.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b52439c2
    • D
      [SPARC64]: Fix and re-enable dynamic TSB sizing. · 7a1ac526
      David S. Miller 提交于
      This is good for up to %50 performance improvement of some test cases.
      The problem has been the race conditions, and hopefully I've plugged
      them all up here.
      
      1) There was a serious race in switch_mm() wrt. lazy TLB
         switching to and from kernel threads.
      
         We could erroneously skip a tsb_context_switch() and thus
         use a stale TSB across a TSB grow event.
      
         There is a big comment now in that function describing
         exactly how it can happen.
      
      2) All code paths that do something with the TSB need to be
         guarded with the mm->context.lock spinlock.  This makes
         page table flushing paths properly synchronize with both
         TSB growing and TLB context changes.
      
      3) TSB growing events are moved to the end of successful fault
         processing.  Previously it was in update_mmu_cache() but
         that is deadlock prone.  At the end of do_sparc64_fault()
         we hold no spinlocks that could deadlock the TSB grow
         sequence.  We also have dropped the address space semaphore.
      
      While we're here, add prefetching to the copy_tsb() routine
      and put it in assembler into the tsb.S file.  This piece of
      code is quite time critical.
      
      There are some small negative side effects to this code which
      can be improved upon.  In particular we grab the mm->context.lock
      even for the tsb insert done by update_mmu_cache() now and that's
      a bit excessive.  We can get rid of that locking, and the same
      lock taking in flush_tsb_user(), by disabling PSTATE_IE around
      the whole operation including the capturing of the tsb pointer
      and tsb_nentries value.  That would work because anyone growing
      the TSB won't free up the old TSB until all cpus respond to the
      TSB change cross call.
      
      I'm not quite so confident in that optimization to put it in
      right now, but eventually we might be able to and the description
      is here for reference.
      
      This code seems very solid now.  It passes several parallel GCC
      bootstrap builds, and our favorite "nut cruncher" stress test which is
      a full "make -j8192" build of a "make allmodconfig" kernel.  That puts
      about 256 processes on each cpu's run queue, makes lots of process cpu
      migrations occur, causes lots of page table and TLB flushing activity,
      incurs many context version number changes, and it swaps the machine
      real far out to disk even though there is 16GB of ram on this test
      system. :-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a1ac526
    • D
      [SPARC64]: Bulletproof MMU context locking. · a77754b4
      David S. Miller 提交于
      1) Always spin_lock_init() in init_context().  The caller essentially
         clears it out, or copies the mm info from the parent.  In both
         cases we need to explicitly initialize the spinlock.
      
      2) Always do explicit IRQ disabling while taking mm->context.lock
         and ctx_alloc_lock.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a77754b4
    • D
      [SPARC64]: destroy_context() needs to disable interrupts. · 77b838fa
      David S. Miller 提交于
      get_new_mmu_context() can be invoked from interrupt context
      now for the new SMP version wrap handling.
      
      So disable interrupt while taking ctx_alloc_lock in destroy_context()
      so we don't deadlock.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      77b838fa
    • D
      [SPARC64]: More TLB/TSB handling fixes. · 8b234274
      David S. Miller 提交于
      The SUN4V convention with non-shared TSBs is that the context
      bit of the TAG is clear.  So we have to choose an "invalid"
      bit and initialize new TSBs appropriately.  Otherwise a zero
      TAG looks "valid".
      
      Make sure, for the window fixup cases, that we use the right
      global registers and that we don't potentially trample on
      the live global registers in etrap/rtrap handling (%g2 and
      %g6) and that we put the missing virtual address properly
      in %g5.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8b234274
    • D
      [SPARC64]: Fix flush_tsb_user() on SUN4V. · de635d83
      David S. Miller 提交于
      Needs to use physical addressing just like cheetah_plus.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de635d83
    • D
      [SPARC64]: Deal with PTE layout differences in SUN4V. · c4bce90e
      David S. Miller 提交于
      Yes, you heard it right, they changed the PTE layout for
      SUN4V.  Ho hum...
      
      This is the simple and inefficient way to support this.
      It'll get optimized, don't worry.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4bce90e
    • D
    • D
      618e9ed9
    • D
      [SPARC64]: Turn off TSB growing for now. · f4e841da
      David S. Miller 提交于
      There are several tricky races involved with growing the TSB.  So just
      use base-size TSBs for user contexts and we can revisit enabling this
      later.
      
      One part of the SMP problems is that tsb_context_switch() can see
      partially updated TSB configuration state if tsb_grow() is running in
      parallel.  That's easily solved with a seqlock taken as a writer by
      tsb_grow() and taken as a reader to capture all the TSB config state
      in tsb_context_switch().
      
      Then there is flush_tsb_user() running in parallel with a tsb_grow().
      In theory we could take the seqlock as a reader there too, and just
      resample the TSB pointer and reflush but that looks really ugly.
      
      Lastly, I believe there is a case with threads that results in a TSB
      entry lock bit being set spuriously which will cause the next access
      to that TSB entry to wedge the cpu (since the TSB entry lock bit will
      never clear).  It's either copy_tsb() or some bug elsewhere in the TSB
      assembly.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4e841da
    • D
      [SPARC64]: Access TSB with physical addresses when possible. · 517af332
      David S. Miller 提交于
      This way we don't need to lock the TSB into the TLB.
      The trick is that every TSB load/store is registered into
      a special instruction patch section.  The default uses
      virtual addresses, and the patch instructions use physical
      address load/stores.
      
      We can't do this on all chips because only cheetah+ and later
      have the physical variant of the atomic quad load.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      517af332
    • D
      2f7ee7c6
    • D
      [SPARC64]: Fix incorrect TSB lock bit handling. · 4753eb2a
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      4753eb2a
    • D
      [SPARC64]: Dynamically grow TSB in response to RSS growth. · bd40791e
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      bd40791e
    • D
      [SPARC64]: Add infrastructure for dynamic TSB sizing. · 98c5584c
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      98c5584c
    • D
      [SPARC64]: TSB refinements. · 09f94287
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      09f94287
    • D
      [SPARC64]: Move away from virtual page tables, part 1. · 74bf4312
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      74bf4312