From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Dobriyan Subject: Re: [PATCH] dcache: faster dentry_cmp() Date: Wed, 15 Feb 2012 11:16:34 +0300 Message-ID: <20120215081634.GC3306@p183.telecom.by> References: <20120214224526.GA3478@p183.telecom.by> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, npiggin@kernel.dk To: Andi Kleen Return-path: Received: from mail-bk0-f46.google.com ([209.85.214.46]:35081 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757788Ab2BOIQj (ORCPT ); Wed, 15 Feb 2012 03:16:39 -0500 Received: by bkcjm19 with SMTP id jm19so679592bkc.19 for ; Wed, 15 Feb 2012 00:16:38 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Feb 14, 2012 at 05:46:24PM -0800, Andi Kleen wrote: > Alexey Dobriyan writes: > > > 1) consistently use "unsigned int" for dentry name length, > > 2) reuse subtraction result for return value, exact value doesn't matter > > because function is only used in boolean context, > > 3) use *p++ idiom for even better code. > > I'm sure there are even better ways to do the comparision using longer > words, especially as we know the boundaries and alignment. This requires terminating dentry names with 1-3 NULs. Al, can we afford such beauty?