From patchwork Tue Oct 10 08:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 13415002 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 E9FCBCD6907 for ; Tue, 10 Oct 2023 08:32:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4FE488D00B1; Tue, 10 Oct 2023 04:32:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4AE9F8D006D; Tue, 10 Oct 2023 04:32:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C4558D00B1; Tue, 10 Oct 2023 04:32:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2C8CA8D006D for ; Tue, 10 Oct 2023 04:32:00 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EC908C0245 for ; Tue, 10 Oct 2023 08:31:59 +0000 (UTC) X-FDA: 81328883958.20.3BFE5C9 Received: from outbound-smtp51.blacknight.com (outbound-smtp51.blacknight.com [46.22.136.235]) by imf22.hostedemail.com (Postfix) with ESMTP id 49937C002A for ; Tue, 10 Oct 2023 08:31:57 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.235 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696926718; 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:references; bh=i5pPcZWRZrkhkLlpL/Eo8+8AMVAViP+sJY8nQxpaP8A=; b=DjwiWCaoaILBo9P2ZRGEABV1P5JrbT6GVv2g0vyTXqxYa+OW1PgAeQmSPZpiUOPXbHsZmD fwRdePvQAS0FJm9pVN9Xt8T/U9n2n2K3Dh7JgVJLEuLPg81/UQscJmo1aHzpBxMS1qveqw MQ9gWnKdpW9QAEfj2ndKKoRDi8BWpb0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696926718; a=rsa-sha256; cv=none; b=HH7bYoxKqEANWwoYzEEmRYTCCtZScRcSJzc8Mw8jKzsFFHowABhXGb7g+YTQvLFQ6fCOgB yh32j0MZPvu4WeKHbF5qH4NouCmGTVRg0dkOtcdsroeg07r5C0YXoJmn/Jg7oTL98tiyYv He0msnclJ+jxJG+NFdriU7Q7//FjX08= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.235 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp51.blacknight.com (Postfix) with ESMTPS id 413BAFABDD for ; Tue, 10 Oct 2023 09:31:55 +0100 (IST) Received: (qmail 6476 invoked from network); 10 Oct 2023 08:31:55 -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:31:55 -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 0/6] sched/numa: Complete scanning of partial and inactive VMAs Date: Tue, 10 Oct 2023 09:31:37 +0100 Message-Id: <20231010083143.19593-1-mgorman@techsingularity.net> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Stat-Signature: pf4jfs64sxfhzcisbnjwukp8qesawmh8 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 49937C002A X-Rspam-User: X-HE-Tag: 1696926717-274748 X-HE-Meta: U2FsdGVkX18hUejnwsMjNa4IURaoHboh+y5T+KuFkVmlYYHf8UjMrchUjD0i2C4Q4uZV8ZZcb0+z2jZzDbAuORPUxOoPoDp8Lebs40D4g8CQUY0OrVBpHU44LTFgI83M1KnG3zDchpyE+ouX/JkW2mcifdWOMRyl1EyJ9QNvJzU4ChZ4TRnkOdpSDd3bhhLWsSa67tytsbRLmgLRGPtBOx2hIfCJJtFiYSXq6hykY03emSJOdmrdJvbcy3q1tgw66w5u8COfZ2A1zu+dRpZkfFN5I9lgIbdO68hG6KTTAzNk0TvdirgI+I1gnVikpftAhpEIzPEbTvaJaTz87F8mg9RO28tLoYISIPPUXaNsk+fcN+2xS3hdLdFe6MCqZb/wC+U4hFFiqIvzOihsFHL4e7GQXb46AZgnFph7EofQHBv0LMd9Yyga6oOllTjXL+fhZdEMzYKWeolAPMpJ3Oa/aCr3rqmM76H1Sa4BIKQiTdo83f5jzNvmT7Q+1maW2P03PdXaHgmhvQM+WkTpqKYXMfBQL2P3Swv8WFtUEh9bS0G/u8KPI04BS0yiIJfEjFkms3YWgiX2u7MQhNkVAJbDRASof+YTLbQB4218gazHgoL8ls7nfOz/Q0ah5I/A4yrNkHjp8LilpgJFoS/Tjcbox3K7SHDDtGmmLnAfd5B2EV6lxxDwkxDjNAcFwgkvhmylmqFF7pEqFjf37ayG8SRdMo/pf9HKXo/34vIj/2XcvIaRKoUYbXY5y3Lj1XGnFt9q3LAUEkvi+hfRTdCmxjFJyTDM36TDMITyVvYSmpfrUhamElmBF/8+Q43ZMK1BlyW2znMDdDssV+AMdXMMTMVQXxPPQCWHmFx9/K9zXhY5yU55/XwZI8ONkd7r4mryrWzLvj2Fb41lsXl67wXK8MRO/5ibquzI7y5Zb7KP0VnfNAx217q4WuNwk0i0RZQpjDeBFher8014yAjRP4SqKNZ 9b0vgsX4 pcnvYnv8WSqHhjJm0EYBskksIM1BrOPKuHLFptwyDEf/1qsXYqMpxrDoHvlHNVoZjiU5UKb92UDot2ioFRK+mWqIGJSr3WNw4W4m/FCvRdXM7AgwdIj7xZ231HjmF3Bd07O02k0vJQ7sGNsctH1fghpYHPaPy1iDBZpus 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: NUMA Balancing currently uses PID fault activity within a VMA to determine if it is worth updating PTEs to trap NUMA hinting faults. While this is reduces overhead, it misses two important corner case. The first is that if Task A partially scans a VMA that is active and Task B resumes the scan but is inactive, then the remainder of the VMA may be missed. Similarly, if a VMA is inactive for a period of time then it may never be scanned again. Patches 1-3 improve the documentation of the current per-VMA tracking and adds a trace point for scan activity. Patch 4 addresses a corner case where the PID activity information may not be reset after the expected timeout. Patches 5-6 complete the scanning of partial and inactive VMAs within the scan sequence. This could be improved further but it would deserve a separate series on top with supporting data justifying the change. Otherwise and gain/loss due to the additional changes could be masked by this series on its own. include/linux/mm.h | 4 +- include/linux/mm_types.h | 36 +++++++++- include/linux/sched/numa_balancing.h | 10 +++ include/trace/events/sched.h | 52 ++++++++++++++ kernel/sched/fair.c | 103 ++++++++++++++++++++++----- 5 files changed, 182 insertions(+), 23 deletions(-)