From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753136AbZEKOPb (ORCPT ); Mon, 11 May 2009 10:15:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752988AbZEKOPM (ORCPT ); Mon, 11 May 2009 10:15:12 -0400 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 Date: Mon, 11 May 2009 16:15:03 +0200 From: Ingo Molnar To: Avi Kivity , Peter Zijlstra Cc: Mark Langsdorf , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][KVM][retry 1] Add support for Pause Filtering to AMD SVM 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 Content-Disposition: inline In-Reply-To: <4A02FECC.6060609@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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 From mboxrd@z Thu Jan 1 00:00:00 1970 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