Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1262386

Re: [PATCH] arm64: Increase the max granular size

From Catalin Marinas <catalin.marinas@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] arm64: Increase the max granular size
Date 2015-11-04 16:40 +0100
Message-ID <qr8kk-2go-83@gated-at.bofh.it> (permalink)
References (5 earlier) <qqTlg-Z8-15@gated-at.bofh.it> <qr5w6-pT-15@gated-at.bofh.it> <qr6Lx-19D-29@gated-at.bofh.it> <qr7HA-1LY-19@gated-at.bofh.it> <qr8aC-2cC-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Nov 04, 2015 at 09:28:34AM -0600, Christoph Lameter wrote:
> On Wed, 4 Nov 2015, Catalin Marinas wrote:
> 
> > BTW, assuming L1_CACHE_BYTES is 512 (I don't ever see this happening but
> > just in theory), we potentially have the same issue. What would save us
> > is that INDEX_NODE would match the first "kmalloc-512" cache, so we have
> > it pre-populated.
> 
> Ok maybe add some BUILD_BUG_ONs to ensure that builds fail until we have
> addressed that.

A BUILD_BUG_ON should be fine.

Thinking some more, I think if KMALLOC_MIN_SIZE is 128, there is no gain
with off-slab management since the freelist allocation would still be
128 bytes. An alternative to reverting while still having a little
benefit of off-slab for 256 bytes objects (rather than 512 as we would
get with the revert):

diff --git a/mm/slab.c b/mm/slab.c
index 4fcc5dd8d5a6..ac32b4a0f2ec 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2212,8 +2212,8 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
 	 * it too early on. Always use on-slab management when
 	 * SLAB_NOLEAKTRACE to avoid recursive calls into kmemleak)
 	 */
-	if ((size >= (PAGE_SIZE >> 5)) && !slab_early_init &&
-	    !(flags & SLAB_NOLEAKTRACE))
+	if ((size >= (PAGE_SIZE >> 5)) && (size > KMALLOC_MIN_SIZE) &&
+		!slab_early_init && !(flags & SLAB_NOLEAKTRACE))
 		/*
 		 * Size is large, assume best to place the slab management obj
 		 * off-slab (should allow better packing of objs).

Whichever you prefer.

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] arm64: Increase the max granular size Catalin Marinas <catalin.marinas@arm.com> - 2015-11-03 13:10 +0100
  Re: [PATCH] arm64: Increase the max granular size Catalin Marinas <catalin.marinas@arm.com> - 2015-11-03 15:40 +0100
    Re: [PATCH] arm64: Increase the max granular size Geert Uytterhoeven <geert@linux-m68k.org> - 2015-11-03 16:00 +0100
      Re: [PATCH] arm64: Increase the max granular size Catalin Marinas <catalin.marinas@arm.com> - 2015-11-03 20:00 +0100
        Re: [PATCH] arm64: Increase the max granular size Christoph Lameter <cl@linux.com> - 2015-11-04 00:40 +0100
          Re: [PATCH] arm64: Increase the max granular size Catalin Marinas <catalin.marinas@arm.com> - 2015-11-04 13:40 +0100
            Re: [PATCH] arm64: Increase the max granular size Christoph Lameter <cl@linux.com> - 2015-11-04 15:00 +0100
              Re: [PATCH] arm64: Increase the max granular size Catalin Marinas <catalin.marinas@arm.com> - 2015-11-04 16:00 +0100
                Re: [PATCH] arm64: Increase the max granular size Christoph Lameter <cl@linux.com> - 2015-11-04 16:30 +0100
                Re: [PATCH] arm64: Increase the max granular size Catalin Marinas <catalin.marinas@arm.com> - 2015-11-04 16:40 +0100
                Re: [PATCH] arm64: Increase the max granular size Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2015-11-05 05:40 +0100
                [PATCH] mm: slab: Only move management objects off-slab for sizes larger than KMALLOC_MIN_SIZE Catalin Marinas <catalin.marinas@arm.com> - 2015-11-05 13:00 +0100
                Re: [PATCH] mm: slab: Only move management objects off-slab for  sizes larger than KMALLOC_MIN_SIZE Andrew Morton <akpm@linux-foundation.org> - 2015-11-05 14:30 +0100
                Re: [PATCH] mm: slab: Only move management objects off-slab for  sizes larger than KMALLOC_MIN_SIZE Catalin Marinas <catalin.marinas@arm.com> - 2015-11-05 17:10 +0100
                Re: [PATCH] mm: slab: Only move management objects off-slab for sizes  larger than KMALLOC_MIN_SIZE Geert Uytterhoeven <geert@linux-m68k.org> - 2015-11-06 14:10 +0100
                Re: [PATCH] mm: slab: Only move management objects off-slab for  sizes larger than KMALLOC_MIN_SIZE Christoph Lameter <cl@linux.com> - 2015-11-05 18:40 +0100

csiph-web