[PATCH v3 04/28] xen/sched: remove vcpu_set_soft_affinity()

Penny Zheng posted 28 patches 2 weeks, 3 days ago
Only 27 patches received!
[PATCH v3 04/28] xen/sched: remove vcpu_set_soft_affinity()
Posted by Penny Zheng 2 weeks, 3 days ago
Helper vcpu_set_soft_affinity() only has a single caller, so it is of little
value to keep it as a helper and could easily be expanded at the sole call
site.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
---
v2 -> v3:
- new commit
---
 xen/common/sched/core.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 2ab4313517..ec2448cfa1 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1402,11 +1402,6 @@ int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity)
     return vcpu_set_affinity(v, affinity, v->sched_unit->cpu_hard_affinity);
 }
 
-static int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinity)
-{
-    return vcpu_set_affinity(v, affinity, v->sched_unit->cpu_soft_affinity);
-}
-
 /* Block the currently-executing domain until a pertinent event occurs. */
 void vcpu_block(void)
 {
@@ -1762,8 +1757,9 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t cmd,
         {
             ret = xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity),
                                           &vcpuaff->cpumap_soft, nr_cpu_ids);
-            if ( !ret)
-                ret = vcpu_set_soft_affinity(v, new_affinity);
+            if ( !ret )
+                ret = vcpu_set_affinity(v, new_affinity,
+                                        v->sched_unit->cpu_soft_affinity);
             if ( ret )
             {
                 /*
-- 
2.34.1
Re: [PATCH v3 04/28] xen/sched: remove vcpu_set_soft_affinity()
Posted by Jürgen Groß 2 weeks, 3 days ago
On 13.10.25 12:15, Penny Zheng wrote:
> Helper vcpu_set_soft_affinity() only has a single caller, so it is of little
> value to keep it as a helper and could easily be expanded at the sole call
> site.
> 
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen