From patchwork Mon Aug 5 15:36:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhiguojiang X-Patchwork-Id: 13753754 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 9D7F2C3DA4A for ; Mon, 5 Aug 2024 15:38:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 067E96B00A6; Mon, 5 Aug 2024 11:38:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F26D26B00AA; Mon, 5 Aug 2024 11:38:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2B3E6B00B2; Mon, 5 Aug 2024 11:38:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id AF1056B00A6 for ; Mon, 5 Aug 2024 11:38:32 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 69204120168 for ; Mon, 5 Aug 2024 15:38:32 +0000 (UTC) X-FDA: 82418598864.05.4068980 Received: from HK3PR03CU002.outbound.protection.outlook.com (mail-eastasiaazon11011040.outbound.protection.outlook.com [52.101.129.40]) by imf07.hostedemail.com (Postfix) with ESMTP id 8367A4001A for ; Mon, 5 Aug 2024 15:38:29 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=op0hYqwb; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf07.hostedemail.com: domain of justinjiang@vivo.com designates 52.101.129.40 as permitted sender) smtp.mailfrom=justinjiang@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722872248; 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: references:dkim-signature; bh=/Uu5NeI0WJGCTOfaRki6wj8M1ykIoUTpYHqzeNxRsbQ=; b=b8c4Ejyzs0QWmPRC5gSw7HUfVFA6/dOV55jvcswLg1mV3f5DdTBhBVfcBj9/DyuB/CFdYg d8Y5bNuADCO14gr/HxRZfFgfQGAFF8JTtvNrpSmR+1XpKsmABlzVnoCPC47xDPLmXYQcCW Ilul6c1wmenfiX35HGXtgOVFAawV2Yk= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1722872248; a=rsa-sha256; cv=pass; b=Qz1JCFGoWKy4deYTDyT4JEPAeDa+/l2jl41i+wYM/eaNactn74OMrt9XTa2ybPh8yU+7Su 78e/WTTSwT9f32+svYNmbe6Mj3502BtA0/wLI9pYf/o5+Y4GzX2TbTLuVwu6/doc2kiyKY vGg+NPi3v3u+cBsqoAyyRdUSeYUppBA= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=op0hYqwb; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf07.hostedemail.com: domain of justinjiang@vivo.com designates 52.101.129.40 as permitted sender) smtp.mailfrom=justinjiang@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=euEbiSFCAPGT6y3GZrVMLC/NFr9DJcgCfDA24lfkQjKT3YVWUTSCFXlJBePBS6GzD3wq9EmzEd5iUvhsni6wqyxpI7HAirD6iC2vfDS4EKZmQOYCPV2emHeQIIRhWv87xu8VBVUmehSbTvpOTp1QIc8SCBm/mhhRwhiFsLzLWG3JuMX89TlXRHUzK9q+MBkB7P0jJaCmAi83fDqYsdgGq/h+n4kEcvv8HYQ2JYcvSPSUoi34Fv3hOdxFZ8f8EpFeZVurpGgcKUP5GCY3xQB3ZGW6KhSGfvuLFpPK8U8YS6h/an6tXgkPB3BAhHwZ71f39S+YWuYtujg7LI8GlAcc8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/Uu5NeI0WJGCTOfaRki6wj8M1ykIoUTpYHqzeNxRsbQ=; b=CyPjoQQcQu2vbo9qW+6bz9FFnSAXddE9caie/iGb+db0B5bSTjrS0RtFPkYSQGXp7AcsUMT1rxCqkniNgMhdVDnRTz7Z9e0lYdpvLRkgDM0VxOgPTt5uaUA9CnP/yC3V/qeFj8/da/PfoD9koqxXhTEXlBeVoYKb/1wl5EKqMdkvTeisa2YnXCYMyC40MZyaaRet/KTkNi68M0wa4W7mhphn6SlUcXhHMDNqG1h2ndOPEQNgrEI2VpyEptJ4PSDrN/XRzJB425wBgF48aRY0n2iZIguxzoqaYqyj9G/htxcD8jiI5Cm2pX5VoQKLybeJaFy7Q9OMuqwvMr0u89gpbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/Uu5NeI0WJGCTOfaRki6wj8M1ykIoUTpYHqzeNxRsbQ=; b=op0hYqwbACV/4ZPLzhMnfgd06EuP7e6q/bUSCyrH5VeAVdNutzO66708UiNF7W4MfMX8rXmZm+gUpBzmD+Q/f0MsmE5jHUSIQk/3fIiXbLd+Aa0PJGTq7LMfIKL6hTElPtwT+wR7mbAdfTqOyqrNP5Jpk7U0fru+pNanOQ531QuY/RmhZv923bXkxccsadAVrdXu5vBLC2wX33KQowuJEFoP9yJ3kxKcUHPhjoaDerhCLwEHOQTdeFPfutKPPsaDmUdDzVZGwzTr2NkiPxVP3pCTedSbiwmSgVDAVWPYi33YcqOm48GWALWyNzF4/l/bTRdjNiXw48Mi8nC4Xab2Jg== Received: from JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) by OS8PR06MB7322.apcprd06.prod.outlook.com (2603:1096:604:28c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 15:36:48 +0000 Received: from JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::ed24:a6cd:d489:c5ed]) by JH0PR06MB6849.apcprd06.prod.outlook.com ([fe80::ed24:a6cd:d489:c5ed%3]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 15:36:48 +0000 From: Zhiguo Jiang To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , Arnd Bergmann , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , linux-arch@vger.kernel.org, cgroups@vger.kernel.org, Barry Song <21cnbao@gmail.com>, David Hildenbrand , Zhiguo Jiang Cc: opensource.kernel@vivo.com Subject: [PATCH v3 0/2] mm: tlb swap entries batch async release Date: Mon, 5 Aug 2024 23:36:36 +0800 Message-ID: <20240805153639.1057-1-justinjiang@vivo.com> X-Mailer: git-send-email 2.41.0.windows.3 X-ClientProxiedBy: SI2P153CA0001.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::7) To JH0PR06MB6849.apcprd06.prod.outlook.com (2603:1096:990:47::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: JH0PR06MB6849:EE_|OS8PR06MB7322:EE_ X-MS-Office365-Filtering-Correlation-Id: 40fb6d77-633c-4edc-b61f-08dcb5646b3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|52116014|7416014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: Rejj9ID/vXDz2UAhxUqtd/xdhgkiYkcwN2JUAgqV50eomFMjbc6zmOgIglRF7+TZIBIscxGTLdbzSmkYPy4Ezn77OnMmA6s7BZoVdRhc7LIlpXRuoiE/Om32TwL1SvZqQ5TesN0iQdPRmXM7SzzoZtEGLbViHqa+V1mW4R4yu2lWNDKVpfoTjQo3xwbA+aXKiLt7Zj8qC118r8RVZv6HNVVWXL47jSpgQUs2UMgsW4bjq8vcL7mX8ta0DHprG8ldFe+6p+awvZO4MKAQo7v6Xaac7v5yqEfWFqkpALCDUGE5i1AV2OZ+t1NCbZzuwObexPt49XSF2awDHBteQkTS7NUk19wmH1oe2UxJYjiSYDTTPHESq8yiNyTlZE/NsJScl5wZjqsG3Vnyr0XLL9QN1U0eO8a/KM7lH8NgneGnTBnG08AN4OWcv7uZQZepyK/4wT4LgVTCmHqv72FTEpD0B4Pn+ghT8OxLRttYiCbEXcs8Gp20bGSZFC+IptoDrR5Uvzql9lZw8hRYIKZPG+LFyVlY9Ok8BP6+mZOo41xQjJ7cbB/CdN5XzHVcUSxuOuxKGkW2EYOx69oUfdplLFlz+Jmq89jwEmlj/qDRz+6ZlqOgSyJ8VHs4BU3d17k6OoqZa6TyOZnIJUV8OhP0MygAmm4xjXx7uIvLJxPnPi4cUsD06UwmMlce57WReuIcOwlmrAW9xAlrPNMUzikv8m6/ueENA3Dfu9scwZHI8k0sXgr/tXBlqcmjbZr9IRdqS9jkHxB9s+A0TqeIWldWbPo20GFu1KM8R7FVAJ5VWFK/NuqgtymXyG3OHzPQBWUhHWTANgBb8c3Ym/IW6naQTjQ6toIrOjc8xrfL7TKNTfk/WZamkxK9uzi5wFxaIHTEiIfYlaSbD2ZzCmaCPRIGUNSL22HRWcCGxfHN6trCb0X1bfVx+4Wz6RreuMxhDs3oboHvc+yAsk5qmGENiXiLrTTLJX/Mlp5O6KMVqV1USPMuJDXj4jZFFL3F+dCZ7pk/Jf2nmNyZUqiWolL2BmGNoSfrRRvv21MOCXe2+nKNbvkdqYRODlC5shY12Grvt7ukwueTdaiEySeS32Uc7YuDyQ+YXrLsvDGGEpn3u8VKU3BIcBUupl4R4LOu/UUcD0JLuQq9Cm7hop/wPFlu5TspmkKNXwxXiAEhd+gA7Pgbo6XTjciNt3Ye4AdfQwOuh1dAlOFHnMEAZIPd1pfov01NXUntSzDJOxS/OG7V4iqyhMeS/DHzOWfrIdFb65r7GzISQDEh5ToX+fcVokJBJhT24Wgk8/VH6Ss/lre3qKF2yFIfp1YeWCICRIOx/27tpspVQOPNMS8fnlnpDDutTvn70VnEWjdMI3T/2OiEpJofxHMF8FI1nQTQxCxzv/SoF5SNNiy/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:JH0PR06MB6849.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(52116014)(7416014)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jgkFISWvx/42SygYtPczI9HRq8VkaKdVtQ0tlD96ON+OplYNbth49DPc8Y6WTwA1GygJdM6F9+fc3GlYVSLqbEEKby+Z266cC4HpzQq5C8nu+X4ZZLhVSY3kZSJFV5VK8PD6XLVOhxc1JWOohG4vlAuYRpxRier50soZtEiReoXkEZrz627u51FvzKyzrQw0wWjeuKZXLT7qBCuAEO59Hhxy9WSNz1a7W3ZWmJ4hcNwLURVWCv7hJASYnG3+BjK1Fkl82woI2kMpiakeDYmcfhCLwL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PoMXgyafFFnUTYCFBK3qIkFbad3gV9eBv42v3XKtrGRAZKYE3GjC8oDZYYef+zU3TiJiQCumq6Ss5aBUQotoBqPD3kUkN6mDmz6dNNm1D4ecSkQWyoFfxcYYiR5cIxx95Nor/eWm0XDOkzKO1Z1GJve7ncrHBFQvcWlZUzo1OE+WaqxmbTTGfSKoBYg0/ZAk0rWzEdGRhIvCytxVy0jCu62+cNLX+zoX8LGFWcAruuoUz9I9pHBEt4GTbWDIY X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40fb6d77-633c-4edc-b61f-08dcb5646b3c X-MS-Exchange-CrossTenant-AuthSource: JH0PR06MB6849.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 15:36:48.1445 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cKsDcDURgp+WE/ykW7vJFoPfksBfGYC1ANLpNMePxWTDbKyrbwwKiM6cMUIDf8E8Iq8+ianaouXwTIgJ+vG0mA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS8PR06MB7322 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8367A4001A X-Stat-Signature: 5n3yg7hwditpu4kntubawbss19omu5dm X-HE-Tag: 1722872309-703164 X-HE-Meta: U2FsdGVkX1/HD3ANri5QJn1xI2vlOmchBV+GyoYL8hHX5I1NBY8E0VHciLLLcksyJuyk8nuIpPc/9H+Hav4IFjy1OJsbDS4EqhtmAsAz8besJOES8IVBY6cvxaq9u1piT7IEL0aSY+MRdl5dFhaiIz1c/Cu1cfIpRvSDpjQ6fyET64dTs2s3QCJcaWLQi6CEC8Y3ywvf67AW1U5jRepLCRbA9M4yUjQp/pm6q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nCN1lXjE7tSNGVWy2n5hd7GEAc47Gksbw== 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: List-Subscribe: List-Unsubscribe: One of the main reasons for the prolonged exit of the process with independent mm is the time-consuming release of its swap entries. The proportion of swap memory occupied by the process increases over time due to high memory pressure triggering to reclaim anonymous folio into swapspace, e.g., in Android devices, we found this proportion can reach 60% or more after a period of time. Additionally, the relatively lengthy path for releasing swap entries further contributes to the longer time required to release swap entries. Testing Platform: 8GB RAM Testing procedure: After booting up, start 15 processes first, and then observe the physical memory size occupied by the last launched process at different time points. Example: The process launched last: com.qiyi.video | memory type | 0min | 1min | 5min | 10min | 15min | ------------------------------------------------------------------- | VmRSS(KB) | 453832 | 252300 | 204364 | 199944 | 199748 | | RssAnon(KB) | 247348 | 99296 | 71268 | 67808 | 67660 | | RssFile(KB) | 205536 | 152020 | 132144 | 131184 | 131136 | | RssShmem(KB) | 1048 | 984 | 952 | 952 | 952 | | VmSwap(KB) | 202692 | 334852 | 362880 | 366340 | 366488 | | Swap ratio(%) | 30.87% | 57.03% | 63.97% | 64.69% | 64.72% | Note: min - minute. When there are multiple processes with independent mm and the high memory pressure in system, if the large memory required process is launched at this time, system will is likely to trigger the instantaneous killing of many processes with independent mm. Due to multiple exiting processes occupying multiple CPU core resources for concurrent execution, leading to some issues such as the current non-exiting and important processes lagging. To solve this problem, we have introduced the multiple exiting process asynchronous swap entries release mechanism, which isolates and caches swap entries occupied by multiple exiting processes, and hands them over to an asynchronous kworker to complete the release. This allows the exiting processes to complete quickly and release CPU resources. We have validated this modification on the Android products and achieved the expected benefits. Testing Platform: 8GB RAM Testing procedure: After restarting the machine, start 15 app processes first, and then start the camera app processes, we monitor the cold start and preview time datas of the camera app processes. Test datas of camera processes cold start time (unit: millisecond): | seq | 1 | 2 | 3 | 4 | 5 | 6 | average | | before | 1498 | 1476 | 1741 | 1337 | 1367 | 1655 | 1512 | | after | 1396 | 1107 | 1136 | 1178 | 1071 | 1339 | 1204 | Test datas of camera processes preview time (unit: millisecond): | seq | 1 | 2 | 3 | 4 | 5 | 6 | average | | before | 267 | 402 | 504 | 513 | 161 | 265 | 352 | | after | 188 | 223 | 301 | 203 | 162 | 154 | 205 | Base on the average of the six sets of test datas above, we can see that the benefit datas of the modified patch: 1. The cold start time of camera app processes has reduced by about 20%. 2. The preview time of camera app processes has reduced by about 42%. It offers several benefits: 1. Alleviate the high system cpu loading caused by multiple exiting processes running simultaneously. 2. Reduce lock competition in swap entry free path by an asynchronous kworker instead of multiple exiting processes parallel execution. 3. Release pte_present memory occupied by exiting processes more efficiently. -v3: 1. Fix compilation warning and squash them into patch #2 according to David Hildenbrand's suggestion. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202408010150.13yZScv6-lkp@intel.com/ 2. Update comments according to Andrew Morton and Barry Song. -v2: 1. fix arch s390 config compilation warning. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202407311703.8q8sDQ2p-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202407311947.VPJNRqad-lkp@intel.com/ -v1: https://lore.kernel.org/linux-mm/20240730114426.511-1-justinjiang@vivo.com/ Zhiguo Jiang (2): mm: move task_is_dying to h headfile mm: tlb: add tlb swap entries batch async release arch/s390/include/asm/tlb.h | 8 + include/asm-generic/tlb.h | 44 ++++++ include/linux/mm_types.h | 58 +++++++ include/linux/oom.h | 6 + mm/memcontrol.c | 6 - mm/memory.c | 3 +- mm/mmu_gather.c | 296 ++++++++++++++++++++++++++++++++++++ 7 files changed, 414 insertions(+), 7 deletions(-)