Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 653fda7ae73d ("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

authored by

Thomas Gleixner and committed by
Peter Zijlstra
7574ac6e 28b5a139

+7 -5
+7 -5
kernel/sched/core.c
··· 10684 10684 10685 10685 static bool sched_mm_cid_add_user(struct task_struct *t, struct mm_struct *mm) 10686 10686 { 10687 + lockdep_assert_held(&mm->mm_cid.lock); 10688 + 10687 10689 t->mm_cid.active = 1; 10688 10690 mm->mm_cid.users++; 10689 10691 return mm_update_max_cids(mm); ··· 10738 10736 10739 10737 static bool sched_mm_cid_remove_user(struct task_struct *t) 10740 10738 { 10739 + lockdep_assert_held(&t->mm->mm_cid.lock); 10740 + 10741 10741 t->mm_cid.active = 0; 10742 - scoped_guard(preempt) { 10743 - /* Clear the transition bit */ 10744 - t->mm_cid.cid = cid_from_transit_cid(t->mm_cid.cid); 10745 - mm_unset_cid_on_task(t); 10746 - } 10742 + /* Clear the transition bit */ 10743 + t->mm_cid.cid = cid_from_transit_cid(t->mm_cid.cid); 10744 + mm_unset_cid_on_task(t); 10747 10745 t->mm->mm_cid.users--; 10748 10746 return mm_update_max_cids(t->mm); 10749 10747 }