All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: Stefan Roscher <ossrosch@linux.vnet.ibm.com>
Cc: fenkes@de.ibm.com, LKML <linux-kernel@vger.kernel.org>,
	OF-EWG <ewg@lists.openfabrics.org>,
	LinuxPPC-Dev <linuxppc-dev@ozlabs.org>,
	raisch@de.ibm.com, OF-General <general@lists.openfabrics.org>
Subject: Re: [PATCH] IB/ehca: Allocate event queue size depending on max number of CQs and QPs
Date: Tue, 29 Apr 2008 09:43:42 -0700	[thread overview]
Message-ID: <adafxt4y5kx.fsf@cisco.com> (raw)
In-Reply-To: <200804291744.17235.ossrosch@linux.vnet.ibm.com> (Stefan Roscher's message of "Tue, 29 Apr 2008 17:44:15 +0200")

 > 
 > Signed-off-by: Stefan Roscher <stefan.roscher at de.ibm.com>

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.

WARNING: multiple messages have this Message-ID (diff)
From: Roland Dreier <rdreier@cisco.com>
To: Stefan Roscher <ossrosch@linux.vnet.ibm.com>
Cc: "LinuxPPC-Dev" <linuxppc-dev@ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"OF-General" <general@lists.openfabrics.org>,
	Roland Dreier <rolandd@cisco.com>,
	"OF-EWG" <ewg@lists.openfabrics.org>,
	hnguyen@de.ibm.com, raisch@de.ibm.com, fenkes@de.ibm.com
Subject: Re: [PATCH] IB/ehca: Allocate event queue size depending on max number of CQs and QPs
Date: Tue, 29 Apr 2008 09:43:42 -0700	[thread overview]
Message-ID: <adafxt4y5kx.fsf@cisco.com> (raw)
In-Reply-To: <200804291744.17235.ossrosch@linux.vnet.ibm.com> (Stefan Roscher's message of "Tue, 29 Apr 2008 17:44:15 +0200")

 > 
 > Signed-off-by: Stefan Roscher <stefan.roscher at de.ibm.com>

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.

  reply	other threads:[~2008-04-29 16:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 15:44 [PATCH] IB/ehca: Allocate event queue size depending on max number of CQs and QPs Stefan Roscher
2008-04-29 15:44 ` Stefan Roscher
2008-04-29 16:43 ` Roland Dreier [this message]
2008-04-29 16:43   ` Roland Dreier
2008-04-29 18:15   ` [REPOST][PATCH] " Stefan Roscher
2008-04-29 18:15     ` Stefan Roscher
2008-04-29 18:20     ` Roland Dreier
2008-04-29 18:20       ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adafxt4y5kx.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=ewg@lists.openfabrics.org \
    --cc=fenkes@de.ibm.com \
    --cc=general@lists.openfabrics.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=ossrosch@linux.vnet.ibm.com \
    --cc=raisch@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.