Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp11700rdg; Tue, 10 Oct 2023 02:44:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+2LQEL4NTUrV0rg/XrkUdEG/GZfqL156oIJYCmXJJe3PFLnry6+nrgbEGGFpY6GpaBWch X-Received: by 2002:a17:903:4284:b0:1c3:8679:6ed4 with SMTP id ju4-20020a170903428400b001c386796ed4mr16717472plb.8.1696931087860; Tue, 10 Oct 2023 02:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696931087; cv=none; d=google.com; s=arc-20160816; b=bIbBnxgdeZopX14zZnkfIP7SciLhzl91TK5d6Vjw1iKIO7o3nhIMdXr+TdvYt/iZsl 4POLotSA0EacZwDUkaHygleCu8Alqx/uibMkErF0w+VVyrYDGvMs6x0VCkywbZAJ2F7e U8ZOzSAtJfGisKfKXu00h09pewMtTaz7AZnpI6NcwktyDgcQFwFY03AORCF4jGbO5lve 2s9CO3C+1xTZfonU/UwEGOrlZ8I9oMqiMkk697FmI2cKgLioocbqdioY5S+d64jecchP McqnE7bV/jgoWTKijI5G2UAcmxQMPr6diGoDttuU/UwFhPQdvos7Jdb39pRJLgJ+AhE1 V4+g== 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=hyGfcz1FT6XDFHU1MwIubwjKxpqcfVPPlqtlsHiZTXQ=; fh=o1ePMzdH88uH7Weealx9Y2atC7sN2/G6Cp8iQg85ptI=; b=YbYXfO/tlAa/VuPL/UuRJU9OlWqsZbOuFdmcFPCTJsTXPgSOf4aPc4P6nTRKjzx0Oj 3Suzv25x0RWcxQizcDJ5C+x0/IPAyqOmK2+pfARVCT1IFyZ6DU+NAbvtzwyzfdzMrCZU VmGVOhUOSxGhzhMG1eQfSnHo5T19ExPs90yAb40Bz8aZv1mNjFZ4sXbRN82/+X/oUg2c P7iQ4FsNvJwsfqmlXnOWvo1u/S9i0VWUf/nEAsvj+whwQhf3H4eLu0YKBkJsqiWKxqZN +u2zXpjRUpLEWPQqLIUCtYfywjtE4s6+9Blj8IKkmfF5MNT4btsP+geZzHQ1Sh73e1FO qLlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TF78imSP; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=8AvPuH7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id jb18-20020a170903259200b001c5fc1f79f1si11051061plb.165.2023.10.10.02.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 02:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TF78imSP; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=8AvPuH7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 571E481489EB; Tue, 10 Oct 2023 02:44:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230423AbjJJJoC (ORCPT + 99 others); Tue, 10 Oct 2023 05:44:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbjJJJnw (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 C514B9F; Tue, 10 Oct 2023 02:43:49 -0700 (PDT) Date: Tue, 10 Oct 2023 09:43:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696931028; 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=hyGfcz1FT6XDFHU1MwIubwjKxpqcfVPPlqtlsHiZTXQ=; b=TF78imSPGto4mYm4Ga9+Tjsk3udIDbja++oHLlM8MQueu1t0E2iaqAOgl62VBXFik2NENg S9w/gqHwoJc0CQnBfolETDQbD/soQBO20s0xmpZ9q9Mi8CBdzSq44Y2ErRY/8ZJK7eBgkq 2PbqNelN14G0mL8JPKw5qIPikdJbL/OTF4gkQNarnER7gmL52mMiSYzDth6UA5Yp9Lz3+/ MCr3U1CP9eaVdXWaLjZ8o+z1XryGgQBkvGoEgkbXHrZ4gkxW7EFxqeFrCTAd/pqHTa22wj PencerVBahIXYy/1FfF6MpQEnMySUd1hgOYz2eeBEG1+1zxkzR96CkqZhmYa4Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696931028; 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=hyGfcz1FT6XDFHU1MwIubwjKxpqcfVPPlqtlsHiZTXQ=; b=8AvPuH7yEiBACGcpaRka20ra35j/6CrakMXcrQYq0YtLJQIXLEKHnZHvueo/9sa0fW73jQ ps5tdMtouZyWCrCA== From: "tip-bot2 for Raghavendra K T" 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: Move up the access pid reset logic Cc: Mel Gorman , Raghavendra K T , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231010083143.19593-5-mgorman@techsingularity.net> References: <20231010083143.19593-5-mgorman@techsingularity.net> MIME-Version: 1.0 Message-ID: <169693102782.3135.18020196809878344961.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 10 Oct 2023 02:44:42 -0700 (PDT) X-Spam-Level: ** The following commit has been merged into the sched/core branch of tip: Commit-ID: 2e2675db1906ac04809f5399bf1f5e30d56a6f3e Gitweb: https://git.kernel.org/tip/2e2675db1906ac04809f5399bf1f5e30d56a6f3e Author: Raghavendra K T AuthorDate: Tue, 10 Oct 2023 09:31:41 +01:00 Committer: Ingo Molnar CommitterDate: Tue, 10 Oct 2023 11:10:01 +02:00 sched/numa: Move up the access pid reset logic Recent NUMA hinting faulting activity is reset approximately every VMA_PID_RESET_PERIOD milliseconds. However, if the current task has not accessed a VMA then the reset check is missed and the reset is potentially deferred forever. Check if the PID activity information should be reset before checking if the current task recently trapped a NUMA hinting fault. [ mgorman@techsingularity.net: Rewrite changelog ] Suggested-by: Mel Gorman Signed-off-by: Raghavendra K T Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231010083143.19593-5-mgorman@techsingularity.net --- kernel/sched/fair.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 31cfdb0..ce36969 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3260,16 +3260,7 @@ static void task_numa_work(struct callback_head *work) continue; } - /* Do not scan the VMA if task has not accessed */ - if (!vma_is_accessed(vma)) { - trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_PID_INACTIVE); - continue; - } - - /* - * RESET access PIDs regularly for old VMAs. Resetting after checking - * vma for recent access to avoid clearing PID info before access.. - */ + /* RESET access PIDs regularly for old VMAs. */ if (mm->numa_scan_seq && time_after(jiffies, vma->numab_state->pids_active_reset)) { vma->numab_state->pids_active_reset = vma->numab_state->pids_active_reset + @@ -3278,6 +3269,12 @@ static void task_numa_work(struct callback_head *work) vma->numab_state->pids_active[1] = 0; } + /* Do not scan the VMA if task has not accessed */ + if (!vma_is_accessed(vma)) { + trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_PID_INACTIVE); + continue; + } + do { start = max(start, vma->vm_start); end = ALIGN(start + (pages << PAGE_SHIFT), HPAGE_SIZE);