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-devel

Re: [Xen-devel] [PATCH] rcu: move private declarations and definitions f

To: Jan Beulich <JBeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] rcu: move private declarations and definitions from header to implementation
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Fri, 14 Oct 2011 09:00:15 +0100
Cc:
Delivery-date: Fri, 14 Oct 2011 01:08:35 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=BZdEtsLAah/Y2xyyYGb0pMCRjiNjzHnk4tEYwkGluCE=; b=M+W8NQGX1lI+b0EKGMiDVeoAne+0gjtl4gs1gpDkSGyOCdQ38uucsR5seWF46ZXwfq ccg+612PUBwhKelyDe+2r4O+VzoCbT083tVBA0KJ7H3QJp5mMowQDxm62tLLcdGHAtbW O8qr7WL5xuy4GHpAML2S8mYuOKAsdgD3ksIvo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E9805E0020000780005B56F@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcyKR05tTejMS8/ZIk25Fs4RxpFKRA==
Thread-topic: [Xen-devel] [PATCH] rcu: move private declarations and definitions from header to implementation
User-agent: Microsoft-Entourage/12.30.0.110427
On 14/10/2011 08:50, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> No consumer of RCU should need to see these, and there's also no need
> to clutter the global name space with them.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

> --- a/xen/common/rcupdate.c
> +++ b/xen/common/rcupdate.c
> @@ -46,15 +46,50 @@
>  #include <xen/cpu.h>
>  #include <xen/stop_machine.h>
>  
> -/* Definition for rcupdate control block. */
> -struct rcu_ctrlblk rcu_ctrlblk = {
> +/* Global control variables for rcupdate callback mechanism. */
> +static struct rcu_ctrlblk {
> +    long cur;           /* Current batch number.                      */
> +    long completed;     /* Number of the last completed batch         */
> +    int  next_pending;  /* Is the next batch already waiting?         */
> +
> +    spinlock_t  lock __cacheline_aligned;
> +    cpumask_t   cpumask; /* CPUs that need to switch in order    */
> +    /* for current batch to proceed.        */
> +} __cacheline_aligned rcu_ctrlblk = {
>      .cur = -300,
>      .completed = -300,
>      .lock = SPIN_LOCK_UNLOCKED,
>      .cpumask = CPU_MASK_NONE,
>  };
>  
> -DEFINE_PER_CPU(struct rcu_data, rcu_data);
> +/*
> + * Per-CPU data for Read-Copy Update.
> + * nxtlist - new callbacks are added here
> + * curlist - current batch for which quiescent cycle started if any
> + */
> +struct rcu_data {
> +    /* 1) quiescent state handling : */
> +    long quiescbatch;    /* Batch # for grace period */
> +    int  qs_pending;     /* core waits for quiesc state */
> +
> +    /* 2) batch handling */
> +    long            batch;            /* Batch # for current RCU batch */
> +    struct rcu_head *nxtlist;
> +    struct rcu_head **nxttail;
> +    long            qlen;             /* # of queued callbacks */
> +    struct rcu_head *curlist;
> +    struct rcu_head **curtail;
> +    struct rcu_head *donelist;
> +    struct rcu_head **donetail;
> +    long            blimit;           /* Upper limit on a processed batch */
> +    int cpu;
> +    struct rcu_head barrier;
> +#ifdef CONFIG_SMP
> +    long            last_rs_qlen;     /* qlen during the last resched */
> +#endif
> +};
> +
> +static DEFINE_PER_CPU(struct rcu_data, rcu_data);
>  
>  static int blimit = 10;
>  static int qhimark = 10000;
> @@ -104,6 +139,18 @@ int rcu_barrier(void)
>      return stop_machine_run(rcu_barrier_action, &cpu_count, NR_CPUS);
>  }
>  
> +/* Is batch a before batch b ? */
> +static inline int rcu_batch_before(long a, long b)
> +{
> +    return (a - b) < 0;
> +}
> +
> +/* Is batch a after batch b ? */
> +static inline int rcu_batch_after(long a, long b)
> +{
> +    return (a - b) > 0;
> +}
> +
>  static void force_quiescent_state(struct rcu_data *rdp,
>                                    struct rcu_ctrlblk *rcp)
>  {
> --- a/xen/include/xen/rcupdate.h
> +++ b/xen/include/xen/rcupdate.h
> @@ -57,60 +57,6 @@ struct rcu_head {
>  } while (0)
>  
>  
> -
> -/* Global control variables for rcupdate callback mechanism. */
> -struct rcu_ctrlblk {
> -    long cur;           /* Current batch number.                      */
> -    long completed;     /* Number of the last completed batch         */
> -    int  next_pending;  /* Is the next batch already waiting?         */
> -
> -    spinlock_t  lock __cacheline_aligned;
> -    cpumask_t   cpumask; /* CPUs that need to switch in order    */
> -    /* for current batch to proceed.        */
> -} __cacheline_aligned;
> -
> -/* Is batch a before batch b ? */
> -static inline int rcu_batch_before(long a, long b)
> -{
> -    return (a - b) < 0;
> -}
> -
> -/* Is batch a after batch b ? */
> -static inline int rcu_batch_after(long a, long b)
> -{
> -    return (a - b) > 0;
> -}
> -
> -/*
> - * Per-CPU data for Read-Copy Update.
> - * nxtlist - new callbacks are added here
> - * curlist - current batch for which quiescent cycle started if any
> - */
> -struct rcu_data {
> -    /* 1) quiescent state handling : */
> -    long quiescbatch;    /* Batch # for grace period */
> -    int  qs_pending;     /* core waits for quiesc state */
> -
> -    /* 2) batch handling */
> -    long            batch;            /* Batch # for current RCU batch */
> -    struct rcu_head *nxtlist;
> -    struct rcu_head **nxttail;
> -    long            qlen;             /* # of queued callbacks */
> -    struct rcu_head *curlist;
> -    struct rcu_head **curtail;
> -    struct rcu_head *donelist;
> -    struct rcu_head **donetail;
> -    long            blimit;           /* Upper limit on a processed batch */
> -    int cpu;
> -    struct rcu_head barrier;
> -#ifdef CONFIG_SMP
> -    long            last_rs_qlen;     /* qlen during the last resched */
> -#endif
> -};
> -
> -DECLARE_PER_CPU(struct rcu_data, rcu_data);
> -extern struct rcu_ctrlblk rcu_ctrlblk;
> -
>  int rcu_pending(int cpu);
>  int rcu_needs_cpu(int cpu);
>  
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

<Prev in Thread] Current Thread [Next in Thread>