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] rcu: Migrate RCU work when taking a CPU o

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] rcu: Migrate RCU work when taking a CPU offline.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 May 2010 07:45:13 -0700
Delivery-date: Wed, 19 May 2010 07:45:39 -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 1274274397 -3600
# Node ID bc2364ad816d1979b21a869316abdaa6e6dfc033
# Parent  a3cf0d9a1b188d65c84186536a7c004790235af6
rcu: Migrate RCU work when taking a CPU offline.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/rcupdate.c |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 deletions(-)

diff -r a3cf0d9a1b18 -r bc2364ad816d xen/common/rcupdate.c
--- a/xen/common/rcupdate.c     Wed May 19 12:53:44 2010 +0100
+++ b/xen/common/rcupdate.c     Wed May 19 14:06:37 2010 +0100
@@ -322,6 +322,36 @@ void rcu_check_callbacks(int cpu)
     raise_softirq(RCU_SOFTIRQ);
 }
 
+static void rcu_move_batch(struct rcu_data *this_rdp, struct rcu_head *list,
+                           struct rcu_head **tail)
+{
+    local_irq_disable();
+    *this_rdp->nxttail = list;
+    if (list)
+        this_rdp->nxttail = tail;
+    local_irq_enable();
+}
+
+static void rcu_offline_cpu(struct rcu_data *this_rdp,
+                            struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
+{
+    /* If the cpu going offline owns the grace period we can block
+     * indefinitely waiting for it, so flush it here.
+     */
+    spin_lock(&rcp->lock);
+    if (rcp->cur != rcp->completed)
+        cpu_quiet(rdp->cpu, rcp);
+    spin_unlock(&rcp->lock);
+
+    rcu_move_batch(this_rdp, rdp->donelist, rdp->donetail);
+    rcu_move_batch(this_rdp, rdp->curlist, rdp->curtail);
+    rcu_move_batch(this_rdp, rdp->nxtlist, rdp->nxttail);
+
+    local_irq_disable();
+    this_rdp->qlen += rdp->qlen;
+    local_irq_enable();
+}
+
 static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
                                  struct rcu_data *rdp)
 {
@@ -339,14 +369,17 @@ static int cpu_callback(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
     unsigned int cpu = (unsigned long)hcpu;
+    struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
 
     switch ( action )
     {
-    case CPU_UP_PREPARE: {
-        struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
+    case CPU_UP_PREPARE:
         rcu_init_percpu_data(cpu, &rcu_ctrlblk, rdp);
         break;
-    }
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        rcu_offline_cpu(&this_cpu(rcu_data), &rcu_ctrlblk, rdp);
+        break;
     default:
         break;
     }

_______________________________________________
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] rcu: Migrate RCU work when taking a CPU offline., Xen patchbot-unstable <=