Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp102264pxu; Tue, 6 Oct 2020 01:40:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt1DchipUlNIziw97AjSXD1qfAn2v4TLenlsGFdhlJaxwBgSV5U6QG8hTSseCeqTl16AJ2 X-Received: by 2002:a50:d4ce:: with SMTP id e14mr4370332edj.126.1601973618865; Tue, 06 Oct 2020 01:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601973618; cv=none; d=google.com; s=arc-20160816; b=X7Ann2ynjMJgrxjov48UOpFE7s4gjdXvZMi9XbL8NCHMBW2xqLHKPcpuLX3H41xbrf eyk8vm8QkfZrmbvHPitao8SL4vu4JY6WRH0zf9SPc9g3VTa94sicyWKHOp6R/bWMeGj7 kv1XN5tJhjHR1qXCt8eju3iho0YHO7LtcTJH5pVaEqvkCWKGmIGLS9zFxTZRHdLrE4WA 5Gpmumwri4K8lPJosYzis4IrY2asaOH8jnIrOqc78ltRX54LeqP7wJAw3vyxkCfOVT2l D3BNcL5fxlrDlyUlX24+tAB5ldbWa65qXxfzeZsbS0EXsBC8i138ml8ycnx4on0u5dUt LSag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=W8wB4PbhSZEtK6qNpDr/883/RSSy4gDoDhVr5N3U9CY=; b=uDUuV6Qmx2n7z05aFUARmYY0o0wWbQnzKoz4YoRYAZ0zldzvQuNf61xkBaDll9H3nk X+wRQGcEjIh+CS8TCEUesm4keycbtwncJdYlTLqwOdT4G25J6IUzEizWxntomONGmCY+ CKEFybRiRYv0ExmfGtnecOUC/YjBb96YNe/VjUHFrt5hHHyi/FvqrkQbFphE6Uq6kT6E IOK7gSFSH+e+m8pjcMv/un0rPZxnLHXdIMt9Zl3KaU5Im0VC4qyUIn8usYbDPUyBX6KX gOI6iKHHn5+lTnibTRLOXIb76SPahcX0DEawwlGo5IA9CV+DaPHg2ofkVYSwm9RazOqH RARw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha1si1475254ejb.406.2020.10.06.01.39.55; Tue, 06 Oct 2020 01:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725973AbgJFIg1 (ORCPT + 99 others); Tue, 6 Oct 2020 04:36:27 -0400 Received: from outbound-smtp34.blacknight.com ([46.22.139.253]:39765 "EHLO outbound-smtp34.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbgJFIg1 (ORCPT ); Tue, 6 Oct 2020 04:36:27 -0400 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp34.blacknight.com (Postfix) with ESMTPS id A47981905 for ; Tue, 6 Oct 2020 09:36:41 +0100 (IST) Received: (qmail 6665 invoked from network); 6 Oct 2020 08:36:41 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 6 Oct 2020 08:36:41 -0000 Date: Tue, 6 Oct 2020 09:36:39 +0100 From: Mel Gorman To: "Rafael J. Wysocki" Cc: Takashi Iwai , linux-kernel@vger.kernel.org Subject: ACPI _CST introduced performance regresions on Haswll Message-ID: <20201006083639.GJ3227@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, Numerous workload regressions have bisected repeatedly to the commit 6d4f08a6776 ("intel_idle: Use ACPI _CST on server systems") but only on a set of haswell machines that all have the same CPU. CPU(s): 48 On-line CPU(s) list: 0-47 Thread(s) per core: 2 Core(s) per socket: 12 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 63 Model name: Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz Stepping: 2 CPU MHz: 1200.359 CPU max MHz: 3100.0000 CPU min MHz: 1200.0000 As well as being bisected in mainline, backporting the patch to a distribution kernel also showed the same type of problem so the patch is definitely suspicious. An example comparison showing the performance before CST was enabled and recent mainline kernels is as follow netperf UDP_STREAM 5.5.0 5.5.0-rc2 5.5.0-rc2 5.6.0 5.9.0-rc8 vanilla sle15-sp2-pre-cst sle15-sp2-enable-cst vanilla vanilla Hmean send-64 203.21 ( 0.00%) 206.43 * 1.58%* 176.89 * -12.95%* 181.18 * -10.84%* 194.45 * -4.31%* Hmean send-128 401.40 ( 0.00%) 414.19 * 3.19%* 355.84 * -11.35%* 364.13 * -9.29%* 387.83 * -3.38%* Hmean send-256 786.69 ( 0.00%) 799.70 ( 1.65%) 700.65 * -10.94%* 719.82 * -8.50%* 756.40 * -3.85%* Hmean send-1024 3059.57 ( 0.00%) 3106.57 * 1.54%* 2659.62 * -13.07%* 2793.58 * -8.69%* 3006.95 * -1.72%* Hmean send-2048 5976.66 ( 0.00%) 6102.64 ( 2.11%) 5249.34 * -12.17%* 5392.04 * -9.78%* 5805.02 * -2.87%* Hmean send-3312 9145.09 ( 0.00%) 9304.85 * 1.75%* 8197.25 * -10.36%* 8398.36 * -8.17%* 9120.88 ( -0.26%) Hmean send-4096 10871.63 ( 0.00%) 11129.76 * 2.37%* 9667.68 * -11.07%* 9929.70 * -8.66%* 10863.41 ( -0.08%) Hmean send-8192 17747.35 ( 0.00%) 17969.19 ( 1.25%) 15652.91 * -11.80%* 16081.20 * -9.39%* 17316.13 * -2.43%* Hmean send-16384 29187.16 ( 0.00%) 29418.75 * 0.79%* 26296.64 * -9.90%* 27028.18 * -7.40%* 26941.26 * -7.69%* Hmean recv-64 203.21 ( 0.00%) 206.43 * 1.58%* 176.89 * -12.95%* 181.18 * -10.84%* 194.45 * -4.31%* Hmean recv-128 401.40 ( 0.00%) 414.19 * 3.19%* 355.84 * -11.35%* 364.13 * -9.29%* 387.83 * -3.38%* Hmean recv-256 786.69 ( 0.00%) 799.70 ( 1.65%) 700.65 * -10.94%* 719.82 * -8.50%* 756.40 * -3.85%* Hmean recv-1024 3059.57 ( 0.00%) 3106.57 * 1.54%* 2659.62 * -13.07%* 2793.58 * -8.69%* 3006.95 * -1.72%* Hmean recv-2048 5976.66 ( 0.00%) 6102.64 ( 2.11%) 5249.34 * -12.17%* 5392.00 * -9.78%* 5805.02 * -2.87%* Hmean recv-3312 9145.09 ( 0.00%) 9304.85 * 1.75%* 8197.25 * -10.36%* 8398.36 * -8.17%* 9120.88 ( -0.26%) Hmean recv-4096 10871.63 ( 0.00%) 11129.76 * 2.37%* 9667.68 * -11.07%* 9929.70 * -8.66%* 10863.38 ( -0.08%) Hmean recv-8192 17747.35 ( 0.00%) 17969.19 ( 1.25%) 15652.91 * -11.80%* 16081.20 * -9.39%* 17315.96 * -2.43%* Hmean recv-16384 29187.13 ( 0.00%) 29418.72 * 0.79%* 26296.63 * -9.90%* 27028.18 * -7.40%* 26941.23 * -7.69%* pre-cst is just before commit 6d4f08a6776 ("intel_idle: Use ACPI _CST on server systems") and enable-cst is the commit. It was not fixed by 5.6 or 5.9-rc8. A lot of bisections ended up here including kernel compilation, tbench, syscall entry/exit microbenchmark, hackbench, Java workloads etc. What I don't understand is why. The latencies for c-state exit states before and after the patch are both as follows /sys/devices/system/cpu/cpu0/cpuidle/state0/latency:0 /sys/devices/system/cpu/cpu0/cpuidle/state1/latency:2 /sys/devices/system/cpu/cpu0/cpuidle/state2/latency:10 /sys/devices/system/cpu/cpu0/cpuidle/state3/latency:33 /sys/devices/system/cpu/cpu0/cpuidle/state4/latency:133 Perf profiles did not show up anything interesting. A diff of /sys/devices/system/cpu/cpu0/cpuidle/state0/ before and after the patch showed up nothing interesting. Any idea why exactly this patch shows up as being hazardous on Haswell in particular? -- Mel Gorman SUSE Labs