Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4477389imm; Mon, 15 Oct 2018 15:50:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tDo7ez8JC0pE56u3YqjO4VP2iVol3DKWzqDDZTJCxaN6ah2++sPbprRn790WJOcY5NWUZ X-Received: by 2002:a65:5c81:: with SMTP id a1-v6mr17707411pgt.390.1539643850388; Mon, 15 Oct 2018 15:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539643850; cv=none; d=google.com; s=arc-20160816; b=pqBxmEamLvfIWcVAnFyPxRVAF1qCQDs9BzlwKlhEWhXPEFx3W0Hv9U22rJNO0Mz+b6 7eVf+S+8wDPOrtZJKVh2FM9dcz6ZsbYX7rysrktBLkk0Dats42bYLdMccHBZMGWjHAik P7teZTkEcf8cfhxjLgndhUfo6rMOfmyFT/fVomMRQTV4Vv7LaM/rAp1SoQtS/4y/JcjX lUbOOe4fFzjMuUXYpfkcPvyITMdwuovRUSJC5JViDwNlW0GBr2ScxzeGwycP3lIteajH mEOwghNwz9CTkJ3mk2bVBih2svcXtBNTddb3tUcP61tkGUEwgbSGW08ETrpMgwKwrH+q rVzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=jy7qEuDRGqGQH+cwmDv61Fp0ms0JdTM5vUaiMs66EJY=; b=oe87RPwQAif4G/vCAfAEUuzf+IrZoryM1btBreb62c6vkXZg6VsVdNv4NFx0z6hUvs F7N1oAeIO7h7bxvHAFDb9CCmEV6WMBTBsCynb/9g/UEAYsq92osWuUAIqRLRi0+pvzIw fhg3e5W93FhLkanieZR/1Kx5csKE8xVcGChtWEyn4VhZa3w1cK61WrhLEzU3CH12o7sh onEY4+xTsQmtR7poep7hAzgxUCv//GUz7i/3dT0Q2V3WiyuG2gF36RN9h/OMUmBkJFGZ nyKdLK6mgqUMgBRtDTbDleGM6SqDTsnyFkbWrVnJ8YrVDXj40PRdIhQuYUAe1F0RLaid eF3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=h8TPu7ML; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2-v6si12196079pgi.5.2018.10.15.15.50.34; Mon, 15 Oct 2018 15:50:50 -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=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=h8TPu7ML; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726989AbeJPGhZ (ORCPT + 99 others); Tue, 16 Oct 2018 02:37:25 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48334 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbeJPGhY (ORCPT ); Tue, 16 Oct 2018 02:37:24 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9FMmdx2021213; Mon, 15 Oct 2018 22:49:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=jy7qEuDRGqGQH+cwmDv61Fp0ms0JdTM5vUaiMs66EJY=; b=h8TPu7ML0xPnsZqq9w3w5dlpRS532GImSxjpFOppGC5pzKqJvWspKRnKRgEep29D9VOZ ZIbvrHQWprh121y7owCvBQjl4ph5D+DQwvjOtHTSo5L2qU2zjZysoNrctXtBqznsyW+j jQkAU2V36DP70JKZRFXaDA9m/ig41xiXC/+K2BDIz4vB+2yW3Ph+bYwd3IwzjrUyADKQ QPFzR4zzk+wPmHGEC0pppMosDsQ7i4h0MfL0sNQlxi70fl5VbsYyKsNnmqA9iZBAzjrk RD4IynkVISWZ5bQjXGC67DiypGma5RiaLzmnfOetixs4me/fOjBEcvzJcpxvJfT8QKts 6A== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2n39br54g7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Oct 2018 22:49:45 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9FMniuF006752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Oct 2018 22:49:44 GMT Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9FMnhRt030396; Mon, 15 Oct 2018 22:49:43 GMT Received: from [10.132.91.175] (/10.132.91.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 15 Oct 2018 15:49:43 -0700 Subject: Re: Gang scheduling To: Tim Chen , linux-kernel@vger.kernel.org Cc: Peter Zijlstra References: <44347e72-d595-5c2d-3983-7237526c71c6@oracle.com> From: Subhra Mazumdar Message-ID: Date: Mon, 15 Oct 2018 15:49:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9047 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810150196 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/2018 11:01 AM, Tim Chen wrote: > On 10/10/2018 05:09 PM, Subhra Mazumdar wrote: >> Hi, >> >> I was following the Coscheduling patch discussion on lkml and Peter mentioned he had a patch series. I found the following on github. >> >> https://github.com/pdxChen/gang/commits/sched_1.23-loadbal >> >> I would like to test this with KVMs. Are the commits from 38d5acb to f019876 sufficient? Also is there any documentaion on how to use it (any knobs I need to turn on for gang scheduling to happen?) or is it enabled by default for KVMs? >> >> Thanks, >> Subhra >> > I would suggest you try > https://github.com/pdxChen/gang/tree/sched_1.23-base > without the load balancing part of gang scheduling. > It is enabled by default for KVMs. > > Due to the constant change in gang scheduling status of the QEMU thread > depending on whether vcpu is loaded or unloaded, > the load balancing part of the code doesn't work very well. Thanks. Does this mean each vcpu thread need to be affinitized to a cpu? > > The current version of the code need to be optimized further. Right now > the QEMU thread constantly does vcpu load and unload during VM enter and exit. > We gang schedule only after vcpu load and register the thread to be gang > scheduled. When we do vcpu unload, the thread is removed from the set > to be gang scheduled. Each time there's a synchronization with the > sibling thread that's expensive. > > However, for QEMU, there's a one to one correspondence between the QEMU > thread and vcpu. So we don't have to change the gang scheduling status > for such thread to avoid the church and sync with the sibling. That should > be helpful for VM with lots of I/O causing constant VM exits. We're > still working on this optimization. And the load balancing should be > better after this change. > > Tim > Also FYI I get the following error while building sched_1.23-base: ERROR: "sched_ttwu_pending" [arch/x86/kvm/kvm-intel.ko] undefined! scripts/Makefile.modpost:92: recipe for target '__modpost' failed Adding the following fixed it: diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 46807dc..302b77d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -21,6 +21,7 @@  #include  DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); +EXPORT_SYMBOL_GPL(sched_ttwu_pending);  #if defined(CONFIG_SCHED_DEBUG) && defined(HAVE_JUMP_LABEL)  /*