From: Keir Fraser Subject: Re: lazy context switching Date: Fri, 26 Aug 2005 18:14:05 +0100 Message-ID: References: <200508251655.09988.hollisb@us.ibm.com> <7e83ab2167ab0a728f9ac47a6085cbc0@cl.cam.ac.uk> <32738a7d711e6cf6815ae0ef6f2994f9@us.ibm.com> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <32738a7d711e6cf6815ae0ef6f2994f9@us.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Hollis Blanchard Cc: Jimi Xenidis , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 26 Aug 2005, at 17:38, Hollis Blanchard wrote: > Hmmmmm. I think the basic problem is that in the exception handler we > don't usually know we will need this state. The exception is a debug > exception, where we know we will need it for the GDB stub. > > However, we also have a hypervisor-dedicated timer, HDEC (hypervisor > decrementer). Rather than using it as a plain tick which may or may > not cause a scheduler exception, we can use it to *always* mean a > context switch. In that case, we would always save the full state on > HDEC entry, because we know it will always cause a context switch. > Judging by set_ac_timer() callers, it seems that only the scheduler > really uses the Xen timer tick. If non-scheduler components start > using Xen-internal ticks, this approach wouldn't hold up (or rather, > it would start becoming less efficient). Why not move the non-volatile save/restore into your context switch routine, rather than deferring it until you exit the hypervisor? -- Keir