LKML Archive on
help / color / mirror / Atom feed
From: David Miller <>
Subject: Re: [PATCH v2 2/5] net: qrtr: Implement outgoing flow control
Date: Fri, 31 May 2019 14:46:35 -0700 (PDT)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Bjorn Andersson <>
Date: Thu, 30 May 2019 18:17:50 -0700

> +	flow = radix_tree_lookup(&node->qrtr_tx_flow, key);
> +	if (flow)
> +		atomic_set(&flow->pending, 0);

You can't just zero out an atomic counter without extra synchronization
which protects you from the increment paths.

And since you'll need a lock to cover all of those paths, you don't
need to use an atomic_t and instead can use a plain integer.

  reply	other threads:[~2019-05-31 21:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  1:17 [PATCH v2 0/5] QRTR flow control improvements Bjorn Andersson
2019-05-31  1:17 ` [PATCH v2 1/5] net: qrtr: Move resume-tx transmission to recvmsg Bjorn Andersson
2019-05-31  1:17 ` [PATCH v2 2/5] net: qrtr: Implement outgoing flow control Bjorn Andersson
2019-05-31 21:46   ` David Miller [this message]
2019-05-31  1:17 ` [PATCH v2 3/5] net: qrtr: Migrate node lookup tree to spinlock Bjorn Andersson
2019-05-31  1:17 ` [PATCH v2 4/5] net: qrtr: Make qrtr_port_lookup() use RCU Bjorn Andersson
2019-05-31  1:17 ` [PATCH v2 5/5] net: qrtr: Remove receive worker Bjorn Andersson

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:

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

  git send-email \ \ \ \ \ \ \ \ \

* 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).