From: Manfred Spraul <manfred@colorfullife.com>
To: Oleg Nesterov <oleg@redhat.com>, Peter Zijlstra <peterz@infradead.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
LKML <linux-kernel@vger.kernel.org>,
1vier1@web.de, Kirill Tkhai <ktkhai@parallels.com>,
Ingo Molnar <mingo@redhat.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] ipc/sem.c: Update/correct memory barriers.
Date: Sun, 01 Mar 2015 17:07:44 +0100 [thread overview]
Message-ID: <54F33950.1090801@colorfullife.com> (raw)
In-Reply-To: <20150301132232.GA20691@redhat.com>
Hi Oleg,
On 03/01/2015 02:22 PM, Oleg Nesterov wrote:
> On 02/28, Peter Zijlstra wrote:
>> On Sat, Feb 28, 2015 at 09:36:15PM +0100, Manfred Spraul wrote:
>>> +/*
>>> + * Place this after a control barrier (such as e.g. a spin_unlock_wait())
>>> + * to ensure that reads cannot be moved ahead of the control_barrier.
>>> + * Writes do not need a barrier, they are not speculated and thus cannot
>>> + * pass the control barrier.
>>> + */
>>> +#ifndef smp_mb__after_control_barrier
>>> +#define smp_mb__after_control_barrier() smp_rmb()
>>> +#endif
>> Sorry to go bike shedding again; but should we call this:
>>
>> smp_acquire__after_control_barrier() ?
>>
>> The thing is; its not a full MB because:
>>
>> - stores might actually creep into it; while the control dependency
>> guarantees stores will not creep out, nothing is stopping them from
>> getting in;
>>
>> - its not transitive, and our MB is defined to be so.
> I agree, so perhaps it should be named smp_acquire_after_unlock_wait ?
> even if it is actually stronger than "acquire"...
>
> To me "control_barrier" looks a bit confusing. I think this helper should
> be only used after spin_unlock_wait() or spin_is_locked/unlocked().
Then lets make two helpers:
smp_acquire__after_spin_unlock_wait() and
smp_acquire__after_spin_is_unlocked().
I'll send a new proposal.
Oleg: I would leave the update of task_work_run() to you:
The current code is not buggy, doing an docu update immediately and risk
that the patch might collide with other changes is probably not worth it.
--
Manfred
next prev parent reply other threads:[~2015-03-01 16:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-28 20:36 [PATCH] ipc/sem.c: Update/correct memory barriers Manfred Spraul
2015-02-28 21:45 ` Peter Zijlstra
2015-02-28 23:34 ` Paul E. McKenney
2015-03-01 13:28 ` Oleg Nesterov
2015-03-01 13:22 ` Oleg Nesterov
2015-03-01 16:07 ` Manfred Spraul [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-03-01 16:18 Manfred Spraul
2015-03-01 19:16 ` Oleg Nesterov
2015-08-09 17:55 Manfred Spraul
2015-08-10 8:15 ` Peter Zijlstra
2015-08-12 13:31 ` Oleg Nesterov
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=54F33950.1090801@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=1vier1@web.de \
--cc=jpoimboe@redhat.com \
--cc=ktkhai@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.