From: David Miller <davem@davemloft.net>
To: gwshan@linux.vnet.ibm.com
Cc: netdev@vger.kernel.org, joel@jms.id.au, yuvali@mellanox.com,
benh@kernel.crashing.org
Subject: Re: [PATCH net-next 1/8] net/ncsi: Avoid unused-value build warning from ia64-linux-gcc
Date: Thu, 29 Sep 2016 01:54:04 -0400 (EDT) [thread overview]
Message-ID: <20160929.015404.76401694814645494.davem@davemloft.net> (raw)
In-Reply-To: <1475125395-8459-2-git-send-email-gwshan@linux.vnet.ibm.com>
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
Date: Thu, 29 Sep 2016 15:03:08 +1000
> This replaces the atomic access to NCSI channel's state with READ_ONCE()
> and WRITE_ONCE() to avoid the above build warning. We needn't hold the
> channel's lock when updating its state as well. No logical changes
> introduced.
I don't understand this.
If it's important to take the lock for the list add/del, then it must
be important to make the state change appear atomic wrt. that lock as
well.
Can parallel threads of control enter these functions which change the
state? If so, then you need to make the state changes under the lock.
In fact, you probably have to make the state tests under the locks as
well.
If not, please explain what prevents it from happening.
Thanks.
next prev parent reply other threads:[~2016-09-29 5:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 5:03 [PATCH net-next 0/8] net/ncsi: NCSI Improvment and bug fixes Gavin Shan
2016-09-29 5:03 ` [PATCH net-next 1/8] net/ncsi: Avoid unused-value build warning from ia64-linux-gcc Gavin Shan
2016-09-29 5:54 ` David Miller [this message]
2016-09-29 11:40 ` Gavin Shan
2016-09-29 5:03 ` [PATCH net-next 2/8] net/ncsi: Introduce NCSI_RESERVED_CHANNEL Gavin Shan
2016-09-29 5:03 ` [PATCH net-next 3/8] net/ncsi: Don't probe on the reserved channel ID (0x1f) Gavin Shan
2016-09-29 5:03 ` [PATCH net-next 4/8] net/ncsi: Rework request index allocation Gavin Shan
2016-09-29 5:03 ` [PATCH net-next 5/8] net/ncsi: Allow to extend NCSI request properties Gavin Shan
2016-09-29 5:03 ` [PATCH net-next 6/8] net/ncsi: Rework the channel monitoring Gavin Shan
2016-09-29 5:03 ` [PATCH net-next 7/8] net/ncsi: Introduce ncsi_stop_dev() Gavin Shan
2016-09-29 5:03 ` [PATCH net-next 8/8] net/faraday: Stop NCSI device on shutdown Gavin Shan
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=20160929.015404.76401694814645494.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=benh@kernel.crashing.org \
--cc=gwshan@linux.vnet.ibm.com \
--cc=joel@jms.id.au \
--cc=netdev@vger.kernel.org \
--cc=yuvali@mellanox.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).