From: Ingo Molnar Subject: Re: [PATCH][retry 1] Add support for Pause Filtering to AMD SVM Date: Mon, 11 May 2009 16:15:03 +0200 Message-ID: <20090511141503.GC6175@elte.hu> References: <200905050909.58583.mark.langsdorf@amd.com> <20090507135522.GJ4059@amd.com> <200905071000.14038.mark.langsdorf@amd.com> <4A02FECC.6060609@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Mark Langsdorf , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Avi Kivity , Peter Zijlstra Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:44271 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbZEKOPK (ORCPT ); Mon, 11 May 2009 10:15:10 -0400 Content-Disposition: inline In-Reply-To: <4A02FECC.6060609@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: * Avi Kivity wrote: >> +static int pause_interception(struct vcpu_svm *svm, struct kvm_run >> *kvm_run) >> +{ >> + /* Simple yield */ >> + vcpu_put(&svm->vcpu); >> + schedule(); >> + vcpu_load(&svm->vcpu); >> + return 1; >> + > > Ingo, will this do anything under CFS, or will CFS note that > nothing has changed in the accounting and reschedule us > immediately? The scheduler will yield to another task only if the current task has become ineligible. I.e schedule() is largely a NOP on TASK_RUNNING tasks (i.e. here). I.e. this is a somewhat poor solution as far as scheduling goes. But i'm wondering what the CPU side does. Can REP-NOP really take thousands of cycles? If yes, under what circumstances? Ingo