[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150615155236.18824.56477.stgit@devil>
Date: Mon, 15 Jun 2015 17:52:36 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: linux-mm@...ck.org, Christoph Lameter <cl@...ux.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: netdev@...r.kernel.org,
Alexander Duyck <alexander.duyck@...il.com>,
Jesper Dangaard Brouer <brouer@...hat.com>
Subject: [PATCH 5/7] slub: kmem_cache_alloc_bulk() move clearing outside IRQ
disabled section
Move clearing of objects outside IRQ disabled section,
to minimize time spend with local IRQs off.
Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
---
mm/slub.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index d10de5a33c03..26f64005a347 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2781,13 +2781,18 @@ bool kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size,
c->freelist = get_freepointer(s, object);
p[i] = object;
-
- if (unlikely(flags & __GFP_ZERO))
- memset(object, 0, s->object_size);
}
c->tid = next_tid(c->tid);
local_irq_enable();
+ /* Clear memory outside IRQ disabled fastpath loop */
+ if (unlikely(flags & __GFP_ZERO)) {
+ int j;
+
+ for (j = 0; j < i; j++)
+ memset(p[j], 0, s->object_size);
+ }
+
/* Fallback to single elem alloc */
for (; i < size; i++) {
void *x = p[i] = kmem_cache_alloc(s, flags);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists