Skip to content

Commit 5584e8a

Browse files
Waiman-LongPeter Zijlstra
authored andcommitted
sched: Add __releases annotations to affine_move_task()
affine_move_task() assumes task_rq_lock() has been called and it does an implicit task_rq_unlock() before returning. Add the appropriate __releases annotations to make this clear. A typo error in comment is also fixed. Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent ad841e5 commit 5584e8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/sched/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2690,6 +2690,8 @@ void release_user_cpus_ptr(struct task_struct *p)
26902690
*/
26912691
static int affine_move_task(struct rq *rq, struct task_struct *p, struct rq_flags *rf,
26922692
int dest_cpu, unsigned int flags)
2693+
__releases(rq->lock)
2694+
__releases(p->pi_lock)
26932695
{
26942696
struct set_affinity_pending my_pending = { }, *pending = NULL;
26952697
bool stop_pending, complete = false;
@@ -2999,7 +3001,7 @@ static int restrict_cpus_allowed_ptr(struct task_struct *p,
29993001

30003002
/*
30013003
* Restrict the CPU affinity of task @p so that it is a subset of
3002-
* task_cpu_possible_mask() and point @p->user_cpu_ptr to a copy of the
3004+
* task_cpu_possible_mask() and point @p->user_cpus_ptr to a copy of the
30033005
* old affinity mask. If the resulting mask is empty, we warn and walk
30043006
* up the cpuset hierarchy until we find a suitable mask.
30053007
*/

0 commit comments

Comments
 (0)