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 2/5] xen: events: Make last processed event chann

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2/5] xen: events: Make last processed event channel a per-cpu variable.
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Wed, 9 Mar 2011 20:40:04 +0000
Cc: Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jeremy, Keir Fraser <keir.xen@xxxxxxxxx>, James Harper <james.harper@xxxxxxxxxxxxxxxx>
Delivery-date: Wed, 09 Mar 2011 12:40:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110309203216.GK8049@xxxxxxxxxxxx>
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>
Organization: Citrix Systems, Inc.
References: <1299172198.6552.14.camel@xxxxxxxxxxxxxxxxxxxxxx> <1299172215-29470-2-git-send-email-ian.campbell@xxxxxxxxxx> <20110309203216.GK8049@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2011-03-09 at 20:32 +0000, Konrad Rzeszutek Wilk wrote:
> On Thu, Mar 03, 2011 at 05:10:12PM +0000, Ian Campbell wrote:
> > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
> > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> 
> You cloned yourself?

The first is from the original linux-2.6.18-xen.hg commit.

The second is from today as I forward the change upstream.

I wasn't really sure what to do with the historical signed-off-by so I
decided to leave it, just as I would have done if it had been someone
else's.

Ian.

> 
> > [ijc: forward ported from linux-2.6.18-xen.hg 325:b2768401db94]
> > ---
> >  drivers/xen/events.c |   13 ++++++-------
> >  1 files changed, 6 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> > index 75cc6f5..1fc3192 100644
> > --- a/drivers/xen/events.c
> > +++ b/drivers/xen/events.c
> > @@ -1026,6 +1026,8 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
> >  }
> >  
> >  static DEFINE_PER_CPU(unsigned, xed_nesting_count);
> > +static DEFINE_PER_CPU(unsigned int, last_word_idx) = { BITS_PER_LONG - 1 };
> > +static DEFINE_PER_CPU(unsigned int, last_bit_idx) = { BITS_PER_LONG - 1 };
> >  
> >  /*
> >   * Mask out the i least significant bits of w
> > @@ -1043,8 +1045,6 @@ static DEFINE_PER_CPU(unsigned, xed_nesting_count);
> >   */
> >  static void __xen_evtchn_do_upcall(void)
> >  {
> > -   static unsigned int last_word_idx = BITS_PER_LONG - 1;
> > -   static unsigned int last_bit_idx = BITS_PER_LONG - 1;
> >     int word_idx, bit_idx;
> >     int cpu = get_cpu();
> >     struct shared_info *s = HYPERVISOR_shared_info;
> > @@ -1065,8 +1065,8 @@ static void __xen_evtchn_do_upcall(void)
> >  #endif
> >             pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0);
> >  
> > -           word_idx = last_word_idx;
> > -           bit_idx = last_bit_idx;
> > +           word_idx = __this_cpu_read(last_word_idx);
> > +           bit_idx = __this_cpu_read(last_bit_idx);
> >  
> >             while (pending_words != 0) {
> >                     unsigned long pending_bits;
> > @@ -1121,9 +1121,8 @@ static void __xen_evtchn_do_upcall(void)
> >                              * If this is the final port processed, we'll
> >                              * pick up here+1 next time.
> >                              */
> > -                           last_word_idx = word_idx;
> > -                           last_bit_idx = bit_idx;
> > -
> > +                           __this_cpu_write(last_word_idx, word_idx);
> > +                           __this_cpu_write(last_bit_idx, bit_idx);
> >                     } while (bit_idx != BITS_PER_LONG - 1);
> >  
> >                     pending_bits = active_evtchns(cpu, s, word_idx);
> > -- 
> > 1.5.6.5
> > 
> > 
> > _______________________________________________
> > 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>