public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
To: "Håkon Bugge" <Haakon.Bugge@oracle.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org,
	knut.omang@oracle.com, wei.lin.guay@oracle.com
Subject: Re: [PATCH net] rds: Fix non-atomic operation on shared flag variable
Date: Tue, 5 Sep 2017 09:33:04 -0700	[thread overview]
Message-ID: <6a4e095f-20f1-53af-a2eb-047866c1695d@oracle.com> (raw)
In-Reply-To: <20170905154201.30198-1-Haakon.Bugge@oracle.com>

On 9/5/2017 8:42 AM, Håkon Bugge wrote:
> The bits in m_flags in struct rds_message are used for a plurality of
> reasons, and from different contexts. To avoid any missing updates to
> m_flags, use the atomic set_bit() instead of the non-atomic equivalent.
> 
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> Reviewed-by: Knut Omang <knut.omang@oracle.com>
> Reviewed-by: Wei Lin Guay <wei.lin.guay@oracle.com>
> ---
>   net/rds/send.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/rds/send.c b/net/rds/send.c
> index 41b9f0f..058a407 100644
> --- a/net/rds/send.c
> +++ b/net/rds/send.c
> @@ -273,7 +273,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
>   			len = ntohl(rm->m_inc.i_hdr.h_len);
>   			if (cp->cp_unacked_packets == 0 ||
>   			    cp->cp_unacked_bytes < len) {
> -				__set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
> +				set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
>   
>   				cp->cp_unacked_packets =
>   					rds_sysctl_max_unacked_packets;
> @@ -829,7 +829,7 @@ static int rds_send_queue_rm(struct rds_sock *rs, struct rds_connection *conn,
>   		 * throughput hits a certain threshold.
>   		 */
>   		if (rs->rs_snd_bytes >= rds_sk_sndbuf(rs) / 2)
> -			__set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
> +			set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
>   
>   		list_add_tail(&rm->m_sock_item, &rs->rs_send_queue);
>   		set_bit(RDS_MSG_ON_SOCK, &rm->m_flags);
> 
Indeed, these couple of instances remained for the m_flags.
Patch looks good. Thanks !!

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

  reply	other threads:[~2017-09-05 16:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 15:42 [PATCH net] rds: Fix non-atomic operation on shared flag variable Håkon Bugge
2017-09-05 16:33 ` Santosh Shilimkar [this message]
     [not found] ` <20170905154201.30198-1-Haakon.Bugge-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-09-05 21:50   ` David Miller

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=6a4e095f-20f1-53af-a2eb-047866c1695d@oracle.com \
    --to=santosh.shilimkar@oracle.com \
    --cc=Haakon.Bugge@oracle.com \
    --cc=davem@davemloft.net \
    --cc=knut.omang@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=wei.lin.guay@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox