Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3995199imm; Mon, 17 Sep 2018 06:38:33 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaXBgf8irO7az3WNmNE3j97YCI1XG8jQaO7T5rCbCmNKNRomlY6UgjaVkRAtK2J4BLsvHMc X-Received: by 2002:a62:20d8:: with SMTP id m85-v6mr25926582pfj.74.1537191513356; Mon, 17 Sep 2018 06:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537191513; cv=none; d=google.com; s=arc-20160816; b=sNfG4A7jK7boX3mG+rZSeKcvDo2J/S0ceGJAkzcwzE/yBQCwvWGuxIMxlzClZcmf/s vUHVPsGxiHDBklOIeqd7+wR0xHS054CwyqvXZ/d/jvc+yJHeSlW2JZWbTmFClZ0mEebz iRcsP5XrCSzGZYfbmXVhYbN6BAX7lxUmxzHkDDMuo6TxHO9BIYWA1EtQ27aIjtBlzotf dH1iK7XZwpuceQfFHokfIG05CgSFRom6kQejB7XZ0eAhUwxiyOTy6/6pEKQHlLz4ZwVC WOPlRM+6MZ7kfnIjFpq+7++LStKoJugv/0Gf/BLOdK7p8/tRCcwpRCPGjL68vw6goq2j LVaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Awci2NloivThIfbI7FN2RhRdTGtjr7Ke5VYdFsXkUuA=; b=X03lgh9YF30rw+uwI+9wilxK6AApZ8+jd9jxlcgHKKEoxLYKZKeRmr2TYaO0McTDVc lw9ecORafvH/UFcGfqGhPuabVpyKYsppBrCDJGl4xXUu+KLbSDTQXSQCjJZ+mg8+paqz J+snWr8xmv4Pm/+BlYkmHh6W/zgS40rw4QHUpYFTCwnyDBbcIp4bz2XKfJPiOtnNcDVk 6f55U3IB9Pk/cOmxrXt6eIaoJ6koXczFmku5dM4Fa3hS0b5lIz6ro8aSdWKD/UZMiish Qpzxlp32mYs8dp9EikoxsO4FwowDwvCCdLDBDFNF/RoHVbNCPVbhMWFACAN65tmmMeNN FlTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=I2esuaOB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t191-v6si15696483pgc.481.2018.09.17.06.38.17; Mon, 17 Sep 2018 06:38:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=I2esuaOB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728417AbeIQTEi (ORCPT + 99 others); Mon, 17 Sep 2018 15:04:38 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38244 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727858AbeIQTEi (ORCPT ); Mon, 17 Sep 2018 15:04:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Awci2NloivThIfbI7FN2RhRdTGtjr7Ke5VYdFsXkUuA=; b=I2esuaOB8jYWzAPflSLqQQ2r8Y y4lHDLPdNsDHzN3YoJc8iBkCDGnhze+C7Ab7cHA9lToh8orQMnv5ByIq1JeC7gEolEVGrgMVvIEO8 tQq9ectED1HZQVFEo1rpUkEy+axxgSUDl607QURnSCYVfActB0nw2ZLv7dnS3/sWCu2FwMQOFWUr0 nq/StrUbEr5XmGX1ryrpIVmm0FFFfL1qaeOKDNK/xn4X774epynfjVpLP3foDkVyRahmIl0MgCVF9 bnkcrQ4Ks2OPFetoK/zfqBwFljuGDAxIQxSdxOt/ShsNmvKdrv08tcedeHA97II8VMsA3HaruBM1u eqyjor2Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g1ti6-00046y-82; Mon, 17 Sep 2018 13:37:06 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E56702058AF01; Mon, 17 Sep 2018 15:37:03 +0200 (CEST) Date: Mon, 17 Sep 2018 15:37:03 +0200 From: Peter Zijlstra To: Jan =?iso-8859-1?Q?H=2E_Sch=F6nherr?= Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Paul Turner , Vincent Guittot , Morten Rasmussen , Tim Chen Subject: Re: [RFC 00/60] Coscheduling for Linux Message-ID: <20180917133703.GU24124@hirez.programming.kicks-ass.net> References: <20180907214047.26914-1-jschoenh@amazon.de> <20180914111251.GC24106@hirez.programming.kicks-ass.net> <1d86f497-9fef-0b19-50d6-d46ef1c0bffa@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1d86f497-9fef-0b19-50d6-d46ef1c0bffa@amazon.de> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 14, 2018 at 06:25:44PM +0200, Jan H. Sch?nherr wrote: > On 09/14/2018 01:12 PM, Peter Zijlstra wrote: > >> 1. Execute parallel applications that rely on active waiting or synchronous > >> execution concurrently with other applications. > >> > >> The prime example in this class are probably virtual machines. Here, > >> coscheduling is an alternative to paravirtualized spinlocks, pause loop > >> exiting, and other techniques with its own set of advantages and > >> disadvantages over the other approaches. > > > > Note that in order to avoid PLE and paravirt spinlocks and paravirt > > tlb-invalidate you have to gang-schedule the _entire_ VM, not just SMT > > siblings. > > > > Now explain to me how you're going to gang-schedule a VM with a good > > number of vCPU threads (say spanning a number of nodes) and preserving > > the rest of CFS without it turning into a massive trainwreck? > > You probably don't -- for the same reason, why it is a bad idea to give > an endless loop realtime priority. It's just a bad idea. As I said in the > text you quoted: coscheduling comes with its own set of advantages and > disadvantages. Just because you find one example, where it is a bad idea, > doesn't make it a bad thing in general. > > > > Such things (gang scheduling VMs) _are_ possible, but not within the > > confines of something like CFS, they are also fairly inefficient > > because, as you do note, you will have to explicitly schedule idle time > > for idle vCPUs. > > With gang scheduling as defined by Feitelson and Rudolph [6], you'd have to > explicitly schedule idle time. With coscheduling as defined by Ousterhout [7], > you don't. In this patch set, the scheduling of idle time is "merely" a quirk > of the implementation. And even with this implementation, there's nothing > stopping you from down-sizing the width of the coscheduled set to take out > the idle vCPUs dynamically, cutting down on fragmentation. The thing is, if you drop the full width gang scheduling, you instantly require the paravirt spinlock / tlb-invalidate stuff again. Of course, the constraints of L1TF itself requires the explicit scheduling of idle time under a bunch of conditions. I did not read your [7] in much detail (also very bad quality scan that :-/; but I don't get how they leap from 'thrashing' to co-scheduling. Their initial problem, where A generates data that B needs and the 3 scenarios: 1) A has to wait for B 2) B has to wait for A 3) the data gets buffered Seems fairly straight forward and is indeed quite common, needing co-scheduling for that, I'm not convinced. We have of course added all sorts of adaptive wait loops in the kernel to deal with just that issue. With co-scheduling you 'ensure' B is running when A is, but that doesn't mean you can actually make more progress, you could just be burning a lot of CPu cycles (which could've been spend doing other work). I'm also not convinced co-scheduling makes _any_ sense outside SMT -- does one of the many papers you cite make a good case for !SMT co-scheduling? It just doesn't make sense to co-schedule the LLC domain, that's 16+ cores on recent chips.