From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48068 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q9Gsm-0004c6-KT for qemu-devel@nongnu.org; Mon, 11 Apr 2011 09:10:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9Gsl-0004vz-2B for qemu-devel@nongnu.org; Mon, 11 Apr 2011 09:10:19 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:46437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9Gsk-0004t9-Vh for qemu-devel@nongnu.org; Mon, 11 Apr 2011 09:10:19 -0400 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p3BCn6wA019587 for ; Mon, 11 Apr 2011 08:49:07 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 6BF676E803F for ; Mon, 11 Apr 2011 09:10:06 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3BDA6Zl396024 for ; Mon, 11 Apr 2011 09:10:06 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3BDA5ac028393 for ; Mon, 11 Apr 2011 10:10:05 -0300 Message-ID: <4DA2FDA8.9070109@us.ibm.com> Date: Mon, 11 Apr 2011 08:10:00 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 3/5] hpet 'driftfix': add fields to HPETTimer and VMStateDescription References: <148574451.12234.1302512788577.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <4DA2C4F2.1000002@redhat.com> In-Reply-To: <4DA2C4F2.1000002@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: jan kiszka , gcosta@redhat.com, Ulrich Obergfell , kvm@vger.kernel.org, qemu-devel@nongnu.org On 04/11/2011 04:08 AM, Avi Kivity wrote: > On 04/11/2011 12:06 PM, Ulrich Obergfell wrote: >> >> vmstate_hpet_timer = { >> >> VMSTATE_UINT64(fsb, HPETTimer), >> >> VMSTATE_UINT64(period, HPETTimer), >> >> VMSTATE_UINT8(wrap_flag, HPETTimer), >> >> + VMSTATE_UINT64_V(saved_period, HPETTimer, 3), >> >> + VMSTATE_UINT64_V(ticks_not_accounted, HPETTimer, 3), >> >> + VMSTATE_UINT32_V(irqs_to_inject, HPETTimer, 3), >> >> + VMSTATE_UINT32_V(irq_rate, HPETTimer, 3), >> >> + VMSTATE_UINT32_V(divisor, HPETTimer, 3), >> > >> > We ought to be able to use a subsection keyed off of whether any >> ticks >> > are currently accumulated, no? >> >> >> Anthony, >> >> I'm not sure if I understand your question correctly. Are you suggesting >> to migrate the driftfix-related state conditionally / only if there are >> any ticks accumulated in 'ticks_not_accounted' and 'irqs_to_inject' ? >> >> The size of the driftfix-related state is 28 bytes per timer and we have >> 32 timers per HPETState, i.e. 896 additional bytes per HPETState. With a >> maximum number of 8 HPET blocks (HPETState), this amounts to 7168 bytes. >> Hence, unconditional migration of the driftfix-related state should not >> cause significant additional overhead. >> > > It's not about overhead. > >> Maybe I missed something. Could you please explain which benefit you see >> in using a subsection ? > > In the common case of there being no drift, you can migrate from a > qemu that supports driftfix to a qemu that doesn't. > Right, subsections are a trick. The idea is that when you introduce new state for a device model that is not always going to be set, when you do the migration, you detect whether the state is set or not and if it's not set, instead of sending empty versions of that state (i.e. missed_ticks=0) you just don't send the new state at all. This means that you can migrate to an older version of QEMU provided the migration would work correctly. Regards, Anthony Liguori