WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] constify vcpu_set_affinity()'s second par

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] constify vcpu_set_affinity()'s second parameter
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 14 Oct 2011 18:00:12 +0100
Delivery-date: Fri, 14 Oct 2011 10:09:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1318492813 -7200
# Node ID 39df1692395884e4bf0fc45f720c12e37072a47b
# Parent  dcb2bd283dcaa9a72859cf6b454ad4a8a2129bf2
constify vcpu_set_affinity()'s second parameter

None of the callers actually make use of the function's returning of
the old affinity through its second parameter, and eliminating this
capability allows some callers to no longer use a local variable here,
reducing their stack footprint significantly when building with large
NR_CPUS.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r dcb2bd283dca -r 39df16923958 xen/arch/x86/cpu/mcheck/vmce.c
--- a/xen/arch/x86/cpu/mcheck/vmce.c    Wed Oct 12 17:11:28 2011 +0100
+++ b/xen/arch/x86/cpu/mcheck/vmce.c    Thu Oct 13 10:00:13 2011 +0200
@@ -304,7 +304,6 @@
 int inject_vmce(struct domain *d)
 {
     int cpu = smp_processor_id();
-    cpumask_t affinity;
 
     /* PV guest and HVM guest have different vMCE# injection methods. */
     if ( !test_and_set_bool(d->vcpu[0]->mce_pending) )
@@ -323,11 +322,9 @@
             {
                 cpumask_copy(d->vcpu[0]->cpu_affinity_tmp,
                              d->vcpu[0]->cpu_affinity);
-                cpus_clear(affinity);
-                cpu_set(cpu, affinity);
                 mce_printk(MCE_VERBOSE, "MCE: CPU%d set affinity, old %d\n",
                            cpu, d->vcpu[0]->processor);
-                vcpu_set_affinity(d->vcpu[0], &affinity);
+                vcpu_set_affinity(d->vcpu[0], cpumask_of(cpu));
                 vcpu_kick(d->vcpu[0]);
             }
             else
diff -r dcb2bd283dca -r 39df16923958 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Wed Oct 12 17:11:28 2011 +0100
+++ b/xen/arch/x86/traps.c      Thu Oct 13 10:00:13 2011 +0200
@@ -3113,7 +3113,6 @@
 {
     int cpu = smp_processor_id();
     struct softirq_trap *st = &per_cpu(softirq_trap, cpu);
-    cpumask_t affinity;
 
     BUG_ON(st == NULL);
     BUG_ON(st->vcpu == NULL);
@@ -3129,9 +3128,7 @@
          * Make sure to wakeup the vcpu on the
          * specified processor.
          */
-        cpus_clear(affinity);
-        cpu_set(st->processor, affinity);
-        vcpu_set_affinity(st->vcpu, &affinity);
+        vcpu_set_affinity(st->vcpu, cpumask_of(st->processor));
 
         /* Affinity is restored in the iret hypercall. */
     }
@@ -3201,14 +3198,11 @@
                  !test_and_set_bool(curr->mce_pending) )
             {
                 int cpu = smp_processor_id();
-                cpumask_t affinity;
 
                 cpumask_copy(curr->cpu_affinity_tmp, curr->cpu_affinity);
-                cpus_clear(affinity);
-                cpu_set(cpu, affinity);
                 printk(XENLOG_DEBUG "MCE: CPU%d set affinity, old %d\n",
                        cpu, curr->processor);
-                vcpu_set_affinity(curr, &affinity);
+                vcpu_set_affinity(curr, cpumask_of(cpu));
             }
         }
     }
diff -r dcb2bd283dca -r 39df16923958 xen/common/schedule.c
--- a/xen/common/schedule.c     Wed Oct 12 17:11:28 2011 +0100
+++ b/xen/common/schedule.c     Thu Oct 13 10:00:13 2011 +0200
@@ -587,9 +587,9 @@
     return ret;
 }
 
-int vcpu_set_affinity(struct vcpu *v, cpumask_t *affinity)
+int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 {
-    cpumask_t online_affinity, old_affinity;
+    cpumask_t online_affinity;
     cpumask_t *online;
 
     if ( v->domain->is_pinned )
@@ -601,9 +601,7 @@
 
     vcpu_schedule_lock_irq(v);
 
-    cpumask_copy(&old_affinity, v->cpu_affinity);
     cpumask_copy(v->cpu_affinity, affinity);
-    cpumask_copy(affinity, &old_affinity);
     if ( !cpumask_test_cpu(v->processor, v->cpu_affinity) )
         set_bit(_VPF_migrating, &v->pause_flags);
 
diff -r dcb2bd283dca -r 39df16923958 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h   Wed Oct 12 17:11:28 2011 +0100
+++ b/xen/include/xen/sched.h   Thu Oct 13 10:00:13 2011 +0200
@@ -617,7 +617,7 @@
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
-int vcpu_set_affinity(struct vcpu *v, cpumask_t *affinity);
+int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
 uint64_t get_cpu_idle_time(unsigned int cpu);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] constify vcpu_set_affinity()'s second parameter, Xen patchbot-unstable <=