sched: Use lock guards, wave 2
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | sched: Simplify set_user_nice()kernel/ kernel/ | +11 | 0 replies | |
| 2/8 | sched: Simplify syscallskernel/ | +68 | 0 replies | |
| 3/8 | sched: Simplify sched_{set,get}affinity()kernel/ | +14 | 0 replies | |
| 4/8 | sched: Simplify yield_to()kernel/ | +32 | 0 replies | |
| 5/8 | sched: Simplify sched_rr_get_interval()kernel/ | +16 | 0 replies | |
| 6/8 | sched: Simplify sched_move_task()kernel/ | +4 | 0 replies | |
| 7/8 | sched: Simplify tg_set_cfs_bandwidth()include/ kernel/ | +23 | 0 replies | |
| 8/8 | sched: Misc cleanupskernel/ | +63 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/8] sched: Use lock guards, wave 2
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 :-)