Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp543331ybg; Wed, 3 Jun 2020 07:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU7vdZue9xJEw/zXO+taEtRdhzNsFkEU7CuHlRhHSnwFFfMv79Utyes+y2PbWDfBscFxM8 X-Received: by 2002:a17:906:7f02:: with SMTP id d2mr13490455ejr.211.1591194393312; Wed, 03 Jun 2020 07:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591194393; cv=none; d=google.com; s=arc-20160816; b=f0uL9m/XfFVdTJcXNR8GfHlVg+rOFVqNectHiT+/d5WjLT/l+YopEIjND7n3vUEJwg s9wXUOea45MFgqMFdUX/YB42dwFZ30SoJwA2B4/Go788ZEKndB9mHS+HD/mn6WO4AQyN 0f/FGJa7aLrtrufS7bePaR0fOH4HXjs1tmXPu4D/GUjMacuU8FsLEvNSpZKRJ+eWx3KG O2Hbkhj+BEhPzDatxLKejcVQW8zsKmQuX0kg2xjEl3A0aWlLEzgz7Fx/gV2OL6V8hxfq HL8urAq3l0dBpb4vSd1WtSh/K7eT/7ErFiXL6iRZOUDViTpCtNFUcpOmgPGGcKuIpw7j qp0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=bgK8cHZmw8249VNtqMSwdN+a20DMUemCHkqYDe9eooc=; b=CSsHOcJ+4EZ2GY8mszHUBDlf23OMO+kJs3JSUhDZPHlGXGeib0xVcc5GN1y7k/TbcE VrZov5Q372sUhUePGu4n6SXX26j0+Ye5kdd15ptkqm2Dj5eMP3wHaHLiXrFaYfF7aUkk hormhu2NK4yLGFVD0u3Pr6LfQrDG673D348yRsS/oV6/Q2Hp2Ai9boHsWTuVy1U51XnB Plyv7JlgmIzLPa4rQNVGi3Nk0yZZM+sFnaDdtGo0uhi4qweMWGi+b/SeOhX4dV0aLARa tXXwjzHg0p6G55SXj0g5ZpM/j110DUJAOnF934ijyMSWIO4287iUo1cumzlG4L4lvNX2 HhMg== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p22si1184195edy.126.2020.06.03.07.26.10; Wed, 03 Jun 2020 07:26:33 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726054AbgFCOYO (ORCPT + 99 others); Wed, 3 Jun 2020 10:24:14 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:39650 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725810AbgFCOYO (ORCPT ); Wed, 3 Jun 2020 10:24:14 -0400 Received: by mail-ot1-f68.google.com with SMTP id g5so1988859otg.6; Wed, 03 Jun 2020 07:24:13 -0700 (PDT) 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=bgK8cHZmw8249VNtqMSwdN+a20DMUemCHkqYDe9eooc=; b=CoYyIWlStEhASO6eByEi3X/u0jct+Xpl6X0UzmJVzmDC2N953JJmnlXE7lK9DD1yqE NTQgCrspVdWvJccsQQ0/p+cjlKHabXRAMAG+gZ5XQjYaeUnTrf9yyf9K+gQC9CV1wE+R wS0qzr1oKDPcxWwXZrukUmba5AEw3hRIB1/87mHHzIrURG6kLVH9jf3r9JBXQt3gSf34 xM2d79S5d8UqHr8FfFKzBi3i5xOImBRUpB5JBHVMDL/vEoydQ+WcAns/RX/wNFDI2TRx WHcdxi4Y5HV9AtfYkNwbI0KO7N3oXEKMTk0JG9aT7jj1ZY1KHFAMKDRCcNudcVjD0fjx aMzw== X-Gm-Message-State: AOAM531f+5a8ARfyOeTOxHJtGsIGwn5T7lrrSYyEQSSG2w4mscgoFPZK I8vbSbzVYdztxiWqAYhlI993bO4z2ZhNsSl/k9Y= X-Received: by 2002:a05:6830:20d1:: with SMTP id z17mr149194otq.167.1591194250393; Wed, 03 Jun 2020 07:24:10 -0700 (PDT) MIME-Version: 1.0 References: <20200531182453.15254-1-ggherdovich@suse.cz> <20200531182453.15254-3-ggherdovich@suse.cz> In-Reply-To: <20200531182453.15254-3-ggherdovich@suse.cz> From: "Rafael J. Wysocki" Date: Wed, 3 Jun 2020 16:23:56 +0200 Message-ID: Subject: Re: [PATCH v2 2/3] x86, sched: Bail out of frequency invariance if turbo frequency is unknown To: Giovanni Gherdovich Cc: Srinivas Pandruvada , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Borislav Petkov , "Rafael J . Wysocki" , "the arch/x86 maintainers" , Linux PM , Linux Kernel Mailing List , Ricardo Neri Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 31, 2020 at 8:26 PM Giovanni Gherdovich wrote: > > There may be CPUs that support turbo boost but don't declare any turbo > ratio, i.e. their MSR_TURBO_RATIO_LIMIT is all zeroes. In that condition > scale-invariant calculations can't be performed. > > Signed-off-by: Giovanni Gherdovich > Suggested-by: Ricardo Neri > Fixes: 1567c3e3467c ("x86, sched: Add support for frequency invariance") Reviewed-by: Rafael J. Wysocki > --- > arch/x86/kernel/smpboot.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c > index d660966d7de7..fe154c8226ba 100644 > --- a/arch/x86/kernel/smpboot.c > +++ b/arch/x86/kernel/smpboot.c > @@ -2001,9 +2001,11 @@ static bool intel_set_max_freq_ratio(void) > /* > * Some hypervisors advertise X86_FEATURE_APERFMPERF > * but then fill all MSR's with zeroes. > + * Some CPUs have turbo boost but don't declare any turbo ratio > + * in MSR_TURBO_RATIO_LIMIT. > */ > - if (!base_freq) { > - pr_debug("Couldn't determine cpu base frequency, necessary for scale-invariant accounting.\n"); > + if (!base_freq || !turbo_freq) { > + pr_debug("Couldn't determine cpu base or turbo frequency, necessary for scale-invariant accounting.\n"); > return false; > } > > -- > 2.16.4 >