Kaushik Kumar Ram
2010-Jan-29 05:34 UTC
[Xen-devel] [PATCH] evtchn_do_upcall: Fix logic to start correctly at "last processed port + 1"
# HG changeset patch # User kaushik # Date 1264742860 21600 # Node ID de3e05e5eec28aa332ae1aa35a2edf97ded769f5 # Parent 91224343eeee460c9aafdaadc1bdedab54e92256 Fix the logic to start correctly at "last processed port + 1" in evtchn_do_upcall. Signed-off-by: Kaushik Kumar Ram <kaushik@rice.edu> diff -r 91224343eeee -r de3e05e5eec2 drivers/xen/core/evtchn.c --- a/drivers/xen/core/evtchn.c Thu Jan 21 15:05:02 2010 +0000 +++ b/drivers/xen/core/evtchn.c Thu Jan 28 23:27:40 2010 -0600 @@ -264,6 +264,9 @@ asmlinkage void evtchn_do_upcall(struct l1i = per_cpu(last_processed_l1i, cpu); l2i = per_cpu(last_processed_l2i, cpu); + if(l2i == BITS_PER_LONG - 1) + l1i = (l1i + 1) % BITS_PER_LONG; + while (l1 != 0) { l1i = (l1i + 1) % BITS_PER_LONG; @@ -297,7 +300,7 @@ asmlinkage void evtchn_do_upcall(struct evtchn_device_upcall(port); /* if this is the final port processed, we''ll pick up here+1 next time */ - per_cpu(last_processed_l1i, cpu) = l1i; + per_cpu(last_processed_l1i, cpu) = l1i - 1; per_cpu(last_processed_l2i, cpu) = l2i; } while (l2i != BITS_PER_LONG - 1); -Kaushik _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2010-Jan-29 08:43 UTC
Re: [Xen-devel] [PATCH] evtchn_do_upcall: Fix logic to start correctly at "last processed port + 1"
On 29/01/2010 05:34, "Kaushik Kumar Ram" <kaushik@rice.edu> wrote:> # HG changeset patch > # User kaushik > # Date 1264742860 21600 > # Node ID de3e05e5eec28aa332ae1aa35a2edf97ded769f5 > # Parent 91224343eeee460c9aafdaadc1bdedab54e92256 > Fix the logic to start correctly at "last processed port + 1" in > evtchn_do_upcall. > > Signed-off-by: Kaushik Kumar Ram <kaushik@rice.edu>Take a look at linux-2.6.18-xen:988, which is a (significant) reinterpretation of your patch. I think some confusion and bugs arise from pre-incrementing the loop indexes, so I changed back to post-incrementing as we used to do. I think the code is a fair bit clearer. Hopefully it also works just as well! Thanks, Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kaushik Kumar Ram
2010-Jan-29 09:04 UTC
Re: [Xen-devel] [PATCH] evtchn_do_upcall: Fix logic to start correctly at "last processed port + 1"
I don''t see changeset linux-2.6.18-xen:988. I agree pre-incrementing is better. I am fine as long as the code is fixed. -Kaushik On Jan 29, 2010, at 2:43 AM, Keir Fraser wrote:> On 29/01/2010 05:34, "Kaushik Kumar Ram" <kaushik@rice.edu> wrote: > >> # HG changeset patch >> # User kaushik >> # Date 1264742860 21600 >> # Node ID de3e05e5eec28aa332ae1aa35a2edf97ded769f5 >> # Parent 91224343eeee460c9aafdaadc1bdedab54e92256 >> Fix the logic to start correctly at "last processed port + 1" in >> evtchn_do_upcall. >> >> Signed-off-by: Kaushik Kumar Ram <kaushik@rice.edu> > > Take a look at linux-2.6.18-xen:988, which is a (significant) > reinterpretation of your patch. I think some confusion and bugs arise from > pre-incrementing the loop indexes, so I changed back to post-incrementing as > we used to do. I think the code is a fair bit clearer. Hopefully it also > works just as well! > > Thanks, > Keir > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2010-Jan-29 09:33 UTC
Re: [Xen-devel] [PATCH] evtchn_do_upcall: Fix logic to start correctly at "last processed port + 1"
Sorry, it is there now: http://xenbits.xensource.com/linux-2.6.18-xen.hg K. On 29/01/2010 09:04, "Kaushik Kumar Ram" <kaushik@rice.edu> wrote:> I don''t see changeset linux-2.6.18-xen:988. I agree pre-incrementing is > better. I am fine as long as the code is fixed. > > -Kaushik > > On Jan 29, 2010, at 2:43 AM, Keir Fraser wrote: > >> On 29/01/2010 05:34, "Kaushik Kumar Ram" <kaushik@rice.edu> wrote: >> >>> # HG changeset patch >>> # User kaushik >>> # Date 1264742860 21600 >>> # Node ID de3e05e5eec28aa332ae1aa35a2edf97ded769f5 >>> # Parent 91224343eeee460c9aafdaadc1bdedab54e92256 >>> Fix the logic to start correctly at "last processed port + 1" in >>> evtchn_do_upcall. >>> >>> Signed-off-by: Kaushik Kumar Ram <kaushik@rice.edu> >> >> Take a look at linux-2.6.18-xen:988, which is a (significant) >> reinterpretation of your patch. I think some confusion and bugs arise from >> pre-incrementing the loop indexes, so I changed back to post-incrementing as >> we used to do. I think the code is a fair bit clearer. Hopefully it also >> works just as well! >> >> Thanks, >> Keir >> >> >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kaushik Kumar Ram
2010-Jan-29 09:39 UTC
Re: [Xen-devel] [PATCH] evtchn_do_upcall: Fix logic to start correctly at "last processed port + 1"
On Jan 29, 2010, at 3:33 AM, Keir Fraser wrote:> Sorry, it is there now: > http://xenbits.xensource.com/linux-2.6.18-xen.hg > > K.OK. It seems fine now. Thanks. -Kaushik> On 29/01/2010 09:04, "Kaushik Kumar Ram" <kaushik@rice.edu> wrote: > >> I don''t see changeset linux-2.6.18-xen:988. I agree pre-incrementing is >> better. I am fine as long as the code is fixed. >> >> -Kaushik >> >> On Jan 29, 2010, at 2:43 AM, Keir Fraser wrote: >> >>> On 29/01/2010 05:34, "Kaushik Kumar Ram" <kaushik@rice.edu> wrote: >>> >>>> # HG changeset patch >>>> # User kaushik >>>> # Date 1264742860 21600 >>>> # Node ID de3e05e5eec28aa332ae1aa35a2edf97ded769f5 >>>> # Parent 91224343eeee460c9aafdaadc1bdedab54e92256 >>>> Fix the logic to start correctly at "last processed port + 1" in >>>> evtchn_do_upcall. >>>> >>>> Signed-off-by: Kaushik Kumar Ram <kaushik@rice.edu> >>> >>> Take a look at linux-2.6.18-xen:988, which is a (significant) >>> reinterpretation of your patch. I think some confusion and bugs arise from >>> pre-incrementing the loop indexes, so I changed back to post-incrementing as >>> we used to do. I think the code is a fair bit clearer. Hopefully it also >>> works just as well! >>> >>> Thanks, >>> Keir >>> >>> >>> >>> _______________________________________________ >>> Xen-devel mailing list >>> Xen-devel@lists.xensource.com >>> http://lists.xensource.com/xen-devel >>> >> > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel