Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755471AbYCTLro (ORCPT ); Thu, 20 Mar 2008 07:47:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752581AbYCTLrf (ORCPT ); Thu, 20 Mar 2008 07:47:35 -0400 Received: from mail3.iitk.ac.in ([203.200.95.132]:49230 "EHLO mail3.iitk.ac.in" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752535AbYCTLre (ORCPT ); Thu, 20 Mar 2008 07:47:34 -0400 X-Greylist: delayed 2046 seconds by postgrey-1.27 at vger.kernel.org; Thu, 20 Mar 2008 07:47:34 EDT Date: Thu, 20 Mar 2008 16:43:13 +0530 (IST) From: Arun Raghavan X-X-Sender: arun@peripatetic.hades To: David Howells cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] [keys] Always use key_get() to increment key refcount In-Reply-To: <8036.1205965746@redhat.com> Message-ID: References: <8036.1205965746@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 27 On Wed, 19 Mar 2008, David Howells wrote: > Arun Raghavan wrote: > > > Patch to use key_get() wherever the keys code manually increments the > > key refcount. > > > > This should make debugging a little simpler for clients, since it > > becomes easier to track where a key's refcount changes. > > The problem with this is that key_get() is not simply an atomic_inc(). You > end up introducing an extra conditional into each of these places where one is > not required. Now it's possible that the compiler's optimiser is sufficiently > clever to get rid of them all, but do you guarantee that? Is this really a significant performance penalty? If yes, wouldn't a likely() be sufficient to mitigate the penalty? The same arguments should also be applied to key_put(), I guess. Regards, Arun -- 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/