From: Davidlohr Bueso <dave@stgolabs.net>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH -next] ipc/sem: prevent queue.status tearing in semop
Date: Fri, 20 Jul 2018 11:25:34 -0700 [thread overview]
Message-ID: <20180720182534.2u2fh5i2cyhd7owo@linux-r8p5> (raw)
In-Reply-To: <7909e12b-6dd7-e28a-010c-003545a8e4b5@colorfullife.com>
On Wed, 18 Jul 2018, Manfred Spraul wrote:
>Hello Davidlohr,
>
>On 07/17/2018 07:26 AM, Davidlohr Bueso wrote:
>>In order for load/store tearing to work, _all_ accesses to
>>the variable in question need to be done around READ and
>>WRITE_ONCE() macros. Ensure everyone does so for q->status
>>variable for semtimedop().
>What is the background of the above rule?
The fact that it's done under the ipc lock, doesn't mean that
the compiler won't try to get smart. If we have lockless accesses
we musn't see partial stores/loads.
>
>sma->use_global_lock is sometimes used with smp_load_acquire(),
>sometimes without.
>So far, I assumed that this is safe.
>
>The same applies for nf_conntrack_locks_all, in nf_conntrack_all_lock()
Oh, yeah I remember _that_ saga. I'll have a look but iirc it
seemd ok back then.
Thanks,
Davidlohr
next prev parent reply other threads:[~2018-07-20 18:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-17 5:26 Davidlohr Bueso
2018-07-17 5:28 ` Davidlohr Bueso
2018-07-18 3:55 ` Manfred Spraul
2018-07-20 18:25 ` Davidlohr Bueso [this message]
2018-07-30 22:08 ` Davidlohr Bueso
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=20180720182534.2u2fh5i2cyhd7owo@linux-r8p5 \
--to=dave@stgolabs.net \
--cc=akpm@linux-foundation.org \
--cc=dbueso@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.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
all inboxes | Powered by JetHome®