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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B641C433B4 for ; Fri, 23 Apr 2021 17:45:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F28761404 for ; Fri, 23 Apr 2021 17:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231522AbhDWRpp (ORCPT ); Fri, 23 Apr 2021 13:45:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:48372 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231400AbhDWRpp (ORCPT ); Fri, 23 Apr 2021 13:45:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id F2562B19B; Fri, 23 Apr 2021 17:45:07 +0000 (UTC) Date: Fri, 23 Apr 2021 19:45:05 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Vaidyanathan Srinivasan Cc: "Gautham R. Shenoy" , "Rafael J. Wysocki" , Daniel Lezcano , Michael Ellerman , "Aneesh Kumar K.V" , linuxppc-dev@lists.ozlabs.org, joedecke@de.ibm.com, linux-pm@vger.kernel.org Subject: Re: [PATCH] cpuidle/pseries: Fixup CEDE0 latency only for POWER10 onwards Message-ID: <20210423174505.GE6564@kitsune.suse.cz> References: <1619104049-5118-1-git-send-email-ego@linux.vnet.ibm.com> <20210423073551.GZ6564@kitsune.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Fri, Apr 23, 2021 at 09:29:39PM +0530, Vaidyanathan Srinivasan wrote: > * Michal Such?nek [2021-04-23 09:35:51]: > > > On Thu, Apr 22, 2021 at 08:37:29PM +0530, Gautham R. Shenoy wrote: > > > From: "Gautham R. Shenoy" > > > > > > Commit d947fb4c965c ("cpuidle: pseries: Fixup exit latency for > > > CEDE(0)") sets the exit latency of CEDE(0) based on the latency values > > > of the Extended CEDE states advertised by the platform > > > > > > On some of the POWER9 LPARs, the older firmwares advertise a very low > > > value of 2us for CEDE1 exit latency on a Dedicated LPAR. However the > > Can you be more specific about 'older firmwares'? > > Hi Michal, > > This is POWER9 vs POWER10 difference, not really an obsolete FW. The > key idea behind the original patch was to make the H_CEDE latency and > hence target residency come from firmware instead of being decided by > the kernel. The advantage is such that, different type of systems in > POWER10 generation can adjust this value and have an optimal H_CEDE > entry criteria which balances good single thread performance and > wakeup latency. Further we can have additional H_CEDE state to feed > into the cpuidle. So all POWER9 machines are affected by the firmware bug where firmware reports CEDE1 exit latency of 2us and the real latency is 5us which causes the kernel to prefer CEDE1 too much when relying on the values supplied by the firmware. It is not about 'older firmware'. I still think it would be preferrable to adjust the latency value reported by the firmware to match reality over a kernel workaround. Thanks Michal 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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77354C433ED for ; Fri, 23 Apr 2021 17:45:33 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97CE661008 for ; Fri, 23 Apr 2021 17:45:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97CE661008 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FRhXC08C1z30J6 for ; Sat, 24 Apr 2021 03:45:31 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=195.135.220.15; helo=mx2.suse.de; envelope-from=msuchanek@suse.de; receiver=) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FRhWr1mQkz2xfd for ; Sat, 24 Apr 2021 03:45:12 +1000 (AEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id F2562B19B; Fri, 23 Apr 2021 17:45:07 +0000 (UTC) Date: Fri, 23 Apr 2021 19:45:05 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Vaidyanathan Srinivasan Subject: Re: [PATCH] cpuidle/pseries: Fixup CEDE0 latency only for POWER10 onwards Message-ID: <20210423174505.GE6564@kitsune.suse.cz> References: <1619104049-5118-1-git-send-email-ego@linux.vnet.ibm.com> <20210423073551.GZ6564@kitsune.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Gautham R. Shenoy" , linux-pm@vger.kernel.org, "Aneesh Kumar K.V" , Daniel Lezcano , "Rafael J. Wysocki" , joedecke@de.ibm.com, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Apr 23, 2021 at 09:29:39PM +0530, Vaidyanathan Srinivasan wrote: > * Michal Such?nek [2021-04-23 09:35:51]: > > > On Thu, Apr 22, 2021 at 08:37:29PM +0530, Gautham R. Shenoy wrote: > > > From: "Gautham R. Shenoy" > > > > > > Commit d947fb4c965c ("cpuidle: pseries: Fixup exit latency for > > > CEDE(0)") sets the exit latency of CEDE(0) based on the latency values > > > of the Extended CEDE states advertised by the platform > > > > > > On some of the POWER9 LPARs, the older firmwares advertise a very low > > > value of 2us for CEDE1 exit latency on a Dedicated LPAR. However the > > Can you be more specific about 'older firmwares'? > > Hi Michal, > > This is POWER9 vs POWER10 difference, not really an obsolete FW. The > key idea behind the original patch was to make the H_CEDE latency and > hence target residency come from firmware instead of being decided by > the kernel. The advantage is such that, different type of systems in > POWER10 generation can adjust this value and have an optimal H_CEDE > entry criteria which balances good single thread performance and > wakeup latency. Further we can have additional H_CEDE state to feed > into the cpuidle. So all POWER9 machines are affected by the firmware bug where firmware reports CEDE1 exit latency of 2us and the real latency is 5us which causes the kernel to prefer CEDE1 too much when relying on the values supplied by the firmware. It is not about 'older firmware'. I still think it would be preferrable to adjust the latency value reported by the firmware to match reality over a kernel workaround. Thanks Michal