From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756602Ab2IXPwb (ORCPT ); Mon, 24 Sep 2012 11:52:31 -0400 Received: from casper.infradead.org ([85.118.1.10]:41211 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754031Ab2IXPw3 convert rfc822-to-8bit (ORCPT ); Mon, 24 Sep 2012 11:52:29 -0400 Message-ID: <1348501929.11847.81.camel@twins> Subject: Re: [PATCH RFC 2/2] kvm: Be courteous to other VMs in overcommitted scenario in PLE handler From: Peter Zijlstra To: Avi Kivity Cc: Raghavendra K T , "H. Peter Anvin" , Marcelo Tosatti , Ingo Molnar , Rik van Riel , Srikar , "Nikunj A. Dadhania" , KVM , Jiannan Ouyang , chegu vinod , "Andrew M. Theurer" , LKML , Srivatsa Vaddagiri , Gleb Natapov Date: Mon, 24 Sep 2012 17:52:09 +0200 In-Reply-To: <50607F9B.7090701@redhat.com> References: <20120921115942.27611.67488.sendpatchset@codeblue> <20120921120019.27611.66093.sendpatchset@codeblue> <50607BBE.8070507@redhat.com> <1348500861.11847.72.camel@twins> <50607F9B.7090701@redhat.com> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2012-09-24 at 17:43 +0200, Avi Kivity wrote: > Wouldn't this correspond to the scheduler interrupt firing and causing a > reschedule? I thought the timer was programmed for exactly the point in > time that CFS considers the right time for a switch. But I'm basing > this on my mental model of CFS, not CFS itself. No, we tried this for hrtimer kernels for a while, but programming hrtimers the whole time (every actual task-switch) turns out to be far too expensive. So we're back to HZ ticks and 'polling' the preemption state. Even if we remove all the hrtimer infrastructure overhead (can do with a few hacks) setting the hardware requires going out to the LAPIC, which is stupid slow. Some hardware actually has fast/reliable/usable timers, sadly none of it is popular.