Skip to content

Commit 7574ac6

Browse files
Thomas GleixnerPeter Zijlstra
authored andcommitted
sched/mmcid: Remove pointless preempt guard
This is a leftover from the early versions of this function where it could be invoked without mm::mm_cid::lock held. Remove it and add lockdep asserts instead. Fixes: 653fda7 ("sched/mmcid: Switch over to the new mechanism") Signed-off-by: Thomas Gleixner <tglx@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20260310202526.116363613@kernel.org
1 parent 28b5a13 commit 7574ac6

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

kernel/sched/core.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10684,6 +10684,8 @@ static void mm_cid_fixup_tasks_to_cpus(void)
1068410684

1068510685
static bool sched_mm_cid_add_user(struct task_struct *t, struct mm_struct *mm)
1068610686
{
10687+
lockdep_assert_held(&mm->mm_cid.lock);
10688+
1068710689
t->mm_cid.active = 1;
1068810690
mm->mm_cid.users++;
1068910691
return mm_update_max_cids(mm);
@@ -10736,12 +10738,12 @@ static void sched_mm_cid_fork(struct task_struct *t)
1073610738

1073710739
static bool sched_mm_cid_remove_user(struct task_struct *t)
1073810740
{
10741+
lockdep_assert_held(&t->mm->mm_cid.lock);
10742+
1073910743
t->mm_cid.active = 0;
10740-
scoped_guard(preempt) {
10741-
/* Clear the transition bit */
10742-
t->mm_cid.cid = cid_from_transit_cid(t->mm_cid.cid);
10743-
mm_unset_cid_on_task(t);
10744-
}
10744+
/* Clear the transition bit */
10745+
t->mm_cid.cid = cid_from_transit_cid(t->mm_cid.cid);
10746+
mm_unset_cid_on_task(t);
1074510747
t->mm->mm_cid.users--;
1074610748
return mm_update_max_cids(t->mm);
1074710749
}

0 commit comments

Comments
 (0)