From: Ingo Molnar <mingo@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: mingo@redhat.com, andy.shevchenko@gmail.com, arnd@arndb.de,
aryabinin@virtuozzo.com, boqun.feng@gmail.com,
catalin.marinas@arm.com, dvyukov@google.com, glider@google.com,
hpa@zytor.com, linux-kernel@vger.kernel.org,
parri.andrea@gmail.com, peter@hurleysoftware.com,
peterz@infradead.org, tglx@linutronix.de, will.deacon@arm.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv4 01/12] atomic/tty: Fix up atomic abuse in ldsem
Date: Tue, 24 Jul 2018 09:15:18 +0200 [thread overview]
Message-ID: <20180724071518.GA7300@gmail.com> (raw)
In-Reply-To: <20180716113017.3909-2-mark.rutland@arm.com>
* Mark Rutland <mark.rutland@arm.com> wrote:
> From: Peter Zijlstra <peterz@infradead.org>
>
> Mark found ldsem_cmpxchg() needed an (atomic_long_t *) cast to keep
> working after making the atomic_long interface type safe.
>
> Needing casts is bad form, which made me look at the code. There are no
> ld_semaphore::count users outside of these functions so there is no
> reason why it can not be an atomic_long_t in the first place, obviating
> the need for this cast.
>
> That also ensures the loads use atomic_long_read(), which implies (at
> least) READ_ONCE() in order to guarantee single-copy-atomic loads.
>
> When using atomic_long_try_cmpxchg() the ldsem_cmpxchg() wrapper gets
> very thin (the only difference is not changing *old on success, which
> most callers don't seem to care about).
>
> So rework the whole thing to use atomic_long_t and its accessors
> directly.
>
> While there, fixup all the horrible comment styles.
>
> Cc: Peter Hurley <peter@hurleysoftware.com>
> Acked-by: Will Deacon <will.deacon@arm.com>
> Reported-by: Mark Rutland <mark.rutland@arm.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> ---
> drivers/tty/tty_ldsem.c | 82 ++++++++++++++++++++---------------------------
> include/linux/tty_ldisc.h | 4 +--
> 2 files changed, 37 insertions(+), 49 deletions(-)
>
> Note: Greg has queued this via the in the tty tree for v4.19, which can be seen at:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git/commit/?h=tty-next&id=5fd691afdf929061c391d897fa627822c3b2fd5a
Can this patch be skipped, or do the others depend on it?
Thanks,
Ingo
next prev parent reply other threads:[~2018-07-24 7:15 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 11:30 [PATCHv4 00/12] atomics: generate atomic headers / instrument arm64 Mark Rutland
2018-07-16 11:30 ` [PATCHv4 01/12] atomic/tty: Fix up atomic abuse in ldsem Mark Rutland
2018-07-24 7:15 ` Ingo Molnar [this message]
2018-07-24 9:20 ` Peter Zijlstra
2018-07-24 9:23 ` Mark Rutland
2018-07-24 11:13 ` Ingo Molnar
2018-07-24 13:05 ` Mark Rutland
2018-07-24 13:40 ` Ingo Molnar
2018-07-24 15:06 ` Mark Rutland
2018-07-16 11:30 ` [PATCHv4 02/12] atomics/x86: reduce arch_cmpxchg64*() instrumentation Mark Rutland
2018-07-16 19:23 ` Thomas Gleixner
2018-07-25 14:34 ` [tip:locking/core] locking/atomics/x86: Reduce " tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 03/12] atomics: simplify cmpxchg() instrumentation Mark Rutland
2018-07-25 14:34 ` [tip:locking/core] locking/atomics: Simplify " tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 04/12] atomics/treewide: instrument xchg() Mark Rutland
2018-07-25 14:35 ` [tip:locking/core] locking/atomics: Instrument xchg() tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 05/12] atomics: instrument cmpxchg_double*() Mark Rutland
2018-07-25 14:35 ` [tip:locking/core] locking/atomics: Instrument cmpxchg_double*() tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 06/12] atomics/treewide: rework ordering barriers Mark Rutland
2018-07-25 14:36 ` [tip:locking/core] locking/atomics: Rework " tip-bot for Mark Rutland
2018-07-16 11:30 ` [PATCHv4 07/12] atomics: add common header generation files Mark Rutland
2018-07-16 11:30 ` [PATCHv4 08/12] atomics: switch to generated fallbacks Mark Rutland
2018-07-16 11:30 ` [PATCHv4 09/12] atomics: switch to generated atomic-long Mark Rutland
2018-07-16 11:30 ` [PATCHv4 10/12] atomics: switch to generated instrumentation Mark Rutland
2018-07-16 11:30 ` [PATCHv4 11/12] atomics: check generated headers are up-to-date Mark Rutland
2018-07-16 11:30 ` [PATCHv4 12/12] arm64: use instrumented atomics Mark Rutland
2018-07-23 9:57 ` [PATCHv4 00/12] atomics: generate atomic headers / instrument arm64 Mark Rutland
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=20180724071518.GA7300@gmail.com \
--to=mingo@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=arnd@arndb.de \
--cc=aryabinin@virtuozzo.com \
--cc=boqun.feng@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=hpa@zytor.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=parri.andrea@gmail.com \
--cc=peter@hurleysoftware.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.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).