All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/2] Lock and Pointer guards
@ 2023-05-26 15:05 Peter Zijlstra
  2023-05-26 15:05 ` [RFC][PATCH 1/2] locking: Introduce __cleanup__ based guards Peter Zijlstra
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Peter Zijlstra @ 2023-05-26 15:05 UTC (permalink / raw)
  To: torvalds, keescook, gregkh, pbonzini
  Cc: linux-kernel, ojeda, ndesaulniers, peterz, mingo, will, longman,
	boqun.feng, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid, paulmck, frederic,
	quic_neeraju, joel, josh, mathieu.desnoyers, jiangshanlai,
	qiang1.zhang, rcu, tj, tglx

Hi!

Yesterday I was annoyed for the lack of RAII lock guards for entirely spurious
reason, but since you sometimes gotta do silly things I spend today creating some.

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.

I really like how they end up simplifying the code, but perhaps y'all hate them
with a passion?

I'm thinking we'll at least have a good brawl over naming, esp. the void_guard
needs a better name.

Compile and boot tested with x86_64-defconfig.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-05-29 11:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-26 15:05 [RFC][PATCH 0/2] Lock and Pointer guards 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 ` [RFC][PATCH 0/2] Lock and Pointer guards Paolo Bonzini

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.