From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754108AbcG2Vsd (ORCPT ); Fri, 29 Jul 2016 17:48:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39898 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750868AbcG2VsZ (ORCPT ); Fri, 29 Jul 2016 17:48:25 -0400 Date: Fri, 29 Jul 2016 14:48:38 -0700 From: Greg KH To: Stephen Hemminger Cc: Amir Levy , andreas.noever@gmail.com, bhelgaas@google.com, corbet@lwn.net, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, thunderbolt-linux@intel.com, mika.westerberg@intel.com, tomas.winkler@intel.com Subject: Re: [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware) Message-ID: <20160729214838.GA14827@kroah.com> References: <1469693721-5641-1-git-send-email-amir.jer.levy@intel.com> <1469693721-5641-5-git-send-email-amir.jer.levy@intel.com> <20160729140224.137dbaac@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160729140224.137dbaac@xeon-e3> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 29, 2016 at 02:02:24PM -0700, Stephen Hemminger wrote: > On Thu, 28 Jul 2016 11:15:17 +0300 > Amir Levy wrote: > > > +static LIST_HEAD(controllers_list); > > +static DECLARE_RWSEM(controllers_list_rwsem); > > Why use a semaphore when simple spinlock or mutex would be better? And never use a RW semaphore unless you can benchmark the difference from a normal lock. If you can't benchmark it, then don't use it...