Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1755291pxb; Mon, 13 Sep 2021 05:00:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX1yxQ/XNI33AVrsEGMT1YnKSLKwVN6dMcjbAHnvkxKaD0kdP3VCVFpI59vA7rhNDX7rNg X-Received: by 2002:a17:906:3a58:: with SMTP id a24mr11995484ejf.109.1631534415217; Mon, 13 Sep 2021 05:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631534415; cv=none; d=google.com; s=arc-20160816; b=uB3HNr2GzO8GRMfWIJHjJAfsvfsg2UZ+OkSgdL4TuYDryJO/Gp01dhsPSlw0JfjKGb ySjoVZjZJKdNrDkkGpFBIPaV3WUZGKK41ijc0h472DhiDmTuuy2HcmlumnTRCRyuy38F 89yHEWk5XKGfdZt5/8AicA/6RKyuafTmY4uk0fu0a4dn0Nfc/tpDSgF3UekBvnpxrzxK 7f705rK899/urysZ+gnhR74v5+b6ntxNfcH4k7rh46sDCg4vRSmhhWseiN69j9u4OOit cVNm63OuywNXdtiwCHURmdRLoW9nSnPfuimDJfW7pocUzOZXvVvwRI64p0hVsuh9H+gL N2Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ug9DySFxoOZyEdHs8+gifEeoKIDne0VZ90M+2UYmmSQ=; b=dHgCKZZjC5ZM4dFstZc7B3Q/OvSOgKftiYzX9cZNRCBvPSQTvlj3/3yUNRq2UiSckY ex/+V44LXqVNp0cBu4s+WY1lsDIQHakEpQ2fYMLrn7zn+4nPC76H3Od2A7uPI1K3yUgc eQ930Fd7eIQSjNR+kGLgH6KmIZcRJtpHwjh68Q33Zdlqs8ycmZUiJL8l/2GOpfdIk1cx stnnIcDF/75AS0l0dBQVnqvKUIb7z4gVUjLFyBhOZ/ZQ8uCsTFUl7wb0smcVYbtOxpwI m80HKhV1xOGHGxGjUZWdLiAtso6qAIyWC90aQSueKvGIXbHwm7mUlm5mXVNFd1j5EnYG tc1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=LOlC4gUg; 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 e20si6615581edv.335.2021.09.13.04.59.47; Mon, 13 Sep 2021 05:00:15 -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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=LOlC4gUg; 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 S239821AbhIML6C (ORCPT + 99 others); Mon, 13 Sep 2021 07:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239705AbhIML6B (ORCPT ); Mon, 13 Sep 2021 07:58:01 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1A42C061574; Mon, 13 Sep 2021 04:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ug9DySFxoOZyEdHs8+gifEeoKIDne0VZ90M+2UYmmSQ=; b=LOlC4gUgQZKsTgDnQImNVgz6tg FTzSTizKeuRT+xMMbdfTAJmFRIgqH6N5uW7rZQ/lgvcCnbf+Goy5E8K285YoEYVNiskgfGO1NWGFK HacqTR2TMELZKlBTEh5F8Jte3ecd368NLWPDun1aRJUK2E+oX1jSmtR72rQQgzz9foIeT102WnhzT 6SY5fMdp2tvFrgZoE0Xcz7xzQDUCZBDnKpY6KoS+aEfhj5mRSVPdDpeUSkqK5pjyeG0r91XG5avtl GO4UHqrr9yVIvDa9Ji/90vHZTjK6Reum6iu/4Sls5fgIQTfK2DvWUC3QF2lewWKxfB41SnZ8EGK6h TgGAb7Lw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPkZd-002ocN-CI; Mon, 13 Sep 2021 11:56:33 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 77EF43004DE; Mon, 13 Sep 2021 13:56:32 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5D0FB2BE7CB97; Mon, 13 Sep 2021 13:56:32 +0200 (CEST) Date: Mon, 13 Sep 2021 13:56:32 +0200 From: Peter Zijlstra To: Huang Rui Cc: "Rafael J . Wysocki" , Viresh Kumar , Shuah Khan , Borislav Petkov , Ingo Molnar , "linux-pm@vger.kernel.org" , "Sharma, Deepak" , "Deucher, Alexander" , "Limonciello, Mario" , "Fontenot, Nathan" , "Su, Jinzhou (Joe)" , "Du, Xiaojian" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH 04/19] cpufreq: amd: introduce a new amd pstate driver to support future processors Message-ID: References: <20210908150001.3702552-1-ray.huang@amd.com> <20210908150001.3702552-5-ray.huang@amd.com> <20210913081134.GA3731830@hr-amd> <20210913105458.GC3731830@hr-amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210913105458.GC3731830@hr-amd> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 06:54:58PM +0800, Huang Rui wrote: > On Mon, Sep 13, 2021 at 04:56:24PM +0800, Peter Zijlstra wrote: > > > 1) Full MSR Support > > > If current hardware has the full MSR support, we register "pstate_funcs" > > > callback functions to implement the MSR operations to control the clocks. > > > > What's the WRMSR cost for those? I've not really kept track of the MSR > > costs on AMD platforms, but on Intel it has (luckily) been coming down > > quite a bit. > > Good to know this, I didn't have a chance to give a check. May I know how > did you test this latency? But MSR is new hardware design for this > solution, as designer mentioned, the WRMSR is low-latency register model is > faster than ACPI AML code interpreter. > > > > > > 2) Shared Memory Support > > > If current hardware doesn't have the full MSR support, that means it only > > > provides share memory support. We will leverage APIs in cppc_acpi libs with > > > "cppc_funcs" to implement the target function for the frequency control. > > > > Right, the mailbox thing. How is the performance of this vs MSR accesses? > > I will give a check. If you have a existing test method that can be used, I > can check it quickly. Oh, I was mostly wondering if using the mailbox as MMIO would be faster than an MSR, but you've already answered that above. Also: > > > 1. As mentioned above, amd-pstate driver can implement > > > fast_switch/adjust_perf function with full MSR operations that have better > > > performance for schedutil and other governors. > > > > Why couldn't the existing cppc-cpufreq grow this? > > Because fast_switch can adjust the frequency directly in the interrupt > context, if we use the acpi cppc handling with shared memory solution, it > will have a deadlock. So fast switch needs the control with registers > directly like acpi-cpufreq and intel-pstate. Aah, I see, you're only doing fast_switch support when you have MSRs. That was totally non-obvious.. :/ But then amd_pstate_adjust_perf() could just direct call the pstate methods and we don't need that indirection *at*all*, right?