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

Re: [Xen-ia64-devel] [PATCH] pal_halt_light emulate for domU TAKE3

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] [PATCH] pal_halt_light emulate for domU TAKE3
From: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>
Date: Wed, 23 Aug 2006 21:30:42 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 23 Aug 2006 05:32:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: (Your message of "Wed, 23 Aug 2006 19:41:26 +0900") <20060823104126.GA1223%yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200608211138.k7LBccHr023385@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20060822034345.GB17136%yamahata@xxxxxxxxxxxxx> <200608220544.k7M5idNA031629@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20060822081116.GD17136%yamahata@xxxxxxxxxxxxx> <200608220828.k7M8SxR0004445@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20060822090439.GF17136%yamahata@xxxxxxxxxxxxx> <200608220953.k7M9ruUN028782@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <200608230848.k7N8mLUY013769@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20060823102310.GC24626%yamahata@xxxxxxxxxxxxx> <200608231029.k7NATHDa013963@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20060823104126.GA1223%yamahata@xxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, Isaku

  Thank you for your suggestion.
I decided the location of migrate_timer function
by seeing the other migrate_timer calling codes in Xen.
I think your modification changes negiligible small performance effect.


This migrate_timer purposes to solve 
the problem of timer is up during set_timer/do_block (vcpu hangs).

So, the candidate location of migrate_timer is 
from context_switch (vcpu in) to pal_halt_light (vcpu out),
(see below figure)
because these positions are before set_timer/do_block.
I select context_switch position because I think it is conservative (see line 
2).

     vcpu in    ==================> pal_halt_light => set_timer/do_block(vcpu 
out)
(context_switch)^^^^^^^^^^^^^^^^^|  
               candidate position| 
               of migrate timer  |           
                                 |========>by timer (vcpu out)

Anyway, for considering performance issue, I consider 2 cases.
1)CPU intensive process is rarely occur the context switch.
  (Only timer interrupt occurs)
  In this case, So performance is negligible for this function in 
context_switch 10^{-6}.

2)For Heavy I/O issue, pal_halt_light frequently signals.
  So position of migrate_timer in context_switch and pal_halt_light
  is very small.
  It means the number of context_switch and pal_halt_light event closes.

In these two cases, migrate_timer location is not important for performance.


Do you still think on moving this function?

Anyway, thank you for your comments.
It is clearify my idea by writing document.

Thanks,
Atsushi SAKAI



>
>Calling migrate_timer from context_switch() seems to introduce
>unnecessary overhead.
>Why did you choose to insert migrate_timer() to context_switch()
>instead of inserting it ot the following position?
>
>diff -r 8c6bb45901e7 xen/arch/ia64/xen/hypercall.c
>--- a/xen/arch/ia64/xen/hypercall.c     Wed Aug 16 14:28:57 2006 -0600
>+++ b/xen/arch/ia64/xen/hypercall.c     Mon Aug 21 13:46:05 2006 +0900
>@@ -233,7 +233,10 @@ fw_hypercall (struct pt_regs *regs)
>                        }
>                        else {
>                                perfc_incrc(pal_halt_light);
>-                               do_sched_op_compat(SCHEDOP_yield, 0);
>    <<<<<<<<<<<<< migrate_timer() >>>>>>>>>>>>>>>>>>>>>>>>>>>
>+                               set_timer(&v->arch.hlt_timer,
>+                                       vcpu_get_next_timer_ns(v));
>+                               do_sched_op_compat(SCHEDOP_block, 0);
>+                               stop_timer(&v->arch.hlt_timer);
>                        }
>                        regs->r8 = 0;
>                        regs->r9 = 0;
>
>
>On Wed, Aug 23, 2006 at 07:29:11PM +0900, Atsushi SAKAI wrote:
>> Hi, Isaku
>> 
>> Sorry for confusing.
>> It should replace from "for context_switch" to "to context_switch"
>> migrate_timer is in context_switch.
>> 
>> Thanks
>> Atsushi 
>> 
>> >Hi Atsushi.
>> >
>> >On Wed, Aug 23, 2006 at 05:48:15PM +0900, Atsushi SAKAI wrote:
>> >
>> >> 1)migrate_timer for hlt_timer_fn is added for context_switch
>> >>   This makes correct pCPU work for timer.
>> >
>> >Is it necessary to call migrate_timer() every context switch 
>> >instead of calling it right before set_timer(&hlt_timer)?
>> >
>> >-- 
>> >yamahata
>> >
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Xen-ia64-devel mailing list
>> Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-ia64-devel
>
>-- 
>yamahata
>







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