From patchwork Tue Oct 10 09:43:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 150626 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp73592vqb; Tue, 10 Oct 2023 02:44:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeq9PwzujlpfAkQ/cgs58TLlWgfugp7311nJt0FC8U63MeY0lM3iK53jLBxC6APAFZx91y X-Received: by 2002:a17:902:e54b:b0:1c3:b268:ecba with SMTP id n11-20020a170902e54b00b001c3b268ecbamr20309140plf.18.1696931089990; Tue, 10 Oct 2023 02:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696931089; cv=none; d=google.com; s=arc-20160816; b=VLHPlZ4DkgxJaJKD7Tf1R7zRRnuqyiLpUZfqlhT6dgJfPQuIe/AzfZEsBBaWVuTZFt dWu0VpXVQjqocoIfFX9iPws9oxifmVYPvW99LFIRMsLenp7lsinVZz3Ak8tIbVFCpS2f Y2PtKgxU/EqdpW/LVyteoojSUZic9IwXVoSuaGBTcbkLq+kdQPBbKc81c99JbVWzPV2A nJw1opx+i0782S6MbzkYijIejjjK8DOfOuRbfGI4tKE7hOt49lXJJ61Rh3idSHlbE6Fg 4GD/G6oQCOeJczF1/KxBj5xOpgf/iB7oEgwtHB9UPrJosDzXLVKU2jiLeLNPecjnL6wQ jruQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=iyvEi/UnAEHOtb09vPDToguMbxB7zsoDMoxkBd3H05I=; fh=0w6Vam4lb7+bNb4+Wi4lbXT97sHnsEC1gsMHHofWe9o=; b=KdKg6mAttNTvy8HDtUnP/d8c+arMtK4Pg0c1UnKa9Tgn4Br3GXVe/WBoxajaWJEELE ejIN6LwubkUS2HcJy/5m4SkXGVhklpJ+KhvRnSMi8iqcjD4AcKgnbHJOTP+pw8w5KJUW Y4Oi/Y6mi+s/dSqI5qo0ZjzJyf3RU9krCaRSwrKh36aly6WPjH87N7ybX0zPHK2jkPR9 yK2RCKhvSEZ24yQOdvTF+WQq/YIH2Hp8eWzzsz2SDDp1RCxB8wzH6pTgr8NuihRE3J5Y tSspwzOm+LcwP7+JhTo0QG8SOnXDhJpP94TV1wmIYZszeTU3pqXfUOaoUFBJfImrtMnF Hs7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FF5s2ajC; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id p5-20020a170902e74500b001c1f373ea07si1624535plf.351.2023.10.10.02.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 02:44:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FF5s2ajC; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 899108022EA4; Tue, 10 Oct 2023 02:44:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbjJJJoK (ORCPT + 20 others); Tue, 10 Oct 2023 05:44:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbjJJJnw (ORCPT ); Tue, 10 Oct 2023 05:43:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 005A1A7; Tue, 10 Oct 2023 02:43:50 -0700 (PDT) Date: Tue, 10 Oct 2023 09:43:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696931029; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iyvEi/UnAEHOtb09vPDToguMbxB7zsoDMoxkBd3H05I=; b=FF5s2ajC+4Yr74T0IpqzYZHFZ7wXpDUuwb4mgVF/QW8U3kBTPfvyOS6oQyzp3Q87e5B7Od q+8t+q+caoI7TCMhJFxyRYY2uW6uEaVza3TqQ1lVwOyiGQVBhy35r942nrBSVZLZXpfx4Z k9FA/LJ6Pfi0RvmgD9SI5nSCPz45763/HvJzD+h4dH9uXdbmDiMV+8UC3dG1ryH6dOLWtY 4tULzcB0cxpuyDtwqNBvgIRsZ/qU/QFksNmE0EOlI50NmmWCJYPr8GHuJoF/Qubc01BeqY 824pO3zZ3d8JfCOW+Eb1PK4XHLYPi1yYRwgdGkBSEJnkRZCr305KF8VWCk6oeQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696931029; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iyvEi/UnAEHOtb09vPDToguMbxB7zsoDMoxkBd3H05I=; b=g99sw+KgSRDeNrENDbd0lI+erYPbt1xcTXrjKv4n2jHNQfyoDrUnh63K/gWTSYcrN+hfr3 WoxviWmh8uI5aMCQ== From: "tip-bot2 for Mel Gorman" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/numa: Rename vma_numab_state::access_pids[] => ::pids_active[], ::next_pid_reset => ::pids_active_reset Cc: Mel Gorman , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231010083143.19593-3-mgorman@techsingularity.net> References: <20231010083143.19593-3-mgorman@techsingularity.net> MIME-Version: 1.0 Message-ID: <169693102905.3135.18177490895667484755.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 02:44:39 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779361214769829959 X-GMAIL-MSGID: 1779361214769829959 The following commit has been merged into the sched/core branch of tip: Commit-ID: f3a6c97940fbd25d6c84c2d5642338fc99a9b35b Gitweb: https://git.kernel.org/tip/f3a6c97940fbd25d6c84c2d5642338fc99a9b35b Author: Mel Gorman AuthorDate: Tue, 10 Oct 2023 09:31:39 +01:00 Committer: Ingo Molnar CommitterDate: Tue, 10 Oct 2023 11:10:00 +02:00 sched/numa: Rename vma_numab_state::access_pids[] => ::pids_active[], ::next_pid_reset => ::pids_active_reset The access_pids[] field name is somewhat ambiguous as no PIDs are accessed. Similarly, it's not clear that next_pid_reset is related to access_pids[]. Rename the fields to more accurately reflect their purpose. [ mingo: Rename in the comments too. ] Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231010083143.19593-3-mgorman@techsingularity.net --- include/linux/mm.h | 4 ++-- include/linux/mm_types.h | 6 +++--- kernel/sched/fair.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index bf5d0b1..19fc73b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1726,8 +1726,8 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) unsigned int pid_bit; pid_bit = hash_32(current->pid, ilog2(BITS_PER_LONG)); - if (vma->numab_state && !test_bit(pid_bit, &vma->numab_state->access_pids[1])) { - __set_bit(pid_bit, &vma->numab_state->access_pids[1]); + if (vma->numab_state && !test_bit(pid_bit, &vma->numab_state->pids_active[1])) { + __set_bit(pid_bit, &vma->numab_state->pids_active[1]); } } #else /* !CONFIG_NUMA_BALANCING */ diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index d7f042e..e7571ec 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -559,10 +559,10 @@ struct vma_numab_state { unsigned long next_scan; /* - * Time in jiffies when access_pids[] is reset to + * Time in jiffies when pids_active[] is reset to * detect phase change behaviour: */ - unsigned long next_pid_reset; + unsigned long pids_active_reset; /* * Approximate tracking of PIDs that trapped a NUMA hinting @@ -574,7 +574,7 @@ struct vma_numab_state { * Window moves after next_pid_reset has expired approximately * every VMA_PID_RESET_PERIOD jiffies: */ - unsigned long access_pids[2]; + unsigned long pids_active[2]; }; /* diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e7c1baf..6b47edc 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3125,7 +3125,7 @@ static bool vma_is_accessed(struct vm_area_struct *vma) if (READ_ONCE(current->mm->numa_scan_seq) < 2) return true; - pids = vma->numab_state->access_pids[0] | vma->numab_state->access_pids[1]; + pids = vma->numab_state->pids_active[0] | vma->numab_state->pids_active[1]; return test_bit(hash_32(current->pid, ilog2(BITS_PER_LONG)), &pids); } @@ -3241,7 +3241,7 @@ static void task_numa_work(struct callback_head *work) msecs_to_jiffies(sysctl_numa_balancing_scan_delay); /* Reset happens after 4 times scan delay of scan start */ - vma->numab_state->next_pid_reset = vma->numab_state->next_scan + + vma->numab_state->pids_active_reset = vma->numab_state->next_scan + msecs_to_jiffies(VMA_PID_RESET_PERIOD); } @@ -3262,11 +3262,11 @@ static void task_numa_work(struct callback_head *work) * vma for recent access to avoid clearing PID info before access.. */ if (mm->numa_scan_seq && - time_after(jiffies, vma->numab_state->next_pid_reset)) { - vma->numab_state->next_pid_reset = vma->numab_state->next_pid_reset + + time_after(jiffies, vma->numab_state->pids_active_reset)) { + vma->numab_state->pids_active_reset = vma->numab_state->pids_active_reset + msecs_to_jiffies(VMA_PID_RESET_PERIOD); - vma->numab_state->access_pids[0] = READ_ONCE(vma->numab_state->access_pids[1]); - vma->numab_state->access_pids[1] = 0; + vma->numab_state->pids_active[0] = READ_ONCE(vma->numab_state->pids_active[1]); + vma->numab_state->pids_active[1] = 0; } do {