Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1692803

Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

From Sowmini Varadhan <sowmini.varadhan@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed
Date 2017-07-20 13:10 +0200
Message-ID <u5hve-6vT-27@gated-at.bofh.it> (permalink)
References <u5gSv-5Zw-55@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On (07/20/17 12:28), H??kon Bugge wrote:
> cp->cp_send_gen is treated as a normal variable, although it may be
> used by different threads.

I'm confused by that assertion. If you look at the comments right
above the change in your patch, there is a note that 
acquire_in_xmit/release_in_xmit are the synchronization/serialization 
points.

Can you please clarify?

> --- a/net/rds/send.c
> +++ b/net/rds/send.c
> @@ -170,8 +170,8 @@ int rds_send_xmit(struct rds_conn_path *cp)
>  	 * The acquire_in_xmit() check above ensures that only one
>  	 * caller can increment c_send_gen at any time.
>  	 */
> -	cp->cp_send_gen++;
> -	send_gen = cp->cp_send_gen;
> +	send_gen = READ_ONCE(cp->cp_send_gen) + 1;
> +	WRITE_ONCE(cp->cp_send_gen, send_gen);
>  

--Sowmini

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net] rds: Make sure updates to cp_send_gen can be observed Håkon Bugge <Haakon.Bugge@oracle.com> - 2017-07-20 12:30 +0200
  Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2017-07-20 13:10 +0200
    Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed Håkon Bugge <haakon.bugge@oracle.com> - 2017-07-20 13:30 +0200
  Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2017-07-20 18:50 +0200
  Re: [PATCH net] rds: Make sure updates to cp_send_gen can be  observed David Miller <davem@davemloft.net> - 2017-07-21 00:40 +0200

csiph-web