From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3B9CD2F7FC for ; Thu, 17 Oct 2024 08:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+hk+5SyGjTlwDYaigWcpw1Or3aoGUSUirgevjwK646M=; b=IbvyPx6ynn/n/dbfInGgteYnWm OxSxsa1DiZUYyV63aSC6R7oRb3aMuRtdG0+aOSFpPXbqueWmgTYk9aeBinFPZZ0d4+fAGiDYoeF8B busIYapcVTDh6/oSvyc1CKRbMGjBIlYhPi3GYNZyP8wgfAocA7OiJGIAvLLFuFjpf/IBMJCouJqYT wdlGHJuO3YKJElSMLV0s3BUXusVYPrKTZ00zYjpOIAnI46AZGVeFq1gDtqlNwPIyK0tnTnEhQnqSl IeQbcAl1R0cvjcK3ygR0tDQToNTLsSbPjfa5yh15RU4yVLhQ4/1ml1+20Gam79GgzXrXz206iZVT/ qv3QEsTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1Ll7-0000000E9yW-0nmN; Thu, 17 Oct 2024 08:21:25 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1Ljd-0000000E9k1-3me3 for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 08:19:55 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9087D5C59CC; Thu, 17 Oct 2024 08:19:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A08C0C4CEC3; Thu, 17 Oct 2024 08:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729153192; bh=GInnBn+NilFxTVvAPhppcfdBhV7v8zyNPgMLAjfhsQo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NCa8o7M5nHa+FK/+KHfno1zUrcmbPZJE0vROcSMmvepPJnZpDXPlyoDNxM4wN2xkL gQZjPMmC3otKdK68P+T/C11hStPc9YiF5mo6vr2THaENJ/c1+XHM2NSD8Tc4Rc1yuq D8GFv69HBeFOw7O5CK5QLFJh1fX6wyS5Bk4LBBoEsxJe4nmmavI7zbh6MbFZNtteip kV/ZKgKaPlkRsl8zuRgclmOGg1qVrvSCaui3FXpBemsXzz9NwZPFXrxj/8kv8Ac/yT QicNm+C1wv59fIrZYpQzMEQCe8JlSb5mGvPHVY+XdrqndiXvWYOFoMtu6Yb5tFETJI MUniEkXjrdmmA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t1LjZ-004M2D-TO; Thu, 17 Oct 2024 09:19:50 +0100 Date: Thu, 17 Oct 2024 09:19:48 +0100 Message-ID: <86sesv3zvf.wl-maz@kernel.org> From: Marc Zyngier To: Ankur Arora Cc: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: Re: [PATCH v8 00/11] Enable haltpoll on arm64 In-Reply-To: <87plnzpvb6.fsf@oracle.com> References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> <8634kx5yqd.wl-maz@kernel.org> <87plnzpvb6.fsf@oracle.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: ankur.a.arora@oracle.com, linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_011954_190410_A1651B0F X-CRM114-Status: GOOD ( 21.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 16 Oct 2024 22:55:09 +0100, Ankur Arora wrote: > > > Marc Zyngier writes: > > > On Thu, 26 Sep 2024 00:24:14 +0100, > > Ankur Arora wrote: > >> > >> This patchset enables the cpuidle-haltpoll driver and its namesake > >> governor on arm64. This is specifically interesting for KVM guests by > >> reducing IPC latencies. > >> > >> Comparing idle switching latencies on an arm64 KVM guest with > >> perf bench sched pipe: > >> > >> usecs/op %stdev > >> > >> no haltpoll (baseline) 13.48 +- 5.19% > >> with haltpoll 6.84 +- 22.07% > >> > >> > >> No change in performance for a similar test on x86: > >> > >> usecs/op %stdev > >> > >> haltpoll w/ cpu_relax() (baseline) 4.75 +- 1.76% > >> haltpoll w/ smp_cond_load_relaxed() 4.78 +- 2.31% > >> > >> Both sets of tests were on otherwise idle systems with guest VCPUs > >> pinned to specific PCPUs. One reason for the higher stdev on arm64 > >> is that trapping of the WFE instruction by the host KVM is contingent > >> on the number of tasks on the runqueue. > > > > Sorry to state the obvious, but if that's the variable trapping of > > WFI/WFE is the cause of your trouble, why don't you simply turn it off > > (see 0b5afe05377d for the details)? Given that you pin your vcpus to > > physical CPUs, there is no need for any trapping. > > Good point. Thanks. That should help reduce the guessing games around > the variance in these tests. I'd be interested to find out whether there is still some benefit in this series once you disable the WFx trapping heuristics. Thanks, M. -- Without deviation from the norm, progress is not possible.