From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/3] KVM: fix apic timer save/migration wheninactive Date: Mon, 10 Sep 2007 10:27:28 +0300 Message-ID: <46E4F1E0.8090805@qumranet.com> References: <37E52D09333DE2469A03574C88DBF40FA9C21D@pdsmsx414.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0153994511==" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "He, Qing" Return-path: In-Reply-To: <37E52D09333DE2469A03574C88DBF40FA9C21D-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org --===============0153994511== Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable He, Qing wrote: > resended, due to wrong attachment > > =20 Patch looks good, but needs a changelog comment and a signoff. >> -----Original Message----- >> From: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >> [mailto:kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of He, Qing >> Sent: 2007=C4=EA9=D4=C210=C8=D5 13:59 >> To: Avi Kivity >> Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >> Subject: Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migratio= n wheninactive >> >> Avi, >> This is the updated patch, which avoids inactive hrtimers from uninte= nded >> migrations. >> >> save/restore timer logic is not included because it does not call hrti= mer_cancel >> (hrtimer_active is different). It has relatively small impact, for it = only affects save/restore >> at maybe guest BIOS time, maybe we can defer it to some later time >> >> =20 >>> -----Original Message----- >>> From: Avi Kivity [mailto:avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org] >>> Sent: 2007=C4=EA9=D4=C29=C8=D5 15:39 >>> To: He, Qing >>> Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >>> Subject: Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migrati= on when inactive >>> >>> He, Qing wrote: >>> =20 >>>>>>> + if (atomic_read(&apic->timer.active)) >>>>>>> >>>>>>> >>>>>>> =20 >>>>>> Or here? >>>>>> >>>>>> >>>>>> =20 >>>>>>> + hrtimer_start(timer, timer->expires, >>>>>>> + HRTIMER_MODE_ABS); >>>>>>> } >>>>>>> EXPORT_SYMBOL_GPL(kvm_migrate_apic_timer); >>>>>>> >>>>>>> >>>>>>> >>>>>>> =20 >>>>> I think you could use the return value of hrtimer_cancel() here: >>>>> >>>>> if (hrtimer_cancel(...)) >>>>> hrtimer_start(...); >>>>> >>>>> =20 >>>> Thanks for commenting, previously I have thought of something like: >>>> if (hrtimer_active(...)) { >>>> hrtimer_cancel(...); >>>> hrtimer_start(...); >>>> } >>>> >>>> But it is not able to handle pending state this way. Seems the retur= n value of >>>> =20 >>> hrtimer_cancel is fine. Another question is, when the hrtimer functio= n returns >>> HRTIMER_NORESTART, does the state finally turn to HRTIMER_STATE_INACT= IVE? >>> =20 >> >From my reading of the hrtimer code, yes. But I would view any code >> =20 >>> which depends on the state with suspicion. >>> >>> >>> -- >>> error compiling committee.c: too many arguments to function >>> =20 >>> ---------------------------------------------------------------------= --- >>> >>> ---------------------------------------------------------------------= ---- >>> This SF.net email is sponsored by: Microsoft >>> Defy all challenges. Microsoft(R) Visual Studio 2005. >>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>> ---------------------------------------------------------------------= --- >>> >>> _______________________________________________ >>> kvm-devel mailing list >>> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >>> https://lists.sourceforge.net/lists/listinfo/kvm-devel >>> =20 --=20 error compiling committee.c: too many arguments to function --===============0153994511== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ --===============0153994511== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============0153994511==--