Message ID | 0ff0d56b88a64e2017b427f37b15ab41aa5d4019.1693287931.git.raghavendra.kt@amd.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 8C735C71153 for <linux-mm@archiver.kernel.org>; Tue, 29 Aug 2023 06:07:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 278EC280038; Tue, 29 Aug 2023 02:07:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 225378E001E; Tue, 29 Aug 2023 02:07:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C72C280038; Tue, 29 Aug 2023 02:07:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EE60C8E001E for <linux-mm@kvack.org>; Tue, 29 Aug 2023 02:07:54 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B77BB160646 for <linux-mm@kvack.org>; Tue, 29 Aug 2023 06:07:54 +0000 (UTC) X-FDA: 81176111268.08.9F76D90 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2040.outbound.protection.outlook.com [40.107.93.40]) by imf21.hostedemail.com (Postfix) with ESMTP id DAC2D1C0008 for <linux-mm@kvack.org>; Tue, 29 Aug 2023 06:07:51 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=aj+nFWWc; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf21.hostedemail.com: domain of Raghavendra.KodsaraThimmappa@amd.com designates 40.107.93.40 as permitted sender) smtp.mailfrom=Raghavendra.KodsaraThimmappa@amd.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1693289271; a=rsa-sha256; cv=pass; b=reJ+Dgb72fY0N3AHGuJepscHoB79PkJu5sb0F0i2usOhak8Xd9jSt0BCrtUNE09q9IWX4Y kpzfSiyBHqWzQPTV9bn/nfGsiskryJhnJatCMP9FfTDbiFLj2tMIlPr+iRN5ZKslIc99CB 1JamZjXJzXyfNLYCnEjuV6RL89upbqg= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=aj+nFWWc; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf21.hostedemail.com: domain of Raghavendra.KodsaraThimmappa@amd.com designates 40.107.93.40 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=1693289271; 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=rqQHuMTEJJDtNpFNildcoC/NTNoRUydsBitUUo8dU0g=; b=yLyeujLoTjB3PIybRhpBb1h8HeGmRgwyC7TQw1YL/0MhQrWuZBGxWCh2gahX8SxzRzAmXp 6htD3zDRhMDeQJliYkThpMFVs3I6Helz5jKI3GJjUaSJeZjwkq3q9NMtfDl2o28J9MlX4y QxGEKaMiIGFIIk05cVc4IBRIcZzSAic= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wa/DYEqd1uxiRSqiZ2ivJQqhnTGn0NkJTZWGJPQBwRRSRdaK75z4oyQYzaeNm1Cficcq4tLzd2exr4Vk1P+SSx+RoKi5f4YHxxNvek3yna45cYgoWR7E4tpMor1MGmnl4/oJxF95rNEBtpO2E+1kTiFmm4maiFODft8vWm2aQ7buU0A3XTqxQcStynbK4/EZCwxMDx4mSv5/sOfSRAjous7pCRCfcljJFIHGAPKZALeFYEaq3w/FRKb6jF+x2s2rp/HgZO/oI6b6RlGx4DwM8bWAKraOxE8ddABOlBwy1p+s9Y7nvh04UaQMxz1bgPII8TevgULLvkIvvRxbM0BR5A== 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=rqQHuMTEJJDtNpFNildcoC/NTNoRUydsBitUUo8dU0g=; b=SeHE7ENs1XLlD/+F+QcD1XzVeFkBquQkPdBvZukQ0JBlVY95zDTr4130XL0Uv3ZLWyOA7j/ec8qC2DpDIGSslF6DblgxrVQhWL1oDTBreQzk2lOYeW3iliyoTlD+kZPAllgXKDwwNxhk2Zu7WaEQ4xtUVB4PoL5KByU9L5oo+dlxrgt6wV8kPSiB6oiBWM4rFXZBikaa2U5HrqflOu7T5dXPnwL5nkj9Iazap3nBjQ/jQpH8SXpngA6ob/Qv2w2pfob3pE4R37XOE+P/8UpL563QLuJFfaPDTM95nyh6Dxo8cNYypICRVDt3G5UNGkNnoJER+s6JLTnZeiyQ05uNpA== 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=rqQHuMTEJJDtNpFNildcoC/NTNoRUydsBitUUo8dU0g=; b=aj+nFWWc57XKyiqQFLYqwYX7uWp1+c7znXmbKagmfT3isjl5ZK3pKegVb3+MDYdfDDLUEG+HT157dRU0lZpa2CEodEfc7hqU3vvTeypRiKxXhnHmnxAc5hGJmZb/JbVX5QMCu2yndPwoM1pwsAvraGzK96MmkXXwc6woJtN38BQ= Received: from SA9P223CA0011.NAMP223.PROD.OUTLOOK.COM (2603:10b6:806:26::16) by SA1PR12MB8142.namprd12.prod.outlook.com (2603:10b6:806:334::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.34; Tue, 29 Aug 2023 06:07:48 +0000 Received: from SN1PEPF0002636D.namprd02.prod.outlook.com (2603:10b6:806:26:cafe::bc) by SA9P223CA0011.outlook.office365.com (2603:10b6:806:26::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.36 via Frontend Transport; Tue, 29 Aug 2023 06:07:47 +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 SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) 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:47 +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:41 -0500 From: Raghavendra K T <raghavendra.kt@amd.com> To: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org> CC: Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>, "Mel Gorman" <mgorman@suse.de>, Andrew Morton <akpm@linux-foundation.org>, "David Hildenbrand" <david@redhat.com>, <rppt@kernel.org>, Juri Lelli <juri.lelli@redhat.com>, Vincent Guittot <vincent.guittot@linaro.org>, Bharata B Rao <bharata@amd.com>, Aithal Srikanth <sraithal@amd.com>, "kernel test robot" <oliver.sang@intel.com>, Raghavendra K T <raghavendra.kt@amd.com>, Sapkal Swapnil <Swapnil.Sapkal@amd.com>, K Prateek Nayak <kprateek.nayak@amd.com> Subject: [RFC PATCH V1 6/6] sched/numa: Allow scanning of shared VMAs Date: Tue, 29 Aug 2023 11:36:14 +0530 Message-ID: <0ff0d56b88a64e2017b427f37b15ab41aa5d4019.1693287931.git.raghavendra.kt@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1693287931.git.raghavendra.kt@amd.com> References: <cover.1693287931.git.raghavendra.kt@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: SN1PEPF0002636D:EE_|SA1PR12MB8142:EE_ X-MS-Office365-Filtering-Correlation-Id: a9766cea-cf3e-48c4-cf1d-08dba85644e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SfPr6kq8rqe2EGdrAEEE+fJA1uNbGBTr7Wczi3D6wnECj6wJKahi7SyPVoPOzAED+Un+I53agTVyyWBeO3RYB54/pSMhBjk3gFuSlVRNhrQqNfirzyDI/ble2nodM8H6ioy8v0lFKxfrMkiJzibmWhnqhjHhvnGMq+tTKy0/rE2y2ZyM8mCW0epv8dC8Nhe/lVPB8vwMrBvPtyvUAmfyXAKfV5kYWu+2hqUfsHtYAyEKOSEHVr5A8VebV/yPGIXL4Mr6iFZDC1xmBrQc/ei6PKYzMm3uAY2MKjHY4t9d6KgTcSEEpGYL/6jojJ6zZHP4shRXWtqCwIvONlPao1Cylvz5SJFyt1h4CerBWKsgmHBuJBBd3RTl8nBsj634fiCDAL1ePBIg1korPACOWsA/nkChMjFa0PR5dDfqMc9bV2k7y2ZXp8WFaaYmTk17eXui16dOy5Ue47zTf8i3rGy96U3CP7L8JJ+nk/UJjAkHSIbxORn+oAeM9Iu7Z/74uIqNFTP4/mRSVCZi1TtFBaMOBPNexvgxjaPBlvn8ykX0IQ/FDC6lV90gkRnw9pjfxNDSLXVoLej05QEiah/sdfcA8dXBfOT9XxulxxJIfX8xEqpidiYw/INdGOnDDVSrLOj5XXzSfTqK56y+47AzINtlVG50pRVPE57ikkrsgKPuV9gmIS7xsA+eLIOzr7DPh0fXc5yYRR+h15Q5JmpgIbs9sEAvO84JoUyLgGvvIPWS7NcA2R5Lvjv8cfXgtv2pR8BnBg4IxFahssDwJ0H3Q5kJASdQBUWvsl03b1UaEJNoC7A= 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)(346002)(136003)(396003)(39860400002)(376002)(451199024)(1800799009)(186009)(82310400011)(46966006)(36840700001)(40470700004)(82740400003)(6666004)(7696005)(36756003)(40460700003)(356005)(81166007)(40480700001)(36860700001)(47076005)(2616005)(2906002)(336012)(426003)(26005)(16526019)(83380400001)(478600001)(110136005)(41300700001)(70586007)(54906003)(70206006)(8936002)(8676002)(4326008)(5660300002)(7416002)(316002)(36900700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2023 06:07:47.8931 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9766cea-cf3e-48c4-cf1d-08dba85644e4 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: SN1PEPF0002636D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8142 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DAC2D1C0008 X-Stat-Signature: 9h7ez3inj4sh79s8ugui9a7475hge7m7 X-HE-Tag: 1693289271-164162 X-HE-Meta: U2FsdGVkX18xojlwQKUsidYP9R9VLautEPi+UEjJPeQPEGdnzhrNrpNRL0YBThBDUZsaRSkggzlRwU9u6KscZIEQDr9DY3UBvObKdnqbMcaevxEVdz0T1oIkJxBSpYnjojwqfe5FzQc8yCJXTYk8+aBf1CDv4bQWt6r024MexbwFunO0xv7Edhq+LRuIemO6daqrg48Lv7V7h+F8oBHHtPmyq1LtM4E4Dwza8PCX4QRtarlQdPlr18xUkBO/RWWsgu+f2xJMFUPJLIMTGoHrKYEhV0kMazq1yQavKEF+49o0vPBJh/mJZilj9VM+dBoeV+nqHLsZZBP0qSeM9ZEM4KWLUvsi6N44tE7bvZv46dBkQkBM1v+YORPZEXMHVi61fTMFxTo0c8jPbifc7U/kyASuaIX0XE5HJQtffZ5HldFz3mCTlHkjXWIjR6GyrKk2gkiswbBN0L013844AR0ycFIAa39V/xjA0YD3+Vw/8Jn1Xg6tDLphhhARXmghSkhZ7hCve0AF1clR6j6avVjHYXn2BjXpL+am3rthNjvS7nSVYalaylviCPGUUFnr8D/QZno5QsaE0PteXor11PLly2nByY+yuTMQnj0XOjEFKuqYcW7W3Vu2kyOZ6DhRWEoSEoD2khbYvgJjadLYL+zTAJs60mMnQ1p1lRS0RCFcHHlhAygqBwz/TqBNjjzg8PJIR3nEvoR5hoCU17h3RXGqEsyAHuxjMOCFywAPmh3sAVfQWYKeqG5zE6aiS2wNEnmo6Z671p1csNSPESQAzPqSdTY7Fk8vdB0VaiOPbrI4267FIhG++L9gV5yuKv9LrBbNeVK0OzZ6blXMOpnfdok30YESvtVQdwlvL8oH0P0GVYu6nUaAIlnQ4EOUjDYPQqFXZ6UbvphWCIA4ocxRlpO0kTZ0Lo/R5S0+gyKaxe1kRqcIOBRm5Spz6Qup0aZV4Kt1ek0WBDQP4fWJNKuPeDK DRMj+MNc yW+3Og5eaCyTspOyenQCeUFbXdzbXhENUWt702wTFpsclFVnmmCgKRygr6GEb7KAr6TJu3qPkCeayfJYPjbNWUEa6UEArs+GTuLkWkGrVu5O6ZK8kMgEu9p7FZUvwRLdX0cSDtuzW1JuhHjrNkjjgohmFQKOAdJboiP8mE2mT/YV/DMmI5M4J/2kyV4tqQBDItaZm2BGuyjTqhMvFXpbomIu9HgP5OcofzoQcwdpkhvS38jy84eT2csrK6+gNw04WnGjX1zl2bSX0zGka81DTakoBFJit3lhGgpIje/L9iXirsSr4XaOLxIWc5Mu4UaMy1Fiqo4MC7yMSbOfIqlI2kSvmU/cvRU/E8B+Gu058VU+hEyL2ILW+Y5VQ3f/0B6tIa1qrQC8Ym5gjMB4O+xxRkTXDvGmBHlK8Uqj0EgbxZZK4ecNRTbu335iDt9rTweaokR2bVb8UsQdIPqf4BBIvC31A1cQWv7zywt1cs+DEuTBqO28Xak5g4gahMw== 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: <linux-mm.kvack.org> |
Series |
sched/numa: Enhance disjoint VMA scanning
|
expand
|
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6529da7f370a..70c8e62c1a89 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2981,6 +2981,19 @@ static inline bool vma_accessed_recent(struct vm_area_struct *vma) return (bitmap_weight(pids, BITS_PER_LONG) >= 1); } +#define SHARED_VMA_THRESH 3 + +static inline bool vma_shared_access(struct vm_area_struct *vma) +{ + int i; + unsigned long pids = 0; + + for (i = 0; i < NR_ACCESS_PID_HIST; i++) + pids |= vma->numab_state->access_pids[i]; + + return (bitmap_weight(&pids, BITS_PER_LONG) >= SHARED_VMA_THRESH); +} + static bool vma_is_accessed(struct vm_area_struct *vma) { /* Check at least one task had accessed VMA recently. */ @@ -2991,7 +3004,8 @@ static bool vma_is_accessed(struct vm_area_struct *vma) if (vma_test_access_pid_history(vma)) return true; - return false; + /* Check if VMA is shared by many tasks. */ + return vma_shared_access(vma); } #define VMA_PID_RESET_PERIOD (4 * sysctl_numa_balancing_scan_delay)
VMAs being accessed by more than two tasks are critical. Scan them unconditionally. Note that current patch considers full history of VMA access. Signed-off-by: Raghavendra K T <raghavendra.kt@amd.com> --- kernel/sched/fair.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)