From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) by kanga.kvack.org (Postfix) with SMTP id CE82A9000C2 for ; Fri, 8 Jul 2011 01:25:16 -0400 (EDT) From: Andi Kleen Subject: Re: [PATCH] slub: reduce overhead of slub_debug In-Reply-To: (Christoph Lameter's message of "Thu, 7 Jul 2011 15:12:52 -0500 (CDT)") References: <1310064771.21902.55.camel@jaguar> <20110707.122151.314840355798805828.davem@davemloft.net> Date: Thu, 07 Jul 2011 22:23:45 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Lameter Cc: Pekka Enberg , David Miller , marcin.slusarz@gmail.com, mpm@selenic.com, linux-kernel@vger.kernel.org, rientjes@google.com, linux-mm@kvack.org Christoph Lameter writes: > +#ifdef __HAVE_ARCH_INV_MEMSCAN > +void *inv_memscan(void *addr, int c, size_t size) > +{ > + if (!size) > + return addr; > + asm volatile("repz; scasb\n\t" This will just do the slow byte accesses again internally. scasb is not normally very optimized in microcode as far as I know. Also rep has quite some startup overhead which makes it a bad idea for small sizes (<16-20 or so) I would stay with the C version. I bet that one is faster. -Andi -- ak@linux.intel.com -- Speaking for myself only -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org