Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1443230yba; Thu, 9 May 2019 17:10:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCDpGtCJ7iZhSq830lLfXSc/XCsPsOnJzCit7gcAl7rWguZUz2DnDgsySD/rYJpD1/ZWkC X-Received: by 2002:a63:d949:: with SMTP id e9mr9333274pgj.437.1557447016899; Thu, 09 May 2019 17:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557447016; cv=none; d=google.com; s=arc-20160816; b=RvL9Z7uVnr7FaqRcflL9LZfPBnGCao98HgsHowFXjrLSmYm42K9WxTlM9eOsxNOlUF EbJjEZ3mtQwZ1Iycn0KA9DW15tHxkFA+60GuJkdhFZ6wwl8aBZ1mFnw9xSc0RX/caqL5 YXG0AQEIf0yHHf29X7s/q6HA4jCMkc/y5Zr8Rao7GQQV7QYy72ctLO5cNR0Ri2vFiGbU v65OWBSGLz67WUGR7vmhcqCmQWB7Kx0DeKAJolAXsS5LlA/IFyWZPKMKt2ESRAPvWeoG GHcMWrX14s90sN32kUcH3VB6UtF3ztnfopmiLN6QJjjXKGyW3SmRInIUvdc9QhazCTHC jBgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:openpgp:from:references:cc:to; bh=5KvJ7zV+cF+pAPaK5hzNe7IleVbAIJpM/6o5mUqjyi8=; b=BJW2SvnuE4xAYdb/IqDCp3o8da3yIhceFDmMOCJ5+rmTaVgeS62FieXB+i1iSiSNoM trXQdosU/mzijE+Tx+eGrAR3fvFSc5SUktcOVUQz0sv7Kx0veOeXhzErPrMHUnWOToO9 TNPhxxV5CqAspYqjFIr2BSMCQbKhKPAOCCKDJOW2X0YC/zhDCti6REc7cz5tFaW36pjJ Vtz0SaI3ghHFIdKHT4WYWZhoBqaOy/kZbqojN3Pd6b7ATtgzz7Xhlt1kJzPvwbD+K+Gv /prOtqxWc+nqtcKRgDjjaAP2e7hgmbsu3/LHo8AWPNe1Z+/jxeKO0RrrsH1ihj+zrB5e 5ADw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 192si5347017pgb.488.2019.05.09.17.10.00; Thu, 09 May 2019 17:10:16 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbfEJAJN (ORCPT + 99 others); Thu, 9 May 2019 20:09:13 -0400 Received: from mga05.intel.com ([192.55.52.43]:17203 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfEJAJN (ORCPT ); Thu, 9 May 2019 20:09:13 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 17:09:12 -0700 X-ExtLoop1: 1 Received: from schen9-desk.jf.intel.com (HELO [10.54.74.162]) ([10.54.74.162]) by orsmga004.jf.intel.com with ESMTP; 09 May 2019 17:09:12 -0700 To: Subhra Mazumdar , Aubrey Li Cc: Aaron Lu , Vineeth Remanan Pillai , Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Paul Turner , Linus Torvalds , Linux List Kernel Mailing , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Kees Cook , Greg Kerr , Phil Auld , Aaron Lu , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini References: <2364f2b65bf50826d881c84d7634b6565dfee527.1556025155.git.vpillai@digitalocean.com> <20190429061516.GA9796@aaronlu> <6dfc392f-e24b-e641-2f7d-f336a90415fa@linux.intel.com> <777b7674-4811-dac4-17df-29bd028d6b26@linux.intel.com> <28fb6854-2772-5d29-087a-6a0cf6afe626@oracle.com> <8098b70b-2095-91ea-d4ad-9181829066c7@oracle.com> <7671d3f0-ca07-7260-a855-473ab58d1c30@oracle.com> From: Tim Chen Openpgp: preference=signencrypt Autocrypt: addr=tim.c.chen@linux.intel.com; prefer-encrypt=mutual; keydata= mQINBE6ONugBEAC1c8laQ2QrezbYFetwrzD0v8rOqanj5X1jkySQr3hm/rqVcDJudcfdSMv0 BNCCjt2dofFxVfRL0G8eQR4qoSgzDGDzoFva3NjTJ/34TlK9MMouLY7X5x3sXdZtrV4zhKGv 3Rt2osfARdH3QDoTUHujhQxlcPk7cwjTXe4o3aHIFbcIBUmxhqPaz3AMfdCqbhd7uWe9MAZX 7M9vk6PboyO4PgZRAs5lWRoD4ZfROtSViX49KEkO7BDClacVsODITpiaWtZVDxkYUX/D9OxG AkxmqrCxZxxZHDQos1SnS08aKD0QITm/LWQtwx1y0P4GGMXRlIAQE4rK69BDvzSaLB45ppOw AO7kw8aR3eu/sW8p016dx34bUFFTwbILJFvazpvRImdjmZGcTcvRd8QgmhNV5INyGwtfA8sn L4V13aZNZA9eWd+iuB8qZfoFiyAeHNWzLX/Moi8hB7LxFuEGnvbxYByRS83jsxjH2Bd49bTi XOsAY/YyGj6gl8KkjSbKOkj0IRy28nLisFdGBvgeQrvaLaA06VexptmrLjp1Qtyesw6zIJeP oHUImJltjPjFvyfkuI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xXmm6R8OyohR8uM/9NCb9aDw/DnLEWcFPHfzzFFn0idp7zD5SNgAXHzV PFY6UGIm86OuPZuSG31R0AU5zvcmWCeIvhxl5ZNfmZtv5h8TgmfGAgF4PSD0x/Bq4qobcfaL ugWG5FwiybPzu2H9ZLGoaRwRmCnzblJG0pRzNaC/F+0hNf63F1iSXzIlncHZ3By15bnt5QDk l50q2K/r651xphs7CGEdKi1nU0YJVbQxJQ== Subject: Re: [RFC PATCH v2 11/17] sched: Basic tracking of matching tasks Message-ID: <4e35f261-7965-3eee-cd5c-744b19de4a2b@linux.intel.com> Date: Thu, 9 May 2019 17:09:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/9/19 10:50 AM, Subhra Mazumdar wrote: > >>> select_task_rq_* seems to be unchanged. So the search logic to find a cpu >>> to enqueue when a task becomes runnable is same as before and doesn't do >>> any kind of cookie matching. >> Okay, that's true in task wakeup path, and also load_balance seems to pull task >> without checking cookie too. But my system is not over loaded when I tested this >> patch, so there is none or only one task in rq and on the rq's rb >> tree, so this patch >> does not make a difference. > I had same hypothesis for my tests. >> >> The question is, should we do cookie checking for task selecting CPU and load >> balance CPU pulling task? > The basic issue is keeping the CPUs busy. In case of overloaded system, > the trivial new idle balancer should be able to find a matching task > in case of forced idle. More problematic is the lower load scenario when > there aren't any matching task to be found but there are runnable tasks of > other groups. Also wake up code path tries to balance threads across cores > (select_idle_core) first which is opposite of what core scheduling wants. > I will re-run my tests with select_idle_core disabled, but the issue is > on x86 Intel systems (my test rig) the CPU ids are interleaved across cores > so even select_idle_cpu will balance across cores first. May be others have > some better ideas? >> We did an experiment on a coffee lake desktop that has 6 cores to see how load balancing works for core scheduling. In a nutshell, it seems like for workload like sysbench that are constant and doesn't have much sleep/wakeups, load balancer is doing a pretty good job, right on the money. However, when we are overcommiting the cpus heavily, and the load is non-constant with I/Os and lots of forks like doing kernel build, it is much harder to get tasks placed optimally. We set up two VMs, each in its own cgroup. In one VM, we run the benchmark. In the other VM, we run a cpu hog task for each vcpu to provide a constant background load. The HT on case with no core scheduling is used as baseline performance. There are 6 cores on Coffee Lake test system. We pick 3, 6 and 12 vcpu cases for each VM to look at the 1/2 occupied, fully occupied and 2x occupied system when HT is used. Sysbench (Great for core sched) Core Sched HT off ------ ---------- avg perf (std dev) avg perf (std dev) 3vcpu/VM +0.37% (0.18%) -1.52% (0.17%) 6vcpu/VM -3.36% (2.04%) -31.72% (0.13%) 12vcpu/VM +1.02% (1.17%) -31.03% (0.07%) Kernel build (Difficult for core sched) Core Sched HT off ------ ---------- avg perf (std dev) avg perf (std dev) 3vcpu/VM +0.05% (1.21%) -3.66% (0.81%) 6vcpu/VM -30.41% (3.03%) -40.73% (1.53%) 12vcpu/VM -34.03% (2.77%) -24.87% (1.22%) Tim