From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>,
torvalds@linux-foundation.org, keescook@chromium.org,
gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, ojeda@kernel.org,
ndesaulniers@google.com, mingo@redhat.com, will@kernel.org,
longman@redhat.com, boqun.feng@gmail.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, vschneid@redhat.com, paulmck@kernel.org,
frederic@kernel.org, quic_neeraju@quicinc.com,
joel@joelfernandes.org, josh@joshtriplett.org,
mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
qiang1.zhang@intel.com, rcu@vger.kernel.org, tj@kernel.org,
tglx@linutronix.de
Subject: Re: [RFC][PATCH 0/2] Lock and Pointer guards
Date: Mon, 29 May 2023 13:29:37 +0200 [thread overview]
Message-ID: <bed45ea4-12e0-5a96-6196-9903b45178f2@redhat.com> (raw)
In-Reply-To: <20230526150549.250372621@infradead.org>
On 5/26/23 17:05, Peter Zijlstra wrote:
> My initial (failed) attempts tried to combine __cleanup, _Generic and
> __auto_type, but the compilers refused. I've also Googled around and found
> (among many others) the QEMU and Glib guards. However I don't like them because
> they end up relying on function pointers/indirect calls.
>
> Hence the current pile of CPP hackery.. no indirect calls in sight.
QEMU's guards in practice also compiles down to direct calls, but yes
that's only after the compiler inlines everything in the vtable. I did
it that way because the polymorphic locks already existed before,
otherwise your solution with Linus's tweak for "bool" is as nice as it
can be. I like that it extends to irqoff and irqsave sections.
Paolo
prev parent reply other threads:[~2023-05-29 11:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 15:05 Peter Zijlstra
2023-05-26 15:05 ` [RFC][PATCH 1/2] locking: Introduce __cleanup__ based guards Peter Zijlstra
2023-05-26 17:05 ` Kees Cook
2023-05-26 18:39 ` Miguel Ojeda
2023-05-26 18:22 ` Linus Torvalds
2023-05-26 19:10 ` Peter Zijlstra
2023-05-26 18:49 ` Waiman Long
2023-05-26 18:58 ` Mathieu Desnoyers
2023-05-26 19:04 ` Waiman Long
2023-05-26 15:05 ` [RFC][PATCH 2/2] sched: Use fancy new guards Peter Zijlstra
2023-05-26 16:25 ` Greg KH
2023-05-26 16:27 ` Mathieu Desnoyers
2023-05-26 16:43 ` Peter Zijlstra
2023-05-26 17:08 ` Kees Cook
2023-05-26 17:41 ` Miguel Ojeda
2023-05-26 16:41 ` Peter Zijlstra
2023-05-29 11:29 ` Paolo Bonzini [this message]
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=bed45ea4-12e0-5a96-6196-9903b45178f2@redhat.com \
--to=pbonzini@redhat.com \
--cc=boqun.feng@gmail.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=frederic@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=juri.lelli@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=qiang1.zhang@intel.com \
--cc=quic_neeraju@quicinc.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=will@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 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®