Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755481Ab2BASq7 (ORCPT ); Wed, 1 Feb 2012 13:46:59 -0500 Received: from mga05.intel.com ([192.55.52.89]:16243 "EHLO fmsmga101.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755326Ab2BASqz convert rfc822-to-8bit (ORCPT ); Wed, 1 Feb 2012 13:46:55 -0500 MIME-Version: 1.0 In-Reply-To: References: <1327961644-6886-1-git-send-email-zohar@linux.vnet.ibm.com> <1327961644-6886-6-git-send-email-zohar@linux.vnet.ibm.com> Date: Wed, 1 Feb 2012 20:46:54 +0200 Message-ID: Subject: Re: [RFC][PATCH v1 5/9] ima: allocating iint improvements From: "Kasatkin, Dmitry" To: Eric Paris Cc: Mimi Zohar , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, David Safford , Mimi Zohar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1239 Lines: 27 On Wed, Feb 1, 2012 at 6:58 PM, Eric Paris wrote: > On Mon, Jan 30, 2012 at 5:14 PM, Mimi Zohar wrote: >> From: Dmitry Kasatkin >> > >>  static struct rb_root integrity_iint_tree = RB_ROOT; >> -static DEFINE_SPINLOCK(integrity_iint_lock); >> +static DEFINE_RWLOCK(integrity_iint_lock); >>  static struct kmem_cache *iint_cache __read_mostly; > > Has any profiling been done here?   rwlocks have been shown to > actually be slower on multi processor systems in a number of cases due > to the cache line bouncing required.  I believe the current kernel > logic is that if you have a short critical section and you can't show > profile data the rwlocks are better, just stick with a spinlock. No, I have not done any profiling. My assumption was that rwlocks are better when there many readers. If what you say is true then rwlocks are useless... With big sections it is necessary to use rw semaphores. - Dmitry -- 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/