Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261220AbVC0Rkf (ORCPT ); Sun, 27 Mar 2005 12:40:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261233AbVC0Rkf (ORCPT ); Sun, 27 Mar 2005 12:40:35 -0500 Received: from mx1.redhat.com ([66.187.233.31]:13719 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S261220AbVC0Rk2 (ORCPT ); Sun, 27 Mar 2005 12:40:28 -0500 Date: Sun, 27 Mar 2005 12:40:26 -0500 From: Dave Jones To: Jan Engelhardt Cc: Linux Kernel Mailing List Subject: Re: [PATCH] no need to check for NULL before calling kfree() -fs/ext2/ Message-ID: <20050327174026.GA708@redhat.com> Mail-Followup-To: Dave Jones , Jan Engelhardt , Linux Kernel Mailing List References: <1111825958.6293.28.camel@laptopd505.fenrus.org> <1111881955.957.11.camel@mindpipe> <20050327065655.6474d5d6.pj@engr.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1265 Lines: 36 On Sun, Mar 27, 2005 at 05:12:58PM +0200, Jan Engelhardt wrote: > Well, kfree inlined was already mentioned but forgotten again. > What if this was used: > > inline static void kfree_WRAP(void *addr) { > if(likely(addr != NULL)) { > kfree_real(addr); > } > return; > } > > And remove the NULL-test in kfree_real()? Then we would have: Am I the only person who is completely fascinated by the effort being spent here micro-optimising something thats almost never in a path that needs optimising ? I'd be amazed if any of this masturbation showed the tiniest blip on a real workload, or even on a benchmark other than one crafted specifically to test kfree in a loop. That each occurance of this 'optimisation' also saves a handful of bytes in generated code is it's only real benefit afaics. Even then, if a functions cache performance is better off because we trimmed a few bytes from the tail of a function, I'd be completely amazed. I guess April 1st came early this year. Dave - 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/