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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7EE99C433DB for ; Mon, 11 Jan 2021 12:45:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41F0F224B1 for ; Mon, 11 Jan 2021 12:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbhAKMpG (ORCPT ); Mon, 11 Jan 2021 07:45:06 -0500 Received: from mail-ot1-f49.google.com ([209.85.210.49]:38442 "EHLO mail-ot1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbhAKMpG (ORCPT ); Mon, 11 Jan 2021 07:45:06 -0500 Received: by mail-ot1-f49.google.com with SMTP id j20so16733913otq.5; Mon, 11 Jan 2021 04:44:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OE8Ck6Fz6PnIIJhS2pFaP159N05z71BcH03XOcV38i0=; b=rVPuShmh/DWoBdcGQ45LebkT1CKh5afaNe6Dr28TRf2k0X7t4csDh+Jf6fP37H5ZPj VE6aqhe4rogyhBT03DcFo/rLeOW7B7WHT6pcTi0FCBTCAvd/FJk98MzAHJMuGas9vSLu 4b8QB20CaT7LX93ozXMVTODmKoDqbdwHPH/umRxBjGst2CyQdtwaIrl5WRbRCb5Uoh+g IwiAhs5M+Tyuo3am7MxjSxrSD5s5rOnOjMrWAkaT4s17q4f2V3/cRbwikQur50WnHRSf yyRTzYTe31je7lnIOboHHkb7EmX72zqWNjnO5IwIkP62fDO42iftnLqLfmfwA4u11DN4 smSg== X-Gm-Message-State: AOAM531SAxb5khf9F3F5427sL3IsX2X+bNCaEvnFvZDI8OZ4WRMdECZH 7MTOPc8a40x6bknWJ+B3xVbdQq62pAvmfykBhG4= X-Google-Smtp-Source: ABdhPJwWSyyTbjv3EPW+3ZKqkIBuX/hY9RKQ+COKETsyjcM7OEG7VAF9tn9SEDQ+djQD8i9vpabOzIfgD4tBQpUIK7g= X-Received: by 2002:a9d:745a:: with SMTP id p26mr11109977otk.206.1610369065577; Mon, 11 Jan 2021 04:44:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 11 Jan 2021 13:44:09 +0100 Message-ID: Subject: Re: [PATCH 1/2][v2] cpufreq: intel_pstate: Add parameter to get guarantee frequency To: Chen Yu Cc: Srinivas Pandruvada , Len Brown , "Rafael J. Wysocki" , Viresh Kumar , Linux PM , Linux Kernel Mailing List , Zhang Rui , Wendy Wang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Mon, Jan 11, 2021 at 8:40 AM Chen Yu wrote: > > Add input parameter to receive guarantee pstate from intel_pstate_get_hwp_max() > for later use. I'm not a fan of this change, because the new argument will only be needed in one place where intel_pstate_get_hwp_max() and it requires adding redundant local vars and pointless updates elsewhere. Besides, in intel_pstate_get_cpu_pstates() you can do something like this after calling intel_pstate_get_hwp_max(): cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(READ_ONCE(cpu->hwp_cap_cached)); cpu->pstate.max_freq = cpu->pstate.max_pstate * cpu->pstate.scaling;