1. 06 10月, 2010 1 次提交
    • P
      SLUB: Optimize slab_free() debug check · 15b7c514
      Pekka Enberg 提交于
      This patch optimizes slab_free() debug check to use "c->node != NUMA_NO_NODE"
      instead of "c->node >= 0" because the former generates smaller code on x86-64:
      
        Before:
      
          4736:       48 39 70 08             cmp    %rsi,0x8(%rax)
          473a:       75 26                   jne    4762 <kfree+0xa2>
          473c:       44 8b 48 10             mov    0x10(%rax),%r9d
          4740:       45 85 c9                test   %r9d,%r9d
          4743:       78 1d                   js     4762 <kfree+0xa2>
      
        After:
      
          4736:       48 39 70 08             cmp    %rsi,0x8(%rax)
          473a:       75 23                   jne    475f <kfree+0x9f>
          473c:       83 78 10 ff             cmpl   $0xffffffffffffffff,0x10(%rax)
          4740:       74 1d                   je     475f <kfree+0x9f>
      
      This patch also cleans up __slab_alloc() to use NUMA_NO_NODE instead of "-1"
      for enabling debugging for a per-CPU cache.
      Acked-by: NChristoph Lameter <cl@linux.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NPekka Enberg <penberg@kernel.org>
      15b7c514
  2. 02 10月, 2010 18 次提交
  3. 03 8月, 2010 2 次提交
  4. 29 7月, 2010 1 次提交
    • C
      slub numa: Fix rare allocation from unexpected node · bc6488e9
      Christoph Lameter 提交于
      The network developers have seen sporadic allocations resulting in objects
      coming from unexpected NUMA nodes despite asking for objects from a
      specific node.
      
      This is due to get_partial() calling get_any_partial() if partial
      slabs are exhausted for a node even if a node was specified and therefore
      one would expect allocations only from the specified node.
      
      get_any_partial() sporadically may return a slab from a foreign
      node to gradually reduce the size of partial lists on remote nodes
      and thereby reduce total memory use for a slab cache.
      
      The behavior is controlled by the remote_defrag_ratio of each cache.
      
      Strictly speaking this is permitted behavior since __GFP_THISNODE was
      not specified for the allocation but it is certain surprising.
      
      This patch makes sure that the remote defrag behavior only occurs
      if no node was specified.
      Signed-off-by: NChristoph Lameter <cl@linux-foundation.org>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      bc6488e9
  5. 16 7月, 2010 5 次提交
  6. 09 6月, 2010 1 次提交
  7. 25 5月, 2010 2 次提交
    • M
      cpuset,mm: fix no node to alloc memory when changing cpuset's mems · c0ff7453
      Miao Xie 提交于
      Before applying this patch, cpuset updates task->mems_allowed and
      mempolicy by setting all new bits in the nodemask first, and clearing all
      old unallowed bits later.  But in the way, the allocator may find that
      there is no node to alloc memory.
      
      The reason is that cpuset rebinds the task's mempolicy, it cleans the
      nodes which the allocater can alloc pages on, for example:
      
      (mpol: mempolicy)
      	task1			task1's mpol	task2
      	alloc page		1
      	  alloc on node0? NO	1
      				1		change mems from 1 to 0
      				1		rebind task1's mpol
      				0-1		  set new bits
      				0	  	  clear disallowed bits
      	  alloc on node1? NO	0
      	  ...
      	can't alloc page
      	  goto oom
      
      This patch fixes this problem by expanding the nodes range first(set newly
      allowed bits) and shrink it lazily(clear newly disallowed bits).  So we
      use a variable to tell the write-side task that read-side task is reading
      nodemask, and the write-side task clears newly disallowed nodes after
      read-side task ends the current memory allocation.
      
      [akpm@linux-foundation.org: fix spello]
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Paul Menage <menage@google.com>
      Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
      Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
      Cc: Ravikiran Thirumalai <kiran@scalex86.org>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c0ff7453
    • A
      slub: move kmem_cache_node into it's own cacheline · 73367bd8
      Alexander Duyck 提交于
      This patch is meant to improve the performance of SLUB by moving the local
      kmem_cache_node lock into it's own cacheline separate from kmem_cache.
      This is accomplished by simply removing the local_node when NUMA is enabled.
      
      On my system with 2 nodes I saw around a 5% performance increase w/
      hackbench times dropping from 6.2 seconds to 5.9 seconds on average.  I
      suspect the performance gain would increase as the number of nodes
      increases, but I do not have the data to currently back that up.
      
      Bugzilla-Reference: http://bugzilla.kernel.org/show_bug.cgi?id=15713
      Cc: <stable@kernel.org>
      Reported-by: NAlex Shi <alex.shi@intel.com>
      Tested-by: NAlex Shi <alex.shi@intel.com>
      Acked-by: NYanmin Zhang <yanmin_zhang@linux.intel.com>
      Acked-by: NChristoph Lameter <cl@linux-foundation.org>
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      73367bd8
  8. 22 5月, 2010 3 次提交
  9. 20 5月, 2010 1 次提交
  10. 06 5月, 2010 1 次提交
  11. 10 4月, 2010 1 次提交
  12. 08 3月, 2010 2 次提交
  13. 04 3月, 2010 1 次提交
    • S
      SLUB: Fix per-cpu merge conflict · 1154fab7
      Stephen Rothwell 提交于
      The slab tree adds a percpu variable usage case (commit
      9dfc6e68 "SLUB: Use this_cpu operations in
      slub"), but the percpu tree removes the prefixing of percpu variables (commit
      dd17c8f7 "percpu: remove per_cpu__ prefix"),
      thus causing the following compilation error:
      
          CC      mm/slub.o
        mm/slub.c: In function ‘alloc_kmem_cache_cpus’:
        mm/slub.c:2078: error: implicit declaration of function ‘per_cpu_var’
        mm/slub.c:2078: warning: assignment makes pointer from integer without a cast
        make[1]: *** [mm/slub.o] Error 1
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      1154fab7
  14. 27 2月, 2010 1 次提交