[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160929.015404.76401694814645494.davem@davemloft.net>
Date: Thu, 29 Sep 2016 01:54:04 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: gwshan@...ux.vnet.ibm.com
Cc: netdev@...r.kernel.org, joel@....id.au, yuvali@...lanox.com,
benh@...nel.crashing.org
Subject: Re: [PATCH net-next 1/8] net/ncsi: Avoid unused-value build
warning from ia64-linux-gcc
From: Gavin Shan <gwshan@...ux.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.
Powered by blists - more mailing lists