Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3154099rwl; Mon, 27 Mar 2023 09:56:58 -0700 (PDT) X-Google-Smtp-Source: AKy350b+Avb/UTBgwV149rWkLq0PyboSgPn3G0SlcxeuqtzdSaP0XNI0fGu3MiKeGPBz8mVQNAOC X-Received: by 2002:aa7:c989:0:b0:502:243b:26f8 with SMTP id c9-20020aa7c989000000b00502243b26f8mr11127376edt.8.1679936218114; Mon, 27 Mar 2023 09:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679936218; cv=none; d=google.com; s=arc-20160816; b=kyVWVM2bPi7SvVgfZlmsrf1aH5wvPndxlE66aIN0a7+Cy0timLG1X4T0CrLhhpmPND yz9IXu5V7oDtmdcK6YPdGE9TA6D1sC1/KtrvPfjkvql57BTmudOGI9NY1hIq+0a9QHr3 bxTwq67A5zZANDX77Lab/mR1sE0vkgT3J5DQKcMNyA7nlelZnxCnlkGYFiyUyp/Q1vVa cMM768JwB9p7qC4eOOOOToJX4amyIuHa9hj/z581t2SBdw0HnJ2S2UY0fzgrck9n4GIO GV83eOIstqwcxPi6ct47vL3Jd6PYCNZlqP/u4hcdy4pzYs27Z8hYwyLYUN3vH9kpBaL6 LLjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=ouTvXdhuudhsI6QnRnOIxDZdvVVR8eQIc6ze2xnZ674=; b=UqBc0H/PPbAJfSn2dileuNHZVYP3w3zg2gY2JeK2XOCtLvZtVahGi4sxwXgwd9f+vd BYEszgf24OwMY/yLVQuUi3B/vL5H4+oo8B9r2tZn2B2U7KbwEh4IakxFzvZ5vtkDoIuv AFowRwSLOtPnd2Yx6bTt8rR7XBHTy8MiGiZiiCbitAZu7R+uaF/wKGnIYAWHv3hEIRdO s2mxW3VeOyUe+I+a0CeaL8TPZV03gSdjRG1nQoIybydtRvPGYtHf0XVIdBxNvHl9m5RX 04EOvjPIh5Yk1xGeT8MpMVyXqnfQcKWLpi+EtFG7sei9n42NGAx+MUExU+05gYawaH3Z nf/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020aa7ca42000000b005002af128dfsi29012758edt.100.2023.03.27.09.56.33; Mon, 27 Mar 2023 09:56:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232658AbjC0QwP convert rfc822-to-8bit (ORCPT + 99 others); Mon, 27 Mar 2023 12:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232614AbjC0QwK (ORCPT ); Mon, 27 Mar 2023 12:52:10 -0400 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95A283C02; Mon, 27 Mar 2023 09:51:51 -0700 (PDT) Received: by mail-ed1-f48.google.com with SMTP id ek18so38884652edb.6; Mon, 27 Mar 2023 09:51:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679935905; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/i7oFEe73tySQfhnZAAorku18WfFptPAQV/pDmjOVSA=; b=Fw1OP8nPDOvU3Uh2TIPIvrqzuYNqgyF0KUjpvPaDM5dElhtpZjHCYMztzcNSyMe2ht FKfCbZa0u4zjLSwnZShBA+hgMgYlXhbB3X7qn+7C45BSNmIFY55aI7Jd2GDdhMqsUZBq kMnQoKsPpjOB2PV+ZB+eMWEJWTPbl2uZUDq3DgeEkUligHcW2psknA8EGkxHr3PcVBC/ 8HXw6uEyfPcwoLDUOX/BMl+WhdnvtfttgQvVOgutQLHcrVbKv7USBpFvHbbYU+NaFKuF A4LzVY+BS9iwxwbMUGly5WZ1GIL3CKVZrdICER+rh0Ws6L5+q2w3cj14BLdezEm41pP+ RCIQ== X-Gm-Message-State: AAQBX9epi9OuMITiRX27rU5vYjcxwYLj9T+Ej8Q5a5dabEuBB3xFW7GK 1qx3oBIbGqilpgnHcZfYEAkmoP44S3eE+NwuAjI= X-Received: by 2002:a17:907:d02:b0:931:6921:bdbb with SMTP id gn2-20020a1709070d0200b009316921bdbbmr5845969ejc.2.1679935904807; Mon, 27 Mar 2023 09:51:44 -0700 (PDT) MIME-Version: 1.0 References: <20230207051105.11575-1-ricardo.neri-calderon@linux.intel.com> <20230207051105.11575-17-ricardo.neri-calderon@linux.intel.com> In-Reply-To: <20230207051105.11575-17-ricardo.neri-calderon@linux.intel.com> From: "Rafael J. Wysocki" Date: Mon, 27 Mar 2023 18:51:33 +0200 Message-ID: Subject: Re: [PATCH v3 16/24] thermal: intel: hfi: Define a default class for unclassified tasks To: Ricardo Neri Cc: "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , Lukasz Luba , Ionela Voinescu , x86@kernel.org, "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "Tim C . Chen" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 7, 2023 at 6:02 AM Ricardo Neri wrote: > > A task may be unclassified if it has been recently created, spend most of > its lifetime sleeping, or hardware has not provided a classification. > > Most tasks will be eventually classified as scheduler's IPC class 1 > (HFI class 0). This class corresponds to the capabilities in the legacy, > classless, HFI table. > > IPC class 1 is a reasonable choice until hardware provides an actual > classification. Meanwhile, the scheduler will place classes of tasks with > higher IPC scores on higher-performance CPUs. > > Cc: Ben Segall > Cc: Daniel Bristot de Oliveira > Cc: Dietmar Eggemann > Cc: Ionela Voinescu > Cc: Joel Fernandes (Google) > Cc: Len Brown > Cc: Lukasz Luba > Cc: Mel Gorman > Cc: Rafael J. Wysocki > Cc: Srinivas Pandruvada > Cc: Steven Rostedt > Cc: Tim C. Chen > Cc: Valentin Schneider > Cc: x86@kernel.org > Cc: linux-pm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Ricardo Neri Fine with me, so Acked-by: Rafael J. Wysocki > --- > Changes since v2: > * None > > Changes since v1: > * Now the default class is 1. > --- > drivers/thermal/intel/intel_hfi.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c > index fa9b4a678d92..7ea6acce7107 100644 > --- a/drivers/thermal/intel/intel_hfi.c > +++ b/drivers/thermal/intel/intel_hfi.c > @@ -185,6 +185,19 @@ static struct workqueue_struct *hfi_updates_wq; > #ifdef CONFIG_IPC_CLASSES > static int __percpu *hfi_ipcc_scores; > > +/* > + * A task may be unclassified if it has been recently created, spend most of > + * its lifetime sleeping, or hardware has not provided a classification. > + * > + * Most tasks will be classified as scheduler's IPC class 1 (HFI class 0) > + * eventually. Meanwhile, the scheduler will place classes of tasks with higher > + * IPC scores on higher-performance CPUs. > + * > + * IPC class 1 is a reasonable choice. It matches the performance capability > + * of the legacy, classless, HFI table. > + */ > +#define HFI_UNCLASSIFIED_DEFAULT 1 > + > void intel_hfi_update_ipcc(struct task_struct *curr) > { > union hfi_thread_feedback_char_msr msr; > @@ -215,7 +228,7 @@ unsigned long intel_hfi_get_ipcc_score(unsigned short ipcc, int cpu) > return -EINVAL; > > if (ipcc == IPC_CLASS_UNCLASSIFIED) > - return -EINVAL; > + ipcc = HFI_UNCLASSIFIED_DEFAULT; > > /* > * Scheduler IPC classes start at 1. HFI classes start at 0. > -- > 2.25.1 >