Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp891289lqs; Fri, 14 Jun 2024 08:30:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGqDNI94gW4rjCoqEuImpAHlcMcYbqJIm0XpjRTcIzIkmOev0TAyx21RLzNnSvcOEVXCimpHw1ImffLr4pqRaWPrjJ6eLg+nue39/QyQ== X-Google-Smtp-Source: AGHT+IG9QFXUWLhc3yiKQfRFKFLGOdf4I9xUo461Ci8VV95Ui5URXK6ratQ/r5sZrAjvpoTMZsOD X-Received: by 2002:a17:90a:e68b:b0:2c2:dee2:ed41 with SMTP id 98e67ed59e1d1-2c4db242582mr3120930a91.19.1718379023796; Fri, 14 Jun 2024 08:30:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718379023; cv=pass; d=google.com; s=arc-20160816; b=izvLmCiNdx/9p01NuL6skoBrbMVhXl6yktDmEyBTzhLddvU5pX5OIHI7n4AGJbjDQR 7Iz6MZeTofL8Gnx1FVs32OsCOr2hKFCOONZ8p3X8wDWah3U20ciYrXERQkYjxrySx027 zthOatjnVKyfuZlN0WnoFnhCxH+mSTFlzXiB0OvAH5jdKOcZO/kMoQfYX69H0Rz7MGtR O9WZcskbuGJYG84+OEEyZKgkUZ2wqi9bO4sEi8VoUWmokbc8GDla8mWg/Y4yIegtBPNv KiFjTnjsZeA028i0R0JJSJTcQyu5KOFhRtiQwqKszWhIX/UbLPf/u5pc8NCusOyA1HUk dpww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=HNdV8nHRhmbPIijQfH95dBkdQ8ckskSSJNDHB2FQ0B0=; fh=ZzIMw8TvFOndukyZ2OYtyPajIHhdrLW0CERhi5Mu63Y=; b=m55EWlxAvG9t2T2XUpYQWnNZAw5KlorUjD8CfP9lOtTntozgmr0dyK+onJ5NLCrdWF 0/7kpvnr5GqOB42zRfTLOan75Xd8cIYckZXtq3UlrcKZWi5n4wYbNDsERnUbRLqIdEM7 itYgx40+NVv0s4dTI6GPAXElvxIUJjnbV7s+YIFH/AznU/NrtJ9ZwjIDXUv6cFmb+yKy uwHXaBZbzLNqPciHw7FcouFrQwPFLGEK0kK2ftFeA7blJ4vrM85TEuKdbnnIeyDuJpmx UW6d29Rcdefxm9akua8V7BfcImkvK4fY3fclno3lW0YKzhiAEGqV49JaNBkunnTsCBrQ gsXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-215098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4abc689ffsi5587569a91.125.2024.06.14.08.30.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 08:30:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-215098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 56FCB28B33E for ; Fri, 14 Jun 2024 15:07:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F27AC1AD9C0; Fri, 14 Jun 2024 15:02:51 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01352171E71 for ; Fri, 14 Jun 2024 15:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377371; cv=none; b=eMd2s1rkb6976udIiNy1wDLcbpTj90P28gLDcflLPwqp8NgP+89ekLwUJf+PZ0WbN7PLDxAyh6/BRtItoKXQSXDLX6PWZ/C0IMmeuoxOwjyBIbjU6A+EaybE3it9Z243Q6rudjweZ9G6vONUq1+K6/FnRTgfRUQgyl6cpblmHcQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718377371; c=relaxed/simple; bh=oO37+RxAUZpyz+pma2U3cUKIwbO7eqMEc944yfPAQ/w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oySdwcV7kzdfmEf16P/zfaHYLKOmETOop+y9jqev5Y+xeYVgZiQw8XntW/Npq1Hv26WjLduwD7zVC0CkdQgKqEoeR5gcIKsZ5D/NF7AxDRaBQ0xQ1hLRPLSNcYgon7Qqjw+W0sUmYD8W/8KFC98qo8rxZ9GDWh71vvI7ZxWKTJ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 01DA71BCB; Fri, 14 Jun 2024 08:03:14 -0700 (PDT) Received: from merodach.members.linode.com (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4886C3F5A1; Fri, 14 Jun 2024 08:02:46 -0700 (PDT) From: James Morse To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , James Morse , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie , Dave Martin , Shaopeng Tan Subject: [PATCH v3 30/38] x86/resctrl: Rename resctrl_sched_in() to begin with "resctrl_arch_" Date: Fri, 14 Jun 2024 15:00:25 +0000 Message-Id: <20240614150033.10454-31-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240614150033.10454-1-james.morse@arm.com> References: <20240614150033.10454-1-james.morse@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit resctrl_sched_in() loads the architecture specific CPU MSRs with the CLOSID and RMID values. This function was named before resctrl was split to have architecture specific code, and generic filesystem code. This function is obviously architecture specific, but does not begin with 'resctrl_arch_', making it the odd one out in the functions an architecture needs to support to enable resctrl. Rename it for consistency. This is purely cosmetic. Signed-off-by: James Morse Tested-by: Peter Newman Tested-by: Shaopeng Tan --- arch/x86/include/asm/resctrl.h | 4 ++-- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 12 ++++++------ arch/x86/kernel/process_32.c | 2 +- arch/x86/kernel/process_64.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/resctrl.h b/arch/x86/include/asm/resctrl.h index 9940398e367e..491342f56811 100644 --- a/arch/x86/include/asm/resctrl.h +++ b/arch/x86/include/asm/resctrl.h @@ -177,7 +177,7 @@ static inline bool resctrl_arch_match_rmid(struct task_struct *tsk, u32 ignored, return READ_ONCE(tsk->rmid) == rmid; } -static inline void resctrl_sched_in(struct task_struct *tsk) +static inline void resctrl_arch_sched_in(struct task_struct *tsk) { if (static_branch_likely(&rdt_enable_key)) __resctrl_sched_in(tsk); @@ -220,7 +220,7 @@ void resctrl_cpu_detect(struct cpuinfo_x86 *c); #else -static inline void resctrl_sched_in(struct task_struct *tsk) {} +static inline void resctrl_arch_sched_in(struct task_struct *tsk) {} static inline void resctrl_cpu_detect(struct cpuinfo_x86 *c) {} #endif /* CONFIG_X86_CPU_RESCTRL */ diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 74edf83a3eec..403118fdabd4 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -359,7 +359,7 @@ static int rdtgroup_cpus_show(struct kernfs_open_file *of, } /* - * This is safe against resctrl_sched_in() called from __switch_to() + * This is safe against resctrl_arch_sched_in() called from __switch_to() * because __switch_to() is executed with interrupts disabled. A local call * from update_closid_rmid() is protected against __switch_to() because * preemption is disabled. @@ -378,7 +378,7 @@ void resctrl_arch_sync_cpu_closid_rmid(void *info) * executing task might have its own closid selected. Just reuse * the context switch code. */ - resctrl_sched_in(current); + resctrl_arch_sched_in(current); } /* @@ -603,7 +603,7 @@ static void _update_task_closid_rmid(void *task) * Otherwise, the MSR is updated when the task is scheduled in. */ if (task == current) - resctrl_sched_in(task); + resctrl_arch_sched_in(task); } static void update_task_closid_rmid(struct task_struct *t) @@ -661,7 +661,7 @@ static int __rdtgroup_move_task(struct task_struct *tsk, * Ensure the task's closid and rmid are written before determining if * the task is current that will decide if it will be interrupted. * This pairs with the full barrier between the rq->curr update and - * resctrl_sched_in() during context switch. + * resctrl_arch_sched_in() during context switch. */ smp_mb(); @@ -2949,8 +2949,8 @@ static void rdt_move_group_tasks(struct rdtgroup *from, struct rdtgroup *to, /* * Order the closid/rmid stores above before the loads * in task_curr(). This pairs with the full barrier - * between the rq->curr update and resctrl_sched_in() - * during context switch. + * between the rq->curr update and + * resctrl_arch_sched_in() during context switch. */ smp_mb(); diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 0917c7f25720..8697b02dabf1 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -211,7 +211,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) switch_fpu_finish(next_p); /* Load the Intel cache allocation PQR MSR. */ - resctrl_sched_in(next_p); + resctrl_arch_sched_in(next_p); return prev_p; } diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 6d3d20e3e43a..162b11b824ee 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -707,7 +707,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) } /* Load the Intel cache allocation PQR MSR. */ - resctrl_sched_in(next_p); + resctrl_arch_sched_in(next_p); return prev_p; } -- 2.39.2