From patchwork Tue Oct 10 08:31:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 13415004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A61B2CD68FE for ; Tue, 10 Oct 2023 08:32:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4630E8D00B3; Tue, 10 Oct 2023 04:32:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 412628D006D; Tue, 10 Oct 2023 04:32:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 301508D00B3; Tue, 10 Oct 2023 04:32:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 224338D006D for ; Tue, 10 Oct 2023 04:32:20 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D85B616023F for ; Tue, 10 Oct 2023 08:32:19 +0000 (UTC) X-FDA: 81328884798.07.514669A Received: from outbound-smtp02.blacknight.com (outbound-smtp02.blacknight.com [81.17.249.8]) by imf28.hostedemail.com (Postfix) with ESMTP id E96B0C000F for ; Tue, 10 Oct 2023 08:32:17 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf28.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.8 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696926738; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AAlUBhuNKD0u39aeIbIiGdWDWTiKU1OPrVZCZfsLzJQ=; b=nzqhh8GoOO5iOB8sPSZnaPyitWKmTgydoFgjUf6vhXDI3Yl4LRO0F9mH/Eg0yGq+1dBiFG L0KZ96COR+59yytDXG6e6VAoyMxv63oopdav3qQkm3eN3C2nOZpOFonDfCM2rzUdbRemQM Ie7YFVmOb+WnFxurkPYE2Dj+2Jv+h9o= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf28.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.8 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696926738; a=rsa-sha256; cv=none; b=hj3DfXnx8wl+1vvcdeWVQQl8Kf0mrKD6dIhJl2j8QZ4IRPJ1OHSx+diYRLiMTUk6NUimoW axC9HFmBMCkEJ8SaZY4W46RnqcjSwX/faCcX915AZ9FAXCm4RNXbJkf/DqMlQjFcvNo3fE 1ytxfgqD9hDe9G/gV7Pzrg7tPGVg5cw= Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp02.blacknight.com (Postfix) with ESMTPS id E50FABAD71 for ; Tue, 10 Oct 2023 09:32:15 +0100 (IST) Received: (qmail 7586 invoked from network); 10 Oct 2023 08:32:15 -0000 Received: from unknown (HELO morpheus.112glenside.lan) (mgorman@techsingularity.net@[84.203.197.19]) by 81.17.254.9 with ESMTPA; 10 Oct 2023 08:32:15 -0000 From: Mel Gorman To: Peter Zijlstra Cc: Raghavendra K T , K Prateek Nayak , Bharata B Rao , Ingo Molnar , LKML , Linux-MM , Mel Gorman Subject: [PATCH 2/6] sched/numa: Rename vma_numab_state.access_pids Date: Tue, 10 Oct 2023 09:31:39 +0100 Message-Id: <20231010083143.19593-3-mgorman@techsingularity.net> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20231010083143.19593-1-mgorman@techsingularity.net> References: <20231010083143.19593-1-mgorman@techsingularity.net> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: E96B0C000F X-Stat-Signature: ju16du7t5ohy9d7n8sdwmewhowyh3ugz X-Rspam-User: X-HE-Tag: 1696926737-574184 X-HE-Meta: U2FsdGVkX18oP+QixSV3dLbrCJut+Awxo6rABuk968ElRndFw69OF4JoRnN733GzAYBk0lbtIGMiHloH0gOuzeBbESsSifYihc6b0GJcWmsa5E3c9fMrjZCQbwrg5aX/sIu93xn0pb8v+/IxL+BIKAUbcC/3OTcZgdTla/AehUuQ8c44wVGHUuq6TSBfm5Fv1eEtebMp+CXZTx9Sd7GRaJ9R6yZROE8y4bg8vr1SOPEOPjypGc2RzyT1+v2O2L6uSskVm1/Mx3SGnxZUtXkbehNrkTtdk6/clu76Fl+WHMeUth1TLKvQHNVWnmYTlccKC2dLHPqM7AHqrS81I/xEnURQ6cXNaGRvxmjUWPznWEpJubdt7VnTQUwczFTQ7kCcaiB9Nx0LN3orr3teqZGxfxkdIxbWmKRzvB8Tseh5RQdpIdhxvTIM4D+2/26znrhv1abnWO8mdmc6hMvEqQn4BnHGRf7U44jGxKwSUsBSz0JoadCtXweD8o6cLL+Lo4qjLZPqI9AA0B9ohijF59Z64FosdIeqxtaj7kKrDWm2XrCGHecvZ2B4VnHJyE6eirQydfFvw0xBalDAHJlVslZ9VuK6PugshK8pW2pBZglHEV8YTSwuxJauUpw4OkHXELc2gjnQhAc6DyGJO1Hzm6P9tMjQKynnyUpZSou4Dei4kU+zIMKEfcQvGcdVGFvgN5AfOAJqMBEOuVGQ2t/BAWaFHFp7VvwMH7GKcaFQrpW5kazZIyh/Ry14gBJXHVItGQt8wx+WxNxbcaLdW94ouXpl7jt7SVsK5mqw4XA6FzRKal9jHyaO3MuNepPAjnoCmEgcta1/KV/461Z2dcojz5qxdleaPTPvwEiE2ZbYO8QGYYFJCVrtzYSKApSN09Dkfb4Xq0pG4kluNYt76/tYau2fjXcJtyuUem0lpaVMNEaQj8q8TmzK7FcvMDOXrFadojaaXeERI7Hca0agmUJdviT bAHK8TEi h0X3Fi9LkeDdmBKKwgxaWzS0b2t8Fm8LZA7rL4f4JQcMyTJTqP5CxiYo4LQSVpndy5f7Jk4CrInEvMLTCv9AMvuBYYfxNU946jF0fu3h5TZwyD0AeHvQFPGNwECE7M3pKm9nSutllYM6SsqVxMB/l35+NoLa0hVUc4K/HY1Zfn53xnL8ctcuhGk6L3L7YHCpaMfUGczV/vxqtjQyqWcdOyM9w0YOFjufkMi3uZqhb2fu2lElhQFedWOAeCNSSU+IFKDPnugw/XGVEtNc= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. Signed-off-by: Mel Gorman --- include/linux/mm.h | 4 ++-- include/linux/mm_types.h | 4 ++-- kernel/sched/fair.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index bf5d0b1b16f4..19fc73b02c9f 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 0fe054afc4d6..8cb1dec3e358 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -558,12 +558,12 @@ struct vma_numab_state { * least * sysctl_numa_balancing_scan_delay */ - unsigned long next_pid_reset; /* Time in jiffies when + unsigned long pids_active_reset; /* Time in jiffies when * access_pids is reset to * detect phase change * behaviour. */ - unsigned long access_pids[2]; /* Approximate tracking of PIDS + unsigned long pids_active[2]; /* Approximate tracking of PIDS * that trapped a NUMA hinting * fault. May produce false * positives due to hash diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index cb225921bbca..81405627b9ed 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3142,7 +3142,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); } @@ -3258,7 +3258,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); } @@ -3279,11 +3279,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 {