From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Add need_resched check before go to kvm_resched Date: Thu, 26 Apr 2007 07:46:07 +0300 Message-ID: <46302E8F.6070301@qumranet.com> References: <10EA09EFD8728347A513008B6B0DA77A01599FA7@pdsmsx411.ccr.corp.intel.com> <462FF3B7.6010707@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Anthony Liguori Return-path: In-reply-to: <462FF3B7.6010707-rdkfGonbjUSkNkDKm+mE6A@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 Anthony Liguori wrote: > Dong, Eddie wrote: >> In this case, IOCTL return to Qemu will trigger scheduling at least. >> > > I think a scheduling change won't happen until the next timer tick. > AFAICT, there's nothing explicit in the ioctl return path that will > result in rescheduling. > > I'm not entirely confident in how the timer interrupt gets handled > when it arrives in the guest. My understanding is that while the > timer interrupt is delivered in the host, since preempt is disabled, > the rescheduling opportunity is lost even though the current task is > marked as needing rescheduling. I think the next time that bit will > get checked is the next timer interrupt but I may be wrong. > No, any syscall exit triggers a rescheduling check, otherwise a task that spends most of its time in a non-preemt kernel would rarely get rescheduled. See arch/x86_64/kernel/entry.S, the various checks for TIF_NEED_RESCHED. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/