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] cpuidle: redefine cpumask_lock as rwlock_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] cpuidle: redefine cpumask_lock as rwlock_t
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jun 2010 10:45:18 -0700
Delivery-date: Mon, 21 Jun 2010 10:46:46 -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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1276761192 -3600
# Node ID 764e41b090173b0d8830c5688d5e05814e1b598d
# Parent  d0ad966b3d1a8653e2d147baf2843f2ca5ea7aed
cpuidle: redefine cpumask_lock as rwlock_t

Multiple cpus clear hpet channel cpumask simultaneously is ok. So we
can change the cpumask_lock to rwlock_t.

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
---
 xen/arch/x86/hpet.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff -r d0ad966b3d1a -r 764e41b09017 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c       Thu Jun 17 08:52:50 2010 +0100
+++ b/xen/arch/x86/hpet.c       Thu Jun 17 08:53:12 2010 +0100
@@ -34,7 +34,7 @@ struct hpet_event_channel
     int           shift;
     s_time_t      next_event;
     cpumask_t     cpumask;
-    spinlock_t    cpumask_lock;
+    rwlock_t      cpumask_lock;
     spinlock_t    lock;
     void          (*event_handler)(struct hpet_event_channel *);
 
@@ -197,7 +197,7 @@ again:
     /* find all expired events */
     for_each_cpu_mask(cpu, ch->cpumask)
     {
-        spin_lock_irq(&ch->cpumask_lock);
+        write_lock_irq(&ch->cpumask_lock);
 
         if ( cpumask_test_cpu(cpu, ch->cpumask) )
         {
@@ -207,7 +207,7 @@ again:
                 next_event = per_cpu(timer_deadline_end, cpu);
         }
 
-        spin_unlock_irq(&ch->cpumask_lock);
+        write_unlock_irq(&ch->cpumask_lock);
     }
 
     /* wakeup the cpus which have an expired event. */
@@ -580,7 +580,7 @@ void hpet_broadcast_init(void)
             hpet_events[i].next_event = STIME_MAX;
             hpet_events[i].event_handler = handle_hpet_broadcast;
             spin_lock_init(&hpet_events[i].lock);
-            spin_lock_init(&hpet_events[i].cpumask_lock);
+            rwlock_init(&hpet_events[i].cpumask_lock);
         }
 
         return;
@@ -615,7 +615,7 @@ void hpet_broadcast_init(void)
     legacy_hpet_event.idx = 0;
     legacy_hpet_event.flags = 0;
     spin_lock_init(&legacy_hpet_event.lock);
-    spin_lock_init(&legacy_hpet_event.cpumask_lock);
+    rwlock_init(&legacy_hpet_event.cpumask_lock);
 
     if ( !force_hpet_broadcast )
         pv_rtc_handler = handle_rtc_once;
@@ -692,9 +692,9 @@ void hpet_broadcast_exit(void)
     if ( !reprogram_timer(this_cpu(timer_deadline_start)) )
         raise_softirq(TIMER_SOFTIRQ);
 
-    spin_lock_irq(&ch->cpumask_lock);
+    read_lock_irq(&ch->cpumask_lock);
     cpu_clear(cpu, ch->cpumask);
-    spin_unlock_irq(&ch->cpumask_lock);
+    read_unlock_irq(&ch->cpumask_lock);
 
     if ( ch != &legacy_hpet_event )
     {

_______________________________________________
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] cpuidle: redefine cpumask_lock as rwlock_t, Xen patchbot-unstable <=