]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched: Rename do_set_cpus_allowed()
authorPeter Zijlstra <peterz@infradead.org>
Wed, 10 Sep 2025 08:08:05 +0000 (10:08 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 16 Oct 2025 09:13:53 +0000 (11:13 +0200)
Hopefully saner naming.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
include/linux/sched.h
kernel/cgroup/cpuset.c
kernel/kthread.c
kernel/sched/core.c
kernel/sched/sched.h

index cbb7340c5866fba8ba64305e44a535c6adb54c69..77426c347cff54d82eaec49bc5e21a82bca15ca7 100644 (file)
@@ -1861,8 +1861,8 @@ extern int task_can_attach(struct task_struct *p);
 extern int dl_bw_alloc(int cpu, u64 dl_bw);
 extern void dl_bw_free(int cpu, u64 dl_bw);
 
-/* do_set_cpus_allowed() - consider using set_cpus_allowed_ptr() instead */
-extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask);
+/* set_cpus_allowed_force() - consider using set_cpus_allowed_ptr() instead */
+extern void set_cpus_allowed_force(struct task_struct *p, const struct cpumask *new_mask);
 
 /**
  * set_cpus_allowed_ptr - set CPU affinity mask of a task
index 52468d2c178a3ef6b71d42f3b4fff748d0943cf6..185e820cd1df8cc53df75fde3c41b62446d0c3ae 100644 (file)
@@ -4180,7 +4180,7 @@ bool cpuset_cpus_allowed_fallback(struct task_struct *tsk)
        rcu_read_lock();
        cs_mask = task_cs(tsk)->cpus_allowed;
        if (is_in_v2_mode() && cpumask_subset(cs_mask, possible_mask)) {
-               do_set_cpus_allowed(tsk, cs_mask);
+               set_cpus_allowed_force(tsk, cs_mask);
                changed = true;
        }
        rcu_read_unlock();
index 832bd2afecc68b93ae55c949480a3b48dd549d3c..99a3808d086f081eabb45daf3450184182dfc8a2 100644 (file)
@@ -599,7 +599,7 @@ static void __kthread_bind_mask(struct task_struct *p, const struct cpumask *mas
        }
 
        scoped_guard (raw_spinlock_irqsave, &p->pi_lock)
-               do_set_cpus_allowed(p, mask);
+               set_cpus_allowed_force(p, mask);
 
        /* It's safe because the task is inactive. */
        p->flags |= PF_NO_SETAFFINITY;
@@ -880,7 +880,7 @@ int kthread_affine_preferred(struct task_struct *p, const struct cpumask *mask)
        kthread_fetch_affinity(kthread, affinity);
 
        scoped_guard (raw_spinlock_irqsave, &p->pi_lock)
-               do_set_cpus_allowed(p, affinity);
+               set_cpus_allowed_force(p, affinity);
 
        mutex_unlock(&kthreads_hotplug_lock);
 out:
index 805e65007e62fbe24b2c5e3e6dcefb101de5acd0..638bffd4c1a2b3f9b85cbdb633e7990f40437a52 100644 (file)
@@ -2331,7 +2331,7 @@ unsigned long wait_task_inactive(struct task_struct *p, unsigned int match_state
 }
 
 static void
-__do_set_cpus_allowed(struct task_struct *p, struct affinity_context *ctx);
+do_set_cpus_allowed(struct task_struct *p, struct affinity_context *ctx);
 
 static void migrate_disable_switch(struct rq *rq, struct task_struct *p)
 {
@@ -2348,7 +2348,7 @@ static void migrate_disable_switch(struct rq *rq, struct task_struct *p)
 
        scoped_guard (task_rq_lock, p) {
                update_rq_clock(scope.rq);
-               __do_set_cpus_allowed(p, &ac);
+               do_set_cpus_allowed(p, &ac);
        }
 }
 
@@ -2662,7 +2662,7 @@ void set_cpus_allowed_common(struct task_struct *p, struct affinity_context *ctx
 }
 
 static void
-__do_set_cpus_allowed(struct task_struct *p, struct affinity_context *ctx)
+do_set_cpus_allowed(struct task_struct *p, struct affinity_context *ctx)
 {
        struct rq *rq = task_rq(p);
        bool queued, running;
@@ -2692,7 +2692,7 @@ __do_set_cpus_allowed(struct task_struct *p, struct affinity_context *ctx)
  * Used for kthread_bind() and select_fallback_rq(), in both cases the user
  * affinity (if any) should be destroyed too.
  */
-void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
+void set_cpus_allowed_force(struct task_struct *p, const struct cpumask *new_mask)
 {
        struct affinity_context ac = {
                .new_mask  = new_mask,
@@ -2706,7 +2706,7 @@ void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
 
        scoped_guard (__task_rq_lock, p) {
                update_rq_clock(scope.rq);
-               __do_set_cpus_allowed(p, &ac);
+               do_set_cpus_allowed(p, &ac);
        }
 
        /*
@@ -2745,7 +2745,7 @@ int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src,
         * Use pi_lock to protect content of user_cpus_ptr
         *
         * Though unlikely, user_cpus_ptr can be reset to NULL by a concurrent
-        * do_set_cpus_allowed().
+        * set_cpus_allowed_force().
         */
        raw_spin_lock_irqsave(&src->pi_lock, flags);
        if (src->user_cpus_ptr) {
@@ -3073,7 +3073,7 @@ static int __set_cpus_allowed_ptr_locked(struct task_struct *p,
                goto out;
        }
 
-       __do_set_cpus_allowed(p, ctx);
+       do_set_cpus_allowed(p, ctx);
 
        return affine_move_task(rq, p, rf, dest_cpu, ctx->flags);
 
@@ -3482,7 +3482,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
                        }
                        fallthrough;
                case possible:
-                       do_set_cpus_allowed(p, task_cpu_fallback_mask(p));
+                       set_cpus_allowed_force(p, task_cpu_fallback_mask(p));
                        state = fail;
                        break;
                case fail:
index b23ce9c77611e4ed34930a99935e3c9a8234b6b7..ea2ea8fd6505172b72912ae90606d6f40441d417 100644 (file)
@@ -2617,7 +2617,7 @@ static inline bool task_allowed_on_cpu(struct task_struct *p, int cpu)
 static inline cpumask_t *alloc_user_cpus_ptr(int node)
 {
        /*
-        * See do_set_cpus_allowed() above for the rcu_head usage.
+        * See set_cpus_allowed_force() above for the rcu_head usage.
         */
        int size = max_t(int, cpumask_size(), sizeof(struct rcu_head));