Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp130152yba; Thu, 25 Apr 2019 19:37:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzS62pmnRjs05Aj65u8nw5wTIGiIsgWx+u+/nv68cP4gHhehgKP8LQ/TymLY+MsfGR6BUf X-Received: by 2002:aa7:8e04:: with SMTP id c4mr43696662pfr.48.1556246258823; Thu, 25 Apr 2019 19:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556246258; cv=none; d=google.com; s=arc-20160816; b=OuC6hElYVHaInZuel0crEW7AWN5/v/WT4qNAy3FJwL1nLOKMux9BWuwzJHjGBLduIL UiNWgOUGrV5EWp+1QZXB4pDjQw6W5oZcgnLWLxewaKnpCyAGpsZ0HpA8pIMe7q+2wba+ B6mrh1uaStjc+yey5W9lPlJNEuyAnujr5lp1sf1iaVFbiUwdcwUOaCWxFTjcDPqZTbSD V/RqKOIfm2LVZ8MkNezFCzSXHlQslQKwIt8yM3ea5Jky5fc8+pQ3g2XRBNeHVtD4YnZM y5HCs3/9WTTPpezGbkM/Aau4pIkQFBM3Y+MhVOU4/TmM4+EQ3veWN3kKLM6uOLqbJ5Fv /VlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6gkFpbTusHg+1SZjh8+azBb3XS+APJ2PQ3Ib6xoheF4=; b=wueUexRtMnwo/9OLOmo+Lk8ctCJAUZwMDNA2jeU1/YIJ5jA0PjV+1PQ00tLesQUx+7 AY8dEz+S60uoYBAKahinOJuBCFzdqQHA+8UIkUtDqt8aV6JFXrgb5okW4EKXaEt3nOmx 7JqewXZvfajnCajwtRLxjvYVytLW+T9nwvoLdimaw6Fs/CPM8F1ncedl0CDA6psxqFF8 bl+JYHIPDEXYsuPlB0smCQuYEXgwBk8wuDOWBfrhYwkcNY1ZPxM/nkz1fWJPadkcOTe4 NkhDTlJdZEcst3joLpKFOaw8g9jtojqHwAremIL1OfifJ8XH3fyjnofKZ3prGr992ItO dM1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sCGdRr58; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b61si24167572plb.22.2019.04.25.19.37.23; Thu, 25 Apr 2019 19:37:38 -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=@gmail.com header.s=20161025 header.b=sCGdRr58; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727563AbfDZCS1 (ORCPT + 99 others); Thu, 25 Apr 2019 22:18:27 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:34942 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfDZCS0 (ORCPT ); Thu, 25 Apr 2019 22:18:26 -0400 Received: by mail-lj1-f196.google.com with SMTP id z26so1468396ljj.2 for ; Thu, 25 Apr 2019 19:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6gkFpbTusHg+1SZjh8+azBb3XS+APJ2PQ3Ib6xoheF4=; b=sCGdRr58OLE+EXpHMLiiVzl3T6ow8R8JJ7ULCs5UqMSgQXP0GmlkR6+jUGyVnCytEU JE7si/KoPe5XXJFFz88OyeqLpynaFNnqZ//DEjrYdjz6WrjtvhDhu/FO/ZK5Aqvhj8vY ILgK+4JuLA7BdFbCr3nksKK3pmPMP5nm27hxfjd+WWbRnZCjKONp49m+3gdi+8FWBeWl NsjOaLkW+tezDzTqINge97jVGdiUDXKnBRnUImjeeTRSBbfpRQfFPpIgz0cOl6lucS1a WUS2GVNVaUpCTjXXtNmdpO0Ckok4vOMqdZCbSEdzU4svoGcMHrkZRY2g5m9EtCzCKgV0 7vNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6gkFpbTusHg+1SZjh8+azBb3XS+APJ2PQ3Ib6xoheF4=; b=sTKhyl7yZ36KZsEYXD1BzlIBh/hC+6GLcbt2H6f1Un90WxOBFjqsohggMici1LZmpK 4DRnniKaEhhYnQiQh8/jMeraZh0NoA6tOe8e0YzQjkDTX8zV9IDt2XuQ2bup6qJRvZhm XZOKT7sazIhyvvj8BaiEFoSDu5JYr0/FmadezKkECnj/MQXelyRhkfEleVf24+M6A/tx k/AeCD1b2IjnLPv0fU2ZXY5T+qvxH59AIlNSw285JP83au6ppPfurQrM2ZrGR/Bc7lZI kXmG8kIamL2+XMfmGMcrLoqugX5l/JbIXxoK2eDSVPfc1f1e5hTXp/JPxN0Cj83AI02O 0KzA== X-Gm-Message-State: APjAAAUvBqycRx5epgfSrRqKyj/IT6WZN0C/rdIg8LLXJ21Ptg/c9W4B v22gM3DZoLuQ2QJJHoKd1uZUdGXR96K4+IfqfMY= X-Received: by 2002:a2e:2b16:: with SMTP id q22mr23423701lje.20.1556245104660; Thu, 25 Apr 2019 19:18:24 -0700 (PDT) MIME-Version: 1.0 References: <20190424140013.GA14594@sinkpad> <20190425095508.GA8387@gmail.com> In-Reply-To: <20190425095508.GA8387@gmail.com> From: Aubrey Li Date: Fri, 26 Apr 2019 10:18:13 +0800 Message-ID: Subject: Re: [RFC PATCH v2 00/17] Core scheduling v2 To: Ingo Molnar Cc: Julien Desfossez , Vineeth Remanan Pillai , Nishanth Aravamudan , Peter Zijlstra , Tim Chen , Thomas Gleixner , Paul Turner , Linus Torvalds , Linux List Kernel Mailing , Subhra Mazumdar , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Kees Cook , Greg Kerr , Phil Auld , Aaron Lu , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 5:55 PM Ingo Molnar wrote: > > > * Aubrey Li wrote: > > > On Wed, Apr 24, 2019 at 10:00 PM Julien Desfossez > > wrote: > > > > > > On 24-Apr-2019 09:13:10 PM, Aubrey Li wrote: > > > > On Wed, Apr 24, 2019 at 12:18 AM Vineeth Remanan Pillai > > > > wrote: > > > > > > > > > > Second iteration of the core-scheduling feature. > > > > > > > > > > This version fixes apparent bugs and performance issues in v1. This > > > > > doesn't fully address the issue of core sharing between processes > > > > > with different tags. Core sharing still happens 1% to 5% of the time > > > > > based on the nature of workload and timing of the runnable processes. > > > > > > > > > > Changes in v2 > > > > > ------------- > > > > > - rebased on mainline commit: 6d906f99817951e2257d577656899da02bb33105 > > > > > > > > Thanks to post v2, based on this version, here is my benchmarks result. > > > > > > > > Environment setup > > > > -------------------------- > > > > Skylake server, 2 numa nodes, 104 CPUs (HT on) > > > > cgroup1 workload, sysbench (CPU intensive non AVX workload) > > > > cgroup2 workload, gemmbench (AVX512 workload) > > > > > > > > Case 1: task number < CPU num > > > > -------------------------------------------- > > > > 36 sysbench threads in cgroup1 > > > > 36 gemmbench threads in cgroup2 > > > > > > > > core sched off: > > > > - sysbench 95th percentile latency(ms): avg = 4.952, stddev = 0.55342 > > > > core sched on: > > > > - sysbench 95th percentile latency(ms): avg = 3.549, stddev = 0.04449 > > > > > > > > Due to core cookie matching, sysbench tasks won't be affect by AVX512 > > > > tasks, latency has ~28% improvement!!! > > > > > > > > Case 2: task number > CPU number > > > > ------------------------------------------------- > > > > 72 sysbench threads in cgroup1 > > > > 72 gemmbench threads in cgroup2 > > > > > > > > core sched off: > > > > - sysbench 95th percentile latency(ms): avg = 11.914, stddev = 3.259 > > > > core sched on: > > > > - sysbench 95th percentile latency(ms): avg = 13.289, stddev = 4.863 > > > > > > > > So not only power, now security and performance is a pair of contradictions. > > > > Due to core cookie not matching and forced idle introduced, latency has ~12% > > > > regression. > > > > > > > > Any comments? > > > > > > Would it be possible to post the results with HT off as well ? > > > > What's the point here to turn HT off? The latency is sensitive to the > > relationship > > between the task number and CPU number. Usually less CPU number, more run > > queue wait time, and worse result. > > HT-off numbers are mandatory: turning HT off is by far the simplest way > to solve the security bugs in these CPUs. > > Any core-scheduling solution *must* perform better than HT-off for all > relevant workloads, otherwise what's the point? > Got it, I'll measure HT-off cases soon. Thanks, -Aubrey