From: Peter Zijlstra <peterz@infradead.org>
To: mingo@redhat.com
Cc: peterz@infradead.org, 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,
linux-kernel@vger.kernel.org
Subject: [PATCH 0/8] sched: Use lock guards, wave 2
Date: Wed, 09 Aug 2023 22:24:40 +0200 [thread overview]
Message-ID: <20230809202440.012625269@infradead.org> (raw)
Hi, as promised, here is the second part of the SBRM patches.
Now that we're a little used to them, these are a little more involved.
New in this series, over the guard()() and scoped_guard () usage, is CLASS().
CLASS() is very like guard() except it also takes a name argument. So where
guard() instantiates an 'anonymous' variable, CLASS() instantiates an
explicitly named one.
CLASS(task_rq_lock, rq_guard)(p);
which can be read like:
class_task_rq_lock_t rq_guard __cleanup(class_task_rq_lock_destructor) =
class_task_rq_lock_constructor(p);
[[ Notable: guard(name) := CLASS(name, __UNIQUE_ID(guard)) ]]
The advantage in this specific case is that the guard object of task_rq_lock
will contain the 'struct rq *' which we'll need.
Another use of CLASS() is:
CLASS(find_get_task, p)(pid);
Where 'p' is of 'struct task_struct *' type and the constructor does the
pid->task_struct lookup and the destructor does put_task_struct.
Again, mostly aimed at getting rid of error gotos. The final patch is a bunch
of random conversions that happened while I was poking around and playing with
things.
Also available at:
git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/guards2
Next in line is kernel/events/core.c, but I might not bore all of you with those
patches :-)
next reply other threads:[~2023-08-09 20:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 20:24 Peter Zijlstra [this message]
2023-08-09 20:24 ` [PATCH 1/8] sched: Simplify set_user_nice() Peter Zijlstra
2023-08-09 20:24 ` [PATCH 2/8] sched: Simplify syscalls Peter Zijlstra
2023-08-09 20:24 ` [PATCH 3/8] sched: Simplify sched_{set,get}affinity() Peter Zijlstra
2023-08-09 20:24 ` [PATCH 4/8] sched: Simplify yield_to() Peter Zijlstra
2023-08-09 20:24 ` [PATCH 5/8] sched: Simplify sched_rr_get_interval() Peter Zijlstra
2023-08-09 20:24 ` [PATCH 6/8] sched: Simplify sched_move_task() Peter Zijlstra
2023-08-09 20:24 ` [PATCH 7/8] sched: Simplify tg_set_cfs_bandwidth() Peter Zijlstra
2023-08-09 20:24 ` [PATCH 8/8] sched: Misc cleanups Peter Zijlstra
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=20230809202440.012625269@infradead.org \
--to=peterz@infradead.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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®