Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3917390imm; Mon, 17 Sep 2018 05:27:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ7j953t7oJ8ll7P79oZ2/5uowjiv9YPNEVg3/5nL44foLZZS1y7kwMgX6k55DV+rAT+YcY X-Received: by 2002:a62:778c:: with SMTP id s134-v6mr25771264pfc.189.1537187266863; Mon, 17 Sep 2018 05:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537187266; cv=none; d=google.com; s=arc-20160816; b=Vc7Y/b5HjsU3bYc7mrt7J/oQjVgStK4i1QM80i1F29epUzeNfTiSS9Z840Q0WyyafG IGWvOms5Dqf8SJ35ov12zoKVqhekpKNjDJHdKp4nmrur5uhLF0+j/7b7/KFRJZMEUsr1 vvRLZ0etg6tDZ7dcs+TvnWq4UgeN9bou/WZ+aIzqNR5xbw2bJgK4IIcDTShxXHEpU997 CRXKqDtbyzbuVm2jnw+Nm4uDQUfpIKvTy4dzfWW8U9dSbGfiThc/OC5tfSri6BKdzU8Z UJG01QDv+39IwxaOmR3E9ZU08jEdTEy/fmz9lnmvEhGsNPh2qGxVytB70Xe0/zy0SIVO JNHw== 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=1jNEWI/9YA3I1o68vOITxMUbkb4Jd883mgsbBf36sUU=; b=JoAMnmFudiCfa+o0gKWO7G/1BDOf62kp/tOA1fZkV3dKVk0wY1C38Vcb2I0Je5vTwO aOLcJ7hIO4MOA6jogcvRuK3DL8dP3MQodplEN5f9gCpvf+mozkK6/nLIkKG6vgSd2ITS TZ8BSNb5FFZLoKXPnvF1mFabbJSw1hTpt1JwtfFJFF2yfwKMp8OR6ULLzw85q+bFLn5a +Oi5ivcsPYA97ll/66uRs8Z/Wzxb9tE9Te+4S4ca9M+Qoeo7fQwYlY2nOkliutpmOv3T zg6PW2dNXJesEwSzs8wHjWeLQJLbcJ23rREYmrPzhw7T5FNLw0fHGoZacqTSsBEe8uH8 2hOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=u1yyOBdX; 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 k23-v6si14347655pgl.633.2018.09.17.05.27.31; Mon, 17 Sep 2018 05:27:46 -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=u1yyOBdX; 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 S1728496AbeIQRw4 (ORCPT + 99 others); Mon, 17 Sep 2018 13:52:56 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37428 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbeIQRwz (ORCPT ); Mon, 17 Sep 2018 13:52:55 -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=1jNEWI/9YA3I1o68vOITxMUbkb4Jd883mgsbBf36sUU=; b=u1yyOBdXnls2RnNTWvt+7F5Oes 01K3qeER++WIkEg6xm+o0wVPweYV8EWsn2GyuhPqtaygYQD7iTN283M/9aNP7H1qekaCra0nYyqG9 WrL95aMLFmqdLIl350RP4s4dYkKvlHlKpamCrHRLzygI/hdAQaSkbrKoc30d2JMrOOFmGAOUhOEMN XHcK780Yuu/8GlPNDWNM3VBTkEdC+ZyJ1p7zskNrXsCLzzby3Nr5XfdgNOo+XoD0V4jEm/qi0k6qG uaJWlmrxnLRsQrV9LFnk21XAetgaYYn8AH/frQKWE7VBcL/arLef6m/QcXrLZUvGZwWkC/gFGtkG0 2NQevgwA==; 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 1g1sax-0003eE-LJ; Mon, 17 Sep 2018 12:25:39 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3F64A2058A23E; Mon, 17 Sep 2018 14:25:38 +0200 (CEST) Date: Mon, 17 Sep 2018 14:25:38 +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: <20180917122538.GT24124@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: > Assuming, there is a cgroup-less solution that can prevent simultaneous > execution of tasks on a core, when they're not supposed to. How would you > tell the scheduler, which tasks these are? Specifically for L1TF I hooked into/extended KVM's preempt_notifier registration interface, which tells us which tasks are VCPUs and to which VM they belong. But if we want to actually expose this to userspace, we can either do a prctl() or extend struct sched_attr. > >> 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. Well, you mentioned it as an alternative to paravirt spinlocks -- I'm saying that co-scheduling cannot do that, you need full featured gang-scheduling for that.