From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Add need_resched check before go to kvm_resched Date: Wed, 25 Apr 2007 23:56:42 -0500 Message-ID: <4630310A.6090208@codemonkey.ws> References: <10EA09EFD8728347A513008B6B0DA77A01599FA7@pdsmsx411.ccr.corp.intel.com> <462FF3B7.6010707@codemonkey.ws> <46302E8F.6070301@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Avi Kivity Return-path: In-Reply-To: <46302E8F.6070301-atKUWr5tajBWk0Htik3J/w@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 Avi Kivity wrote: > 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. > Ah, okay. Regards, Anthony Liguori > See arch/x86_64/kernel/entry.S, the various checks for TIF_NEED_RESCHED. > ------------------------------------------------------------------------- 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/