From: Ursula Braun <ubraun@linux.vnet.ibm.com>
To: Dave Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Utz Bacher <utz.bacher@de.ibm.com>
Subject: Fwd: Re: [PATCH RESEND net-next 13/15] smc: receive data from RMBE
Date: Wed, 10 Aug 2016 17:15:01 +0200 [thread overview]
Message-ID: <40f250c2-d865-5bd3-8d20-a2dc2fd7d257@linux.vnet.ibm.com> (raw)
In-Reply-To: <653f839a-8098-da62-3437-8b002d929a50@linux.vnet.ibm.com>
Dave,
sorry, forget my previous mail from today. I now realize that xchg()
does not help on 32-bit architectures. I have to think about
alternatives here.
-------- Forwarded Message --------
Subject: Re: [PATCH RESEND net-next 13/15] smc: receive data from RMBE
Date: Wed, 10 Aug 2016 15:44:00 +0200
From: Ursula Braun <ubraun@linux.vnet.ibm.com>
To: David Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, utz.bacher@de.ibm.com
On 08/09/2016 11:32 PM, David Miller wrote:
> From: Ursula Braun <ubraun@linux.vnet.ibm.com>
> Date: Tue, 9 Aug 2016 12:12:58 +0200
>
>> + xchg(&conn->rx_curs_confirmed.acurs,
>> + smc_curs_read(conn->local_tx_ctrl.cons.acurs));
>
> Why in the world do you need to use xchg() in all of these places?
>
> It makes no sense whatsoever, especially since you don't even check
> the return value.
> 98e906b2
> If you need the operation to be atomic, then you have to check the
> return value and do something to recover if something else beat
> you to the xchg() and put something else into the location.
>
> Otherwise, you therefore don't need it be atomic and can avoid
> this expensive operation and just store the value normally.
>
Reviewing my xchg() usages, I really detected some paranoid usages, that
I am going to remove. But there are still usages (and
conn->rx_curs_confirmed is one of them), where I need an 8-byte cursor
field to be read and written atomicaly, even though I do not care
whether the write operation has been beaten or not. But I do care that
reading the cursor does not return a partially updated cursor. Isn't
xchg() a possible solution in this case?
next prev parent reply other threads:[~2016-08-10 15:15 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 10:12 [PATCH RESEND net-next 00/15] net/smc: Shared Memory Communications - RDMA Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 01/15] net: introduce keepalive function in struct proto Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 02/15] smc: establish new socket family Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 03/15] smc: establish pnet table management Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 04/15] smc: introduce SMC as an IB-client Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 05/15] smc: CLC handshake (incl. preparation steps) Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 06/15] smc: connection and link group creation Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 07/15] smc: remote memory buffers (RMBs) Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 08/15] smc: work request (WR) base for use by LLC and CDC Ursula Braun
2016-08-09 12:29 ` kbuild test robot
2016-08-09 10:12 ` [PATCH RESEND net-next 09/15] smc: initialize IB transport incl. PD, MR, QP, CQ, event, WR Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 10/15] smc: link layer control (LLC) Ursula Braun
2016-08-09 10:12 ` [PATCH RESEND net-next 11/15] smc: connection data control (CDC) Ursula Braun
2016-08-09 14:02 ` kbuild test robot
2016-08-09 10:12 ` [PATCH RESEND net-next 12/15] smc: send data (through RDMA) Ursula Braun
2016-08-09 14:43 ` kbuild test robot
2016-08-09 10:12 ` [PATCH RESEND net-next 13/15] smc: receive data from RMBE Ursula Braun
2016-08-09 21:32 ` David Miller
2016-08-10 13:44 ` Ursula Braun
2016-08-10 15:15 ` Ursula Braun [this message]
2016-08-10 17:45 ` David Miller
2016-09-02 13:05 ` Ursula Braun
2016-09-02 17:59 ` David Miller
2016-08-09 10:12 ` [PATCH RESEND net-next 14/15] smc: socket closing and linkgroup cleanup Ursula Braun
2016-08-09 12:55 ` [PATCH] smc: fix boolreturn.cocci warnings kbuild test robot
2016-08-09 12:55 ` [PATCH] smc: fix semicolon.cocci warnings kbuild test robot
2016-08-09 12:55 ` [PATCH RESEND net-next 14/15] smc: socket closing and linkgroup cleanup kbuild test robot
2016-08-09 10:13 ` [PATCH RESEND net-next 15/15] smc: proc-fs interface for smc connections Ursula Braun
2016-08-09 21:40 ` 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=40f250c2-d865-5bd3-8d20-a2dc2fd7d257@linux.vnet.ibm.com \
--to=ubraun@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=utz.bacher@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 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).