From patchwork Tue Aug 29 06:06:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra K T X-Patchwork-Id: 13368614 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 3AFDCC71153 for ; Tue, 29 Aug 2023 06:07:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A3D9280032; Tue, 29 Aug 2023 02:07:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 754268E001E; Tue, 29 Aug 2023 02:07:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F4AA280032; Tue, 29 Aug 2023 02:07:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 502638E001E for ; Tue, 29 Aug 2023 02:07:36 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 14966C0584 for ; Tue, 29 Aug 2023 06:07:36 +0000 (UTC) X-FDA: 81176110512.29.DA5720F Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2080.outbound.protection.outlook.com [40.107.101.80]) by imf28.hostedemail.com (Postfix) with ESMTP id 01321C0012 for ; Tue, 29 Aug 2023 06:07:32 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=3mGiw0ZX; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of Raghavendra.KodsaraThimmappa@amd.com designates 40.107.101.80 as permitted sender) smtp.mailfrom=Raghavendra.KodsaraThimmappa@amd.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693289253; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RNKcjTamJ6O4ps8dbHURIi8t9orAhAQlAyfobLURR6E=; b=n/0iV4qze7+GuXssKGiJCn1T2yqhW/lHWlybjv7aKKaBP8WMscaSUcjnu36rlc/CvacGoy FeT5FDWM8yoHYcZWOdsTxzgE5sIuSZfbajjBiFK3u1/dShqzypm2y6DLWFxAHi9WdThiIZ hj2H1rFV3kqEBy8WGaNVE8xvCZVrRvQ= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=3mGiw0ZX; dmarc=pass (policy=quarantine) header.from=amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of Raghavendra.KodsaraThimmappa@amd.com designates 40.107.101.80 as permitted sender) smtp.mailfrom=Raghavendra.KodsaraThimmappa@amd.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1693289253; a=rsa-sha256; cv=pass; b=1kJI95ViJSnXFdealrA4a4vLkdQDeYutPSZqcW2GbCiZ2p04E+34yK6EcUCAzEEwJud/AB iZcXCXX1n8C6Jfp94K5HUqYIEx1xKfO0MxiApiywGva0RAzMC/rEc+Je6D0ucReiN7w2Ti oNhemCEFV2l4sRPHuRd7vDeT/9BzHMI= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F1kiLtsi4Z1kYvfFbAVgY9f7V4ZyIU3WE+ATfG8Uj8NvknrOjLRMkP8IsgY7Xa8amYPzzBGaZHB6/K8IGhidf5RzrcyBiw4hqP7dvgxhGpj1ihkOIEyE9uxHOoF9vrZttKpAHZQ4V/51n4Y4TGKI3i7H7rum/PU00DNLaGsd68MuyHzDUWgVPo7ChvZw+2S8RdSP7A/mX3wDYAB6YPhAVkfxpe1N0kVsH6d/B+WArC4C+3Hu38nBdMHPknKPmwe0/jEZs1i4LeKysBw0Rjre3HjlPpYF+1GZoZEtCd8v+AtZXO2mkcWI13LcTIoBfsNyCilxcOD5uxIG7zdsCA5iYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RNKcjTamJ6O4ps8dbHURIi8t9orAhAQlAyfobLURR6E=; b=BZT9X/14cX6PBuIUUyTk+BIbUBU6hUz9E4C6r0DYZQJ8BKNaIIMmr0c/v//G3lFSkiYoZtMQJRd65BzN4+vR1FqxrdloUEpCRZPcOkibCrARA8cCTR0Ih18Z+AvU4ZZRFQ8Oz4REo+tGlq0WtLRZrGUQYGJ9LxQqgCagzMkXoFprKNvUYtn3nuRoah8uPCfmjPGHpf3t4KTzXLa2iqY5FRhcHMhxJsVg7OdRdhemnAY+MBYupQuhRTbR94TzeOSjVpTzv9p4kYwoT9mUbW4aHHWzT2Jx3jTab48uc6Mqu38HIp0JY//CLcceBINxBu2isRd4LQmIXu+7NltwV5flgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RNKcjTamJ6O4ps8dbHURIi8t9orAhAQlAyfobLURR6E=; b=3mGiw0ZXdvJ2/JjVJsRIOWV1/r9OnOhCW0JdEetVwdlFgnpyIC1hbfZxDTsDXRMpxJnqVJh/HMA4/uGq8ZeMMH+XFtDH9/U6GD7MuNup8U/dekizajHudMZIUZj9pnKrpJXdu/ZhIbatT/5pD6zSFvdjpY7w0dWloN3RfG0qkFs= Received: from DS7PR03CA0097.namprd03.prod.outlook.com (2603:10b6:5:3b7::12) by PH0PR12MB8798.namprd12.prod.outlook.com (2603:10b6:510:28d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.35; Tue, 29 Aug 2023 06:07:26 +0000 Received: from SN1PEPF0002636E.namprd02.prod.outlook.com (2603:10b6:5:3b7:cafe::e4) by DS7PR03CA0097.outlook.office365.com (2603:10b6:5:3b7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.35 via Frontend Transport; Tue, 29 Aug 2023 06:07:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002636E.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6745.17 via Frontend Transport; Tue, 29 Aug 2023 06:07:26 +0000 Received: from BLR-L-RKODSARA.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 29 Aug 2023 01:07:20 -0500 From: Raghavendra K T To: , CC: Ingo Molnar , Peter Zijlstra , "Mel Gorman" , Andrew Morton , "David Hildenbrand" , , Juri Lelli , Vincent Guittot , Bharata B Rao , Aithal Srikanth , "kernel test robot" , Raghavendra K T , Sapkal Swapnil , K Prateek Nayak Subject: [RFC PATCH V1 2/6] sched/numa: Add disjoint vma unconditional scan logic Date: Tue, 29 Aug 2023 11:36:10 +0530 Message-ID: <87e3c08bd1770dd3e6eee099c01e595f14c76fc3.1693287931.git.raghavendra.kt@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636E:EE_|PH0PR12MB8798:EE_ X-MS-Office365-Filtering-Correlation-Id: 84d78275-2e4f-4253-3882-08dba85637f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yGJI9A0Hcrp7Br9gKC955LxrMkyGtsrMKk0mUOHSaf5QwVVFZtzqEe1EF6Kr6iUE4vHyIqgPEYzKVZft3BcyyHBiWPswCAwP9W5TQ3zkgVubJSayk3R1JgrH6qPlhf/peSF0IGpElfhTwbjrldBSfxjHYkm5sOA0yUaSyywhkjMihkGdRWim7L05kGo2vDaYYaRhSyaaDXGokLYxh8oo2E548Ct75KcjRBzr54fT7gqhAsViWJEpxFlyVXfIzg5HNinqDLdSrUp97+Qwe3oegmwU5Kv6GJ16TMufGjGvh8FhFPi5aRUzCpxviN5/j29YTNN3NQGm/RXPobhqQQFuQY3zZjGyP2V4To93OlBQEgRgN6lNt4GzNiY6LQz37QHOPriEOu6RX6iNxQGir3LPNmp34iFXuuwJZ98E/yNnnKm8pbUZopHZqwZP1rQciLx9pLW4HQRViptSJR1Js+cwlPXjhbViLeIeIbPGq7jLtBjMMZOvY4pISpRyAjDLIUrAgae+OtFT5TZAjUzoMREGnVKJNxJ/vk/ynaHZFcpc+3Jsu6V4FIYlTONTpgf9VnpvDgwfW+kxDl6kshbrvyoGvTu5tinfViS3a+pqBWubHyWSghjt3p2iuYJkmdYBjDEWnLgBByURMpVzmh/oC7yJ9lMZSwfdbcrepE1MqwlH0S11yu1dZlJ7LEcdi5aIVYmtWtow8gEj6d1QN4+PsOAdmoe3mkjg/cRC8Iwqlx6KTIsE1AFpa+O+jOJODE+PV99nf/1vjxB2Llie0m/90qo8oakPTUlftq+glbYSEEHjGSQ= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(136003)(346002)(396003)(82310400011)(186009)(1800799009)(451199024)(46966006)(36840700001)(40470700004)(6666004)(7696005)(83380400001)(966005)(478600001)(336012)(426003)(26005)(16526019)(2906002)(7416002)(54906003)(70586007)(2616005)(316002)(41300700001)(110136005)(70206006)(5660300002)(4326008)(8936002)(8676002)(40460700003)(36756003)(40480700001)(356005)(36860700001)(47076005)(81166007)(82740400003)(2101003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2023 06:07:26.1707 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84d78275-2e4f-4253-3882-08dba85637f2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8798 X-Rspamd-Queue-Id: 01321C0012 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: gs6foosc6gnxo399a5k3d9z6kmquxxo4 X-HE-Tag: 1693289252-791828 X-HE-Meta: U2FsdGVkX195KGx3cDJZTu3jBxEwZAVedY3plobt8F5pHaGYvhNIqQiRPOC00pr6ut3vzTBdc94SJZc1KKMROK6qoEqYhQ7LWMIjtrtKEs64UKMprd4PdDCP391DvPxUzw04O48weaiwYf5Txr1/HY0L1P44uneyyICzvK6u9i5wcKRqegCkTFvv0UDijLGmUV9moY2jEvRpT9eaizkiaffj1rb6+MjppZ9b+3z2vvPCNXnX86dd6Joa34UblYRvdk2apOH6vf1fi3G115H1x14kJOG9vh15uFPlLUwN487P5XEWG9tBZt9nWwHTR8V6ep9v4tzGcl32mKdglvg1Q6oQ8tHaclbHpGye04M7oVUAER0v3OXcjAp8efMYVeQEDVF9OdXWOpGqpAKmIr4RlBmsUSZC8P+ja2IcXzoXziEZqP6DMytKU+IeBB4fqcHYJxAJ+cBaTOLS10eRFz7A+OHOEFawXrZ6LFEIVAt4a0ryC4PVdUf6fjc1wqZ1jg5i+PdZ+oNhEGtF2UR3cpAgek2Bu1IwH8nFRPgNud+h5Wpwvgqi9CgXr2pbUSLVObbDoMJ7qqLtuWi1opQJ7PaZdWR+DTjpXjT+FQwX/Raea8xUuBHNf+bKMJHFAJz4QPCvnODCb8CxB1jQcBUO43ocyrVpFuFLZJ4p2TNLwohfx/qvLnM45rTo9Tex+pgkthK3I14kq/c8dltyvCL3CkbPzMkAISZD7I/nm91u2i9zEnfquN6CD9eKZ03TJM0+77Sc5RiWe+VoX6ljR3BU/XiQsxNnWLaPsVJ5DiiCNW/SWjXd0koskmsBKwIaRLlCz6OLDArjTBOqsrKHauRIRVwKDEk+tlHpGusNRx/+VeBzxMHATtnEeBE+fZAkmlbClnilfjsYztqL1tjX6iXYqxl0sLceTehhmf5TyL4EfvLYsp8qp/vTdyhAgViHbMXxNKjrWyrmND0DrtYSLcd6VIx +t/b24gD 0eLqTA5zSnt5JYFtE/ReS36hK3xzAqHbWfg0LQ0Sc+S+ZQURxhfC7fqopdZ4+xKkU2b3TvJQVV6sdsR+EsQumy0rGw9+HQHrlcq+542CPT59E49s+WHJk/JFZSs3TEtgf7XTOjaCFMqnw+Rf4KSP+Uoeb93N3DuxOyVWRYyEJy+0rqYZZp9GpuCNcDxqjYp9BNQfEyiqJDrymxQOZnVu4pnfBh2l6b+00NWHz7N1yGv5QVfybJOblIin1vfxPfUjMsjda30HjlCTlt5mDbt1lZbOJtXBdPKN8GVk9kQMTffNYljsFLRRlnQRMqSgEgwesGpXSHNDkDU3P+uafPWqQfGz44hZrN5g8vPCVjU3D5HdqfSobqgPu5SDiaNXzGlCpHTVgJ0VXSYSRwf0xEZAHtMwo0THiClfYTR4BmN+c6GwVWrX9B4qtyKKUlWCrvz44BYJR3FQ9aAkim1b4Jvgk79aVkqlaUEwG1zluT4aId1NV79fOlqQASjdRLnA1/hzbESrYc9xHBwipoLJF1OvRvd9GrhTPWblMP9QOiul5odc19Zgbg3U28UdtVfPcHUAsvAno8GVxG1n8rhimLQWPoyGuC8l4YA4VTKUuC8dG0NUn5tf6lDJ6A/55gWlaTyBmzHYAD9qqt1BitZI= 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: Since commit fc137c0ddab2 ("sched/numa: enhance vma scanning logic") VMA scanning is allowed if: 1) The task had accessed the VMA. Rationale: Reduce overhead for the tasks that had not touched VMA. Also filter out unnecessary scanning. 2) Early phase of the VMA scan where mm->numa_scan_seq is less than 2. Rationale: Understanding initial characteristics of VMAs and also prevent VMA scanning unfairness. While that works for most of the times to reduce scanning overhead, there are some corner cases associated with it. Problem statement (Disjoint VMA set): ====================================== Let's look at some of the corner cases with a below example of tasks and their access pattern. Consider N tasks (threads) of a process. Set1 tasks accessing vma_x (group of VMAs) Set2 tasks accessing vma_y (group of VMAs) Set1 Set2 ------------------- -------------------- | task_1..task_n/2 | | task_n/2+1..task_n | ------------------- -------------------- | | V V ------------------- -------------------- | vma_x | | vma_y | ------------------- -------------------- Corner cases: (a) Out of N tasks, not all of them gets fair opportunity to scan. (PeterZ). suppose Set1 tasks gets more opportunity to scan (May be because of the activity pattern of tasks or other reasons in current design) in the above example, then vma_x gets scanned more number of times than vma_y. some experiment is also done here which illustrates this unfairness: Link: https://lore.kernel.org/lkml/c730dee0-a711-8a8e-3eb1-1bfdd21e6add@amd.com/ (b) Sizes of vmas can differ. Suppose size of vma_y is far greater than the size of vma_x, then a bigger portion of vma_y can potentially be left unscanned since scanning is bounded by scan_size of 256MB (default) for each iteration. (c) Highly active threads trap a few VMAs frequently, and some of the VMAs not accessed for long time can potentially get starved of scanning indefinitely (Mel). There is a possibility of lack of enough hints/details about VMAs if it is needed later for migration. (d) Allocation of memory in some specific manner (Mel). One example could be, Suppose a main thread allocates memory and it is not active. When other threads tries to act upon it, they may not have much hints about it, if the corresponding VMA was not scanned. (e) VMAs that are created after two full scans of mm (mm->numa_scan_seq > 2) will never get scanned. (Observed rarely but very much possible depending on workload behaviour). Above this, a combination of some of the above (e.g., (a) and (b)) can potentially amplifyi/worsen the side effect. Current patch tries to address the above issues by enhancing unconditional VMA scanning logic. High level idea: Depending on vma_size, populate a per vma_scan_select value, decrement it and when it hits zero do force scan (Mel). vma_scan_select value is again repopulated when it hits zero. Results: ====== Base: 6.5.0-rc6+ (4853c74bd7ab) SUT: Milan w/ 2 numa nodes 256 cpus mmtest numa01_THREAD_ALLOC manual run: base patched real 1m22.758s 1m9.200s user 249m49.540s 229m30.039s sys 0m25.040s 3m10.451s numa_pte_updates 6985 1573363 numa_hint_faults 2705 1022623 numa_hint_faults_local 2279 389633 numa_pages_migrated 426 632990 Reported-by: Aithal Srikanth Reported-by: kernel test robot Suggested-by: Mel Gorman Signed-off-by: Raghavendra K T --- include/linux/mm_types.h | 1 + kernel/sched/fair.c | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 5e74ce4a28cd..647d9fc5da8d 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -479,6 +479,7 @@ struct vma_numab_state { unsigned long next_scan; unsigned long next_pid_reset; unsigned long access_pids[2]; + unsigned long vma_scan_select; }; /* diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2f2e1568c1d4..23375c10f36e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2928,6 +2928,36 @@ static void reset_ptenuma_scan(struct task_struct *p) p->mm->numa_scan_offset = 0; } +#define VMA_4M (1U << 22) +#define VMA_RATELIMIT_SCALEDOWN_F 7 + +static inline unsigned int vma_scan_ratelimit(struct vm_area_struct *vma) +{ + unsigned int vma_size, ratelimit = 0; + + /* + * Rate limit the scanning of VMA based on the size. + * vma_size > 4M allow 1 in 2 times. + * vma_size = 4k allow 1 in 9 times. + * 4k < vma_size < 4M scale between 2 and 9 + */ + vma_size = (vma->vm_end - vma->vm_start); + if (vma_size) + ratelimit = (VMA_4M / vma_size) >> VMA_RATELIMIT_SCALEDOWN_F; + return 1 + ratelimit; +} + +static bool task_disjoint_vma_select(struct vm_area_struct *vma) +{ + if (vma->numab_state->vma_scan_select > 0) { + vma->numab_state->vma_scan_select--; + return false; + } else + vma->numab_state->vma_scan_select = vma_scan_ratelimit(vma); + + return true; +} + static bool vma_is_accessed(struct vm_area_struct *vma) { unsigned long pids; @@ -3058,6 +3088,8 @@ static void task_numa_work(struct callback_head *work) /* Reset happens after 4 times scan delay of scan start */ vma->numab_state->next_pid_reset = vma->numab_state->next_scan + msecs_to_jiffies(VMA_PID_RESET_PERIOD); + + vma->numab_state->vma_scan_select = 0; } /* @@ -3077,8 +3109,11 @@ static void task_numa_work(struct callback_head *work) vma->numab_state->access_pids[1] = 0; } - /* Do not scan the VMA if task has not accessed */ - if (!vma_is_accessed(vma)) + /* + * Do not scan the VMA if task has not accessed OR it is still + an unlucky disjoint vma. + */ + if (!(vma_is_accessed(vma) || task_disjoint_vma_select(vma))) continue; do {