lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0901141225540.22173@melkki.cs.Helsinki.FI>
Date:	Wed, 14 Jan 2009 12:29:13 +0200 (EET)
From:	Pekka J Enberg <penberg@...helsinki.fi>
To:	cl@...ux-foundation.org
cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] SLUB: Use ->objsize from struct kmem_cache_cpu in slab_free()

From: Pekka Enberg <penberg@...helsinki.fi>

There's no reason to use ->objsize from struct kmem_cache in slab_free() for
the SLAB_DEBUG_OBJECTS case. All it does is generate extra cache pressure 
as no one else touches struct kmem_cache in the fast-path.

Not that it matters all that much as the code is optimized away when 
CONFIG_DEBUG_OBJECTS is disabled and when it is enabled, the 
actual debugging checks are quite heavy-weight.

Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
---
 mm/slub.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 57aa749..fa651c1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1727,7 +1727,7 @@ static __always_inline void slab_free(struct kmem_cache *s,
 	c = get_cpu_slab(s, smp_processor_id());
 	debug_check_no_locks_freed(object, c->objsize);
 	if (!(s->flags & SLAB_DEBUG_OBJECTS))
-		debug_check_no_obj_freed(object, s->objsize);
+		debug_check_no_obj_freed(object, c->objsize);
 	if (likely(page == c->page && c->node >= 0)) {
 		object[c->offset] = c->freelist;
 		c->freelist = object;
-- 
1.5.4.3

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ