From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sj-iport-6.cisco.com (sj-iport-6.cisco.com [171.71.176.117]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "sj-iport-6.cisco.com", Issuer "Cisco SSCA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 44815DE322 for ; Wed, 30 Apr 2008 02:43:45 +1000 (EST) From: Roland Dreier To: Stefan Roscher Subject: Re: [PATCH] IB/ehca: Allocate event queue size depending on max number of CQs and QPs References: <200804291744.17235.ossrosch@linux.vnet.ibm.com> Date: Tue, 29 Apr 2008 09:43:42 -0700 In-Reply-To: <200804291744.17235.ossrosch@linux.vnet.ibm.com> (Stefan Roscher's message of "Tue, 29 Apr 2008 17:44:15 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: fenkes@de.ibm.com, LKML , OF-EWG , LinuxPPC-Dev , raisch@de.ibm.com, OF-General List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > > Signed-off-by: Stefan Roscher Kind of an inadequate changelog ;) Is this a fix or an enhancement or what? > + if (atomic_read(&shca->num_cqs) >= ehca_max_cq) { > + if (atomic_read(&shca->num_qps) >= ehca_max_qp) { These are racy in the sense that multiple simultaneous calls to create_cq/create_qp might end up exceeding the ehca_max_cq limit. Is that an issue? You could close the race by using atomic_add_unless() and testing the return value (and being careful to do atomic_dec() on error paths after you bump num_cqs/num_qps). - R.