Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp442120yba; Fri, 26 Apr 2019 02:53:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyyTgFqwP3otRC8VSZbV7Y2iBLF4YKjoDJHXjO6hoYb6F2YGSHsvH8KiCnBq2S1KxCOSFt X-Received: by 2002:a63:ef4c:: with SMTP id c12mr43402080pgk.43.1556272382372; Fri, 26 Apr 2019 02:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556272382; cv=none; d=google.com; s=arc-20160816; b=nQu22Dro26LGmJ1Mr0+MuALuE9rpbYb/PJW/9DkaTJMyQ3ZW1ncn1m7cjltrhAy/ir MSFIAyaapBrGuGkv+VJ8VmhsBGuOkX2Dir2HIAjH6EsKUjWa/ys4HOkbEtH1j/InS7vu +PPxSz0MIwlLRsezXwA0e35vmcLBlZchxiXHzC+5+kePopLz9N0peq+/lsCP0QWbP4h5 YFTvbkqIdCqw47Oscp3+gSrVrq/tnQWvAJyveWais7EaKcoAxhWq0ZODsL+FSyZ3AHhV ncr9n37/q5oLeMx00/e1FOGUiWRxeUQuAugOl2vNQnhlUYbpmGb3dfBaBbb4IIZyN7/F SaGg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=NLJ08Ufr1QVxZuFD/lFtwOIQE4Cp4+A0n25EKyxM2OM=; b=TOglaSQNjvqHlYHYR9z/Y2boaMZiaCsA9D268B+wez2HlQuh0Y+a6mBfqJGccy+GSq tusDxlc3HDWNRA1ZeadagxoHZ7OG6kkVYPCNpQkCc/35ioGs6Snb1JNIa1ktMAMLAD6b qUTmqGpcr/W1AjO3mZZ5IaM7Kqm88OMakqV+2po/XxtY92xJA8qIuyt7m5bTALJr7Ube 5ZsInPqYZcGqY29C1uU0Gc6fyeBc0+R/rfwkhKuVC5EUTdYr5Crd4uyyYTOLO1+CA3lk WCLNosysq9BOiO9PsR2cxpZwWt2jjPrwAVGAU1KarKgeWjMHbQaRbwGzf2W30PTlhIdQ 7VRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TLkxn4TE; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si23021984pgv.128.2019.04.26.02.52.46; Fri, 26 Apr 2019 02:53:02 -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=@gmail.com header.s=20161025 header.b=TLkxn4TE; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726473AbfDZJvt (ORCPT + 99 others); Fri, 26 Apr 2019 05:51:49 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40489 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbfDZJvs (ORCPT ); Fri, 26 Apr 2019 05:51:48 -0400 Received: by mail-wm1-f68.google.com with SMTP id h11so3454644wmb.5 for ; Fri, 26 Apr 2019 02:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NLJ08Ufr1QVxZuFD/lFtwOIQE4Cp4+A0n25EKyxM2OM=; b=TLkxn4TEKm9gZ4iYB8i8g3meZLx+59eMI6dN40tU1eLICJOguiL2gGj/4k4LSXDB5a lTVcRTQMNepYYkJenv4QVfmA372DXtY8FnDZCUFZ2t5esrQY4dcgl1PVLjCPBtFviWLj J754QVTTVS95etgt5Trbeneatwcw7FZdHFiI+Hy6gndC0ICr9boL8qe1q7Zd6LIZvabw jcbfpnuEUolGoyIhbJ2QIiHC7plrTtV7x6IFK0tsWvT4ZEe9mNmq+wgYp7RxfWvoSNrx TjUeTv4ZMMrbX8bQWDmI0slGGYa+8mojM6lxXlhqNwLu873IiXr12iXKviRtdVzCKA71 FgQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=NLJ08Ufr1QVxZuFD/lFtwOIQE4Cp4+A0n25EKyxM2OM=; b=RZiV4yENOcQ2A7bn2NvN9pg7m6HogvDsU6O12egF8C7Un+KOZsNS2PtDDlO8VA7wnx 2CCEkK0EO1W/0U4QFDcwo57SJcaMxQFTQ8g/ZMa/L3jw1mNxbDc9141/VpuKQLz0Qd+4 By6rOxny65BS2hHiojgwsO8tiwlzz8RQFOT6OxqBaZp+xrnzJEKjK2U5XQtNNEhF6HFa k7M/y23eo+ZBi5Vuzc685BAe+y1HHNVycofRDR0LShQA3OwhZGMP1zSHMFgH5km0UwqJ p59MbY6aoX3E1GfBWH5EZIqAsiKSurvN506VlcLfhugkRs7Mr4qqFUvqnnyQa/5Jxilv HcrA== X-Gm-Message-State: APjAAAW2ZgbZtwzpSemo7qYJV4830rLS+9GQdBgWafSPVGYvuVRZzooF 1dcPQzEAqTBQiFAv+5j+WUuSOW3L X-Received: by 2002:a1c:ef10:: with SMTP id n16mr7427255wmh.70.1556272306313; Fri, 26 Apr 2019 02:51:46 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id z140sm49096201wmc.27.2019.04.26.02.51.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 02:51:45 -0700 (PDT) Date: Fri, 26 Apr 2019 11:51:43 +0200 From: Ingo Molnar To: Aubrey Li Cc: Julien Desfossez , Vineeth Remanan Pillai , Nishanth Aravamudan , Peter Zijlstra , Tim Chen , Thomas Gleixner , Paul Turner , Linus Torvalds , Linux List Kernel Mailing , Subhra Mazumdar , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , Kees Cook , Greg Kerr , Phil Auld , Aaron Lu , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Subject: Re: [RFC PATCH v2 00/17] Core scheduling v2 Message-ID: <20190426095143.GF126896@gmail.com> References: <20190424140013.GA14594@sinkpad> <20190425095508.GA8387@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Aubrey Li wrote: > 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! Ingo