Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2371005rdb; Tue, 10 Oct 2023 01:41:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQqCUJ5ZfeAIlSE8zIqbg88yFzZXUNrRmJkkKtcXeugrY8onNEFGznV/6hqN5g6eg+6j6I X-Received: by 2002:a05:6808:15a6:b0:3ae:4ca9:cae5 with SMTP id t38-20020a05680815a600b003ae4ca9cae5mr23868552oiw.21.1696927317466; Tue, 10 Oct 2023 01:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696927317; cv=none; d=google.com; s=arc-20160816; b=bkHj2kzWBJ0p+SIQqonLLpnz3FodiDKMnGGzVeT2kd+WN/blJupF3Sr0wqEWUcWTkW f6ejM595q6a5FWl07zsuHGglXAppbMuP/Q25VDNiFFKQ0S8OJ5HW1QbzhbKVOs2eVOb5 P/OFWwBlv9wYfjQjxJ41wI24C6yRljmAVJexOcvmf2YaGZarUDKLTPxkiwLkNLChdGPv WcSGCQ67Mq0laTbO6VxduAvBpKhgOHBjDN2vXsZ0UZF2WQiMs9GzeIDisaBuWw2QK98x Xucy17sTo6jU3jUeZpaWFDMv6nJhn73tdkyDLE4ViYtCr3OIN4/ARhCVDTACC9b72WB/ MDKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=AAlUBhuNKD0u39aeIbIiGdWDWTiKU1OPrVZCZfsLzJQ=; fh=WshF3VFuVECdjenMt2c/ihelCL0sRuHaGFWYsZpetzM=; b=BOCuSigNlljSPUKENG7kgsg/ZLuA0r+TQ88YGS8EsOQdiYIQJGjdfCmpvvFsplDEjQ L8/pW+HrEoDBJSdqjBS70yQXo/wZJubIe9wetu7FUa0Q6OKG24SXmHAtSN8dPKKo+M71 b4PJMC0ArjWjV2tVRA0TNtSJgmLFp+GIOpW/H1bV2YBDRxtHFX5K2k/O1dA/Wjz5BWTt soChtYsBnzAQ6P6neWHsS3r9XQzVKycSp5KM26hgNwymj0Kh18FOwaLQJTEccNAQ5GwF t0HqjPF3ohhTR/EDstVSW99PeIiDYVRWIo3qprFtfkqgWnobW8eV8GnH2ScfWrLTyMf0 eoQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id l71-20020a63914a000000b00584b293d17fsi10937121pge.550.2023.10.10.01.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 01:41:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 01A9282DDAF1; Tue, 10 Oct 2023 01:41:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229892AbjJJIlp (ORCPT + 99 others); Tue, 10 Oct 2023 04:41:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbjJJIlm (ORCPT ); Tue, 10 Oct 2023 04:41:42 -0400 X-Greylist: delayed 563 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 10 Oct 2023 01:41:40 PDT Received: from outbound-smtp02.blacknight.com (outbound-smtp02.blacknight.com [81.17.249.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA374AF for ; Tue, 10 Oct 2023 01:41:40 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp02.blacknight.com (Postfix) with ESMTPS id E67D7BADA5 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 01:41:53 -0700 (PDT) X-Spam-Level: ** 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 { -- 2.35.3