1. 19 Jan, 2006 14 commits
    • Christoph Lameter's avatar
      [PATCH] NUMA policies in the slab allocator V2 · dc85da15
      Christoph Lameter authored
      This patch fixes a regression in 2.6.14 against 2.6.13 that causes an
      imbalance in memory allocation during bootup.
      
      The slab allocator in 2.6.13 is not numa aware and simply calls
      alloc_pages().  This means that memory policies may control the behavior of
      alloc_pages().  During bootup the memory policy is set to MPOL_INTERLEAVE
      resulting in the spreading out of allocations during bootup over all
      available nodes.  The slab allocator in 2.6.13 has only a single list of
      slab pages.  As a result the per cpu slab cache and the spinlock controlled
      page lists may contain slab entries from off node memory.  The slab
      allocator in 2.6.13 makes no effort to discern the locality of an entry on
      its lists.
      
      The NUMA aware slab allocator in 2.6.14 controls locality of the slab pages
      explicitly by calling alloc_pages_node().  The NUMA slab allocator manages
      slab entries by having lists of available slab pages for each node.  The
      per cpu slab cache can only contain slab entries associated with the node
      local to the processor.  This guarantees that the default allocation mode
      of the slab allocator always assigns local memory if available.
      
      Setting MPOL_INTERLEAVE as a default policy during bootup has no effect
      anymore.  In 2.6.14 all node unspecific slab allocations are performed on
      the boot processor.  This means that most of key data structures are
      allocated on one node.  Most processors will have to refer to these
      structures making the boot node a potential bottleneck.  This may reduce
      performance and cause unnecessary memory pressure on the boot node.
      
      This patch implements NUMA policies in the slab layer.  There is the need
      of explicit application of NUMA memory policies by the slab allcator itself
      since the NUMA slab allocator does no longer let the page_allocator control
      locality.
      
      The check for policies is made directly at the beginning of __cache_alloc
      using current->mempolicy.  The memory policy is already frequently checked
      by the page allocator (alloc_page_vma() and alloc_page_current()).  So it
      is highly likely that the cacheline is present.  For MPOL_INTERLEAVE
      kmalloc() will spread out each request to one node after another so that an
      equal distribution of allocations can be obtained during bootup.
      
      It is not possible to push the policy check to lower layers of the NUMA
      slab allocator since the per cpu caches are now only containing slab
      entries from the current node.  If the policy says that the local node is
      not to be preferred or forbidden then there is no point in checking the
      slab cache or local list of slab pages.  The allocation better be directed
      immediately to the lists containing slab entries for the allowed set of
      nodes.
      
      This way of applying policy also fixes another strange behavior in 2.6.13.
      alloc_pages() is controlled by the memory allocation policy of the current
      process.  It could therefore be that one process is running with
      MPOL_INTERLEAVE and would f.e.  obtain a new page following that policy
      since no slab entries are in the lists anymore.  A page can typically be
      used for multiple slab entries but lets say that the current process is
      only using one.  The other entries are then added to the slab lists.  These
      are now non local entries in the slab lists despite of the possible
      availability of local pages that would provide faster access and increase
      the performance of the application.
      
      Another process without MPOL_INTERLEAVE may now run and expect a local slab
      entry from kmalloc().  However, there are still these free slab entries
      from the off node page obtained from the other process via MPOL_INTERLEAVE
      in the cache.  The process will then get an off node slab entry although
      other slab entries may be available that are local to that process.  This
      means that the policy if one process may contaminate the locality of the
      slab caches for other processes.
      
      This patch in effect insures that a per process policy is followed for the
      allocation of slab entries and that there cannot be a memory policy
      influence from one process to another.  A process with default policy will
      always get a local slab entry if one is available.  And the process using
      memory policies will get its memory arranged as requested.  Off-node slab
      allocation will require the use of spinlocks and will make the use of per
      cpu caches not possible.  A process using memory policies to redirect
      allocations offnode will have to cope with additional lock overhead in
      addition to the latency added by the need to access a remote slab entry.
      
      Changes V1->V2
      - Remove #ifdef CONFIG_NUMA by moving forward declaration into
        prior #ifdef CONFIG_NUMA section.
      
      - Give the function determining the node number to use a saner
        name.
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      dc85da15
    • Ingo Molnar's avatar
      [PATCH] sem2mutex: mm/slab.c · fc0abb14
      Ingo Molnar authored
      Convert mm/swapfile.c's swapon_sem to swapon_mutex.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Hugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      fc0abb14
    • Christoph Lameter's avatar
      [PATCH] Zone reclaim: proc override · 1743660b
      Christoph Lameter authored
      proc support for zone reclaim
      
      This patch creates a proc entry /proc/sys/vm/zone_reclaim_mode that may be
      used to override the automatic determination of the zone reclaim made on
      bootup.
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      1743660b
    • Christoph Lameter's avatar
      [PATCH] Zone reclaim: Reclaim logic · 9eeff239
      Christoph Lameter authored
      Some bits for zone reclaim exists in 2.6.15 but they are not usable.  This
      patch fixes them up, removes unused code and makes zone reclaim usable.
      
      Zone reclaim allows the reclaiming of pages from a zone if the number of
      free pages falls below the watermarks even if other zones still have enough
      pages available.  Zone reclaim is of particular importance for NUMA
      machines.  It can be more beneficial to reclaim a page than taking the
      performance penalties that come with allocating a page on a remote zone.
      
      Zone reclaim is enabled if the maximum distance to another node is higher
      than RECLAIM_DISTANCE, which may be defined by an arch.  By default
      RECLAIM_DISTANCE is 20.  20 is the distance to another node in the same
      component (enclosure or motherboard) on IA64.  The meaning of the NUMA
      distance information seems to vary by arch.
      
      If zone reclaim is not successful then no further reclaim attempts will
      occur for a certain time period (ZONE_RECLAIM_INTERVAL).
      
      This patch was discussed before. See
      
      http://marc.theaimsgroup.com/?l=linux-kernel&m=113519961504207&w=2
      http://marc.theaimsgroup.com/?l=linux-kernel&m=113408418232531&w=2
      http://marc.theaimsgroup.com/?l=linux-kernel&m=113389027420032&w=2
      http://marc.theaimsgroup.com/?l=linux-kernel&m=113380938612205&w=2Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9eeff239
    • Christoph Lameter's avatar
      [PATCH] Zone reclaim: resurrect may_swap · f1fd1067
      Christoph Lameter authored
      Zone reclaim has a huge impact on NUMA performance (f.e.  our maximum
      throughput with XFS is raised from 4GB to 6GB/sec / page cache contamination
      of numa nodes destroys locality if one just does a large copy operation which
      results in performance dropping for good until reboot).
      
      This patch:
      
      Resurrect may_swap in struct scan_control
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f1fd1067
    • Christoph Lameter's avatar
      [PATCH] Simplify migrate_page_add · fc301289
      Christoph Lameter authored
      Simplify migrate_page_add after feedback from Hugh.  This also allows us to
      drop one parameter from migrate_page_add.
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Cc: Hugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      fc301289
    • Nick Piggin's avatar
      [PATCH] mm: migration page refcounting fix · 053837fc
      Nick Piggin authored
      Migration code currently does not take a reference to target page
      properly, so between unlocking the pte and trying to take a new
      reference to the page with isolate_lru_page, anything could happen to
      it.
      
      Fix this by holding the pte lock until we get a chance to elevate the
      refcount.
      
      Other small cleanups while we're here.
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      053837fc
    • Andrew Morton's avatar
      [PATCH] mm: dirty_exceeded speedup · e236a166
      Andrew Morton authored
      Ravikiran reports that this variable is bouncing all around nodes on NUMA
      machines, causing measurable performance problems.  Fix that up by only
      writing to it when it actually changed.
      
      And put it in a new cacheline to prevent it sharing with other things (this
      happened).
      Signed-off-by: default avatarRavikiran Thirumalai <kiran@scalex86.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e236a166
    • Jon Mason's avatar
      [PATCH] Prevent trident driver from grabbing pcnet32 hardware · c2aeacd4
      Jon Mason authored
      Some pcnet32 hardware erroneously has the Vendor ID for Trident.  The
      pcnet32 driver looks for the PCI ethernet class before grabbing the
      hardware, but the current trident driver does not check against the PCI
      audio class.  This allows the trident driver to claim the pcnet32 hardware.
       This patch prevents that.
      
      This revised version of the OSS Trident patch includes PCI_DEVICE Macro
      usage.
      Signed-off-by: default avatarJon Mason <jdmason@us.ibm.com>
      Signed-off-by: default avatarMuli Ben-Yehuda <mulix@mulix.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c2aeacd4
    • Paul Fulghum's avatar
      [PATCH] synclink_gt fix size of register value storage · 35fbd397
      Paul Fulghum authored
      Fix incorrect variable size used to hold register value.  This bug might
      wipe out a portion of the TCR value when setting the interface options.
      Signed-off-by: default avatarPaul Fulghum <paulkf@microgate.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      35fbd397
    • Andrew Morton's avatar
      [PATCH] scsi_transport_spi build fix · c8d338c8
      Andrew Morton authored
      On alpha:
      
      In file included from drivers/scsi/sym53c8xx_2/sym_glue.h:59,
                       from drivers/scsi/sym53c8xx_2/sym_fw.c:40:
      include/scsi/scsi_transport_spi.h:57: error: field `dv_mutex' has incomplete type
      
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c8d338c8
    • Jan Beulich's avatar
      [PATCH] x86_64: Fix MCE exception stack for boot CPU · ab26a20b
      Jan Beulich authored
      Fix a typo/mis-merge in one of the previous patches.
      Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ab26a20b
    • Jan Kara's avatar
      [PATCH] jbd: remove_transaction fix · 43c3e6f5
      Jan Kara authored
      We have to check that also the second checkpoint list is non-empty before
      dropping the transaction.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      43c3e6f5
    • Jan Kara's avatar
      [PATCH] jbd: log_do_checkpoint fix · 8d3c7fce
      Jan Kara authored
      While checkpointing we have to check that our transaction still is in the
      checkpoint list *and* (not or) that it's not just a different transaction
      with the same address.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      8d3c7fce
  2. 18 Jan, 2006 26 commits