From mboxrd@z Thu Jan 1 00:00:00 1970 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 B5581C021B3 for ; Fri, 21 Feb 2025 23:47:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C55CC280005; Fri, 21 Feb 2025 18:47:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C031F280004; Fri, 21 Feb 2025 18:47:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0B2B280005; Fri, 21 Feb 2025 18:47:27 -0500 (EST) 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 7B24A280004 for ; Fri, 21 Feb 2025 18:47:27 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E2B57160A4E for ; Fri, 21 Feb 2025 23:47:26 +0000 (UTC) X-FDA: 83145590892.15.49F98B3 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by imf11.hostedemail.com (Postfix) with ESMTP id 0D6C740011 for ; Fri, 21 Feb 2025 23:47:23 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=mdDBot64; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf11.hostedemail.com: domain of ziy@nvidia.com designates 40.107.236.40 as permitted sender) smtp.mailfrom=ziy@nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1740181644; a=rsa-sha256; cv=pass; b=e/q1Tvv5oEHC8aKS2SDjCXjksZQHGLcFvCZ+ZPcU8EjwCvvxmHMP+jPzTywkxkzf0GIFgD pB94x3C0/enXV7BqiYycwXrdgzPM5QFJQQhmlcbyyvIk6McsEwMIsnelFUMov1907Gl9FI /W0wq0foOZZu6V0Pku6MIhC06FVlnic= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=mdDBot64; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf11.hostedemail.com: domain of ziy@nvidia.com designates 40.107.236.40 as permitted sender) smtp.mailfrom=ziy@nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740181644; 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=ytQnO5mi33tuoH7nlS/i40E6ExO6ME8dnxClsoUlwtM=; b=mUej+zpCXWGQFASSFFG/pKZaxVdkjqHJVHGxoY221DE0apbX/lPSOr6cF9A2YZGpnpo9CO 9abN38xz49vbYzzAfnn7/l1YlknK263vXeaBwONG4Cwd5h5tAL+j3UEVXAoHEa5rB7Sj6q HLXjGVrNN+6kZe6uuotDFgTeP1D/ytc= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s9VCPwkCZdE7xfUmWjQ3CdL0e8Zs9GgjshoKMKS3A/yWgMD9ypHbx43UtlUfdAOKsapFb/ZDqJXx+cspxhXObI7Mw2AbkNnwyr9TWKs0GgQddrATOJTiArXMYnEdA3JM8DZ2/0wiW+akFOmPUjKfzc+6fVHlo1T77lhhuidM1QmXlCTiurOMQ6TCaux5BzcEPbTs/lmzGekZvyNsp5ydorqPABVszn3SKmFXoybYP1SSoODm0pwe5OZ50/S/Sexi2p/ZlQSm++WRmPLeKan0Uq57AxO5HMSeFjhAjLTD0erAYLsxQzllumXZaQ+1MixWtdOgvNWjL6qcEGsICBYnew== 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=ytQnO5mi33tuoH7nlS/i40E6ExO6ME8dnxClsoUlwtM=; b=P1zNBgSfXDpiudsW7fka2AR9VArm5H8WQ/hdSOrvoZLCLKcXEFfaso4kx6fwRuJC9jzPcxhxx91AhjT79ordgN5KOPxhMpLMwpSTK0Ps7exmHka6o+uVrdtRkt2vtB/1fZlX3dyWRWdNTUWKkbQXIrQojlEEFXiv9CHJ+TKqyYhVr29m/302zKcdbOWdRN4ZZSUw/WFy2a7s/XP366Qk2H0kfA0RsQHh7D8qEAyCiP/09tuhXMEd0aVVJJNaDeGlUKR558Lh5bj8NgCBqdDLBzavYk2MLFME5u9AKHJYcl14h1kUwpjI24kK/J+kV2OzvNBPeg65yuzPFFetwUdzrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ytQnO5mi33tuoH7nlS/i40E6ExO6ME8dnxClsoUlwtM=; b=mdDBot64I6Nzpb83XAtZfIxnJjvVUwOXn8adHwcCpSA5ZpNyT78eQMMGrNhh4YRCCMJRN3ZAd7ELdOGtsHrLYNo6Dl1AiLwm7/GBWq4+weV6Y1OyvEnPDOOr1qdfETtBO2A1OZl+j6bH5IhATIkg1DEVACf40o8oGqKReKh9VMCkk21WFel/mIV4zNhMUgDRnF8a3HkrD7ClkV0WXFfwGLgRTKix1478KXKsTIXjq8ZR2Dt6xgBXQkU7ZPd3VHIxhjPVz94zS3gxS2fUSpHHJFt8034dTNYz7LoGuQKInlvJ0Q6gMS6wHSQDjyLpEn/ERLn6EV41z8oq6ItkUmbv1g== Received: from DS7PR12MB9473.namprd12.prod.outlook.com (2603:10b6:8:252::5) by SN7PR12MB8435.namprd12.prod.outlook.com (2603:10b6:806:2e2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8445.18; Fri, 21 Feb 2025 23:47:20 +0000 Received: from DS7PR12MB9473.namprd12.prod.outlook.com ([fe80::5189:ecec:d84a:133a]) by DS7PR12MB9473.namprd12.prod.outlook.com ([fe80::5189:ecec:d84a:133a%5]) with mapi id 15.20.8466.016; Fri, 21 Feb 2025 23:47:19 +0000 From: Zi Yan To: Baolin Wang Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Matthew Wilcox , Hugh Dickins , Kairui Song , Miaohe Lin , linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH v2 2/2] mm/shmem: use xas_try_split() in shmem_split_large_entry() Date: Fri, 21 Feb 2025 18:47:14 -0500 X-Mailer: MailMate (2.0r6222) Message-ID: <7090090D-4E74-4A6B-9B09-D2045AD616F0@nvidia.com> In-Reply-To: References: <20250218235444.1543173-1-ziy@nvidia.com> <20250218235444.1543173-3-ziy@nvidia.com> <47d189c7-3143-4b59-a3af-477d4c46a8a0@linux.alibaba.com> <2e4b9927-562d-4cfa-9362-f23e3bcfc454@linux.alibaba.com> <42440332-96FF-4ECB-8553-9472125EB33F@nvidia.com> <37C4B6AC-0757-4B92-88F3-75F1B4DEFFC5@nvidia.com> <655589D4-7E13-4F5B-8968-3FCB71DCE0FC@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BN9PR03CA0911.namprd03.prod.outlook.com (2603:10b6:408:107::16) To DS7PR12MB9473.namprd12.prod.outlook.com (2603:10b6:8:252::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB9473:EE_|SN7PR12MB8435:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f0968d5-d235-49cc-de70-08dd52d21410 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MVhNZkQwTzkrSks3aHQvTnovd1hxUFJnOVdBLzhVanBhY2lNQmdSd0JGM21w?= =?utf-8?B?T00xV1ErL3dXdjd2anc2RmFQYjBkU2U1MG93eEQzdVpIczVzRUlnVzU4Q0xP?= =?utf-8?B?RmxuM1pqSkNOTjN0NmJyZXA3bVBKVFpsQ0FOZ0sxLzdKL0Nnd2RUejM5azB0?= =?utf-8?B?OXJNYkdSdVFZVmZFWHhhMElkeE5VcVdJVmtyN3p1WmQ3ZXloN0pJODlpckRu?= =?utf-8?B?dGNiR1RVWk56MzhtMUhCdEJUd1B0bk5DUXpzcDF2NzRJVXFlaHFDelBVczVI?= =?utf-8?B?WldSbW54QkhRZG1pbzRra0hkU0V0b2FFK0VkQzVmTjZnYWcxeDBCTGZudndG?= =?utf-8?B?NXh3eUZlVnpYNG9lZkY3WWNkYVpXK3JDNzIvWEROc1R4aEpuVFJRd0doWnFE?= =?utf-8?B?Z1NoVHkxUDZoOTV1SmtZLzNhREo4c3duTVdTZmdQUGJXeHF4OGRaK09qMkVR?= =?utf-8?B?bDlRR2hwQkZNT0M3S09aQ20rL3pMYTZDSjc0NEI3K2M3M0RKTkNESFUzay9G?= =?utf-8?B?QjVSN1lMbHJTamJWbUkzTTlQMFE4TEJnVFhxdDkwdXFjazNtVHpIOGVRUVAv?= =?utf-8?B?OVlUbjIvRS83K2dhaG13eHdmVERXU0hYUkZZcHJORFJmeDZKcDRTSm1vTUJt?= =?utf-8?B?d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MnprUTVGU1B0QlhLUkJ6?= =?utf-8?B?bEJxQlppSFNjYVNiaHQ1VXhMRHNhZ2lyZWFpQ0pwRytGUFlmTEpLdkRyTjYv?= =?utf-8?B?OHpLOTZKSmRQWVpDdE5yMEY4bmU2RzczdkZveGRDaWhLanJiNHlpNVhxYU9a?= =?utf-8?B?Q3BCTFh0YnVUeUl5UWVuTThTNFdXL2NSMTNOWjA1R1oxaFJhZVZBa2V2K2Rq?= =?utf-8?B?aHJaaTlaNUpCM0hJdEk0UWc0R2lnQmppNEtQbUQ3dmFNdllmaE1jMU5mUkpr?= =?utf-8?B?QlBWeEJyRXNDNTB2WGo1MmkyZDh5cFV0R2lUUElqbkMvZVc1Y3FGcTdoa3JT?= =?utf-8?Q?uhZlqp5NNk7T8?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB9473.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Mk5iWGVwUXk5R1VHeGtIMFAzQmoyQ3JIL2FqWHRtcFhPWXhkN254SWEyT2Ny?= =?utf-8?B?d0drQ1hBNHZiY0NaRWtrMklPbGpBQ3p5Wjd0OHozVWFoTEg4ajB4a3JEbDJR?= =?utf-8?B?Sm9nKzZEVElNenJ2dmtYZFdpa3c4SWdUTUNtbHlNUk1LK0diSjFQRkpXWXNZ?= =?utf-8?B?a0h1RkF2MmdqUjdPeXIzVElqQkVWV3Z4M0NrNm94ait2ZDZwazEzNmc1SXZs?= =?utf-8?B?RTNWRSs2L3NYbFR6a2YwNHdHemk1amNNeXRIYzNaK25BQmJNVjJvbVdwL3NQ?= =?utf-8?B?YmFFWUhIU3hvby9VcnVqNzVBNStZa2VEcTlOU25DMElSWGJzazhQQnpOcUdn?= =?utf-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X-MS-Exchange-CrossTenant-Network-Message-Id: 5f0968d5-d235-49cc-de70-08dd52d21410 X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB9473.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2025 23:47:19.0870 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TOypr5lbWQa26wYkQ1DILYTBg/LhGEO+3tnHfYM11aN4VteYRgbPPYOoMEx/yR0I X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8435 X-Rspam-User: X-Rspamd-Queue-Id: 0D6C740011 X-Rspamd-Server: rspam12 X-Stat-Signature: wf1uejeczwbgye4go145ijg43das8shf X-HE-Tag: 1740181643-626326 X-HE-Meta: U2FsdGVkX19UhCPVhIK7kRfaMYXxlavrmdTYEiIWAorjYpyLJCK4/JQw+1yXjpN4xTPhkPNvxeIWoYv+2QRzglC0+W7ZkdEbyyWyHDcQ8MOZFhtgGv3Mgsu+2mKcUA7+bfIszqv+Mt5wklwNqCv6q8x8IgNN95mdr7w4+bdC7F7G4PPxgrhNn7y7BLb5ftLP26Yd6XoXPUySta686RCOF/jYpfdVzxWxZm6GAvWHNqzzLOUEPF2m1eg1QHyNqYlqO4E+IPUyzhp2B3MhUCi/2hV3p6YowYKp8DMdb/xNkJwra3xI3sjzZJ0eU88vDDdwyYzYEz/DVky8ARwyZAatuH6lvCVjdaP7j03ldoAmAggOpFh9Q1WglKAnC50YZhE+0xnBYnzAbZTpREbkwhxLwAB26sqUTzBUT2jnjd7Bz7KVP2lF634KhSqFDpsNsWxHZpCnrEZb8PmstB2hGy2hc60bN3p5nTe7Bv+tBAOSKiVBH1NGGQSSxNhcV2xDrCHwPHbSnK35MJStqTzGFRO7Qpg/dQjEV4nguSBtaEFw0YlusXvB97CTJtOA/BlyFIXL4Ocruccwz6N9z8NaNxnmk2WUiq+3MQdowh7KtUkc8kmOb01tfyDZ6W8PkK/iwUUPxeGqKBalC7wmLcLppBMUdnX49rL7fYRLiBDUvF4yXu8SyGSt57ewAsOI4eof0NwTSXonhO4ZsFV0ehxHIy7j6qAUwx5UjFM233qpWEk2d7AC2Rb4s5FNRgCC6AijT+kRHR0X1Z+2NSYyGRUUYfliGUVsw36cDdMNyUiC/Lj6rNc3kxJJ/vM1DlhG46fnhUK1tjd7iDpBy3DPZLx4XjEtWab1Z9rhJSmVYuZHOpMYj26Kzb5i54BZtzvthlRonuXXwu8Lrgsep6q2XEtO7SZGrVQwqoAIIzuLW0XsQUNEVa39eJZqCgEZCSFJNwdDijPPamrj8upQfQdquYybyaq bFABg5Jc vC9vs3VyRQwnHi/V2eOit+j5FENm7ETm2sE3SpLk5Jv1pc/kJckMvJNkReSqDvjwrzZdYuAJkuexoPuC58HCmOuNOYuCDtneL61GbcF7ylsqgi8AgxnJ1tlVJBA0AFhpMLwmt+xGo1A5wRKbS9aa9xSA3WQkCGwSwfkXIkeDEs8KBp3o/Iq1w7EnROtD7gmDtOqKsFZkRt9CGqWcSEDRhZp1a8xf3kw9QpHKm1sD8+gS2C4y6NJ5QRvba91jeyJQZZB7iCeLn/A66yTSuLZYussHbTZIgBdRQ+2vFgBdAbQjWYLYzqTDAmz+BHFRf6Qk7t80beuRnL6BPZ0HKLZyxCOfS0tqow2ILT3etCEJneTYnfMwh5SI2gl1UnQ== 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: On 21 Feb 2025, at 1:17, Baolin Wang wrote: > On 2025/2/21 10:38, Zi Yan wrote: >> On 20 Feb 2025, at 21:33, Zi Yan wrote: >> >>> On 20 Feb 2025, at 8:06, Zi Yan wrote: >>> >>>> On 20 Feb 2025, at 4:27, Baolin Wang wrote: >>>> >>>>> On 2025/2/20 17:07, Baolin Wang wrote: >>>>>> >>>>>> >>>>>> On 2025/2/20 00:10, Zi Yan wrote: >>>>>>> On 19 Feb 2025, at 5:04, Baolin Wang wrote: >>>>>>> >>>>>>>> Hi Zi, >>>>>>>> >>>>>>>> Sorry for the late reply due to being busy with other things:) >>>>>>> >>>>>>> Thank you for taking a look at the patches. :) >>>>>>> >>>>>>>> >>>>>>>> On 2025/2/19 07:54, Zi Yan wrote: >>>>>>>>> During shmem_split_large_entry(), large swap entries are covering= n slots >>>>>>>>> and an order-0 folio needs to be inserted. >>>>>>>>> >>>>>>>>> Instead of splitting all n slots, only the 1 slot covered by the = folio >>>>>>>>> need to be split and the remaining n-1 shadow entries can be reta= ined with >>>>>>>>> orders ranging from 0 to n-1.=C2=A0 This method only requires >>>>>>>>> (n/XA_CHUNK_SHIFT) new xa_nodes instead of (n % XA_CHUNK_SHIFT) * >>>>>>>>> (n/XA_CHUNK_SHIFT) new xa_nodes, compared to the original >>>>>>>>> xas_split_alloc() + xas_split() one. >>>>>>>>> >>>>>>>>> For example, to split an order-9 large swap entry (assuming XA_CH= UNK_SHIFT >>>>>>>>> is 6), 1 xa_node is needed instead of 8. >>>>>>>>> >>>>>>>>> xas_try_split_min_order() is used to reduce the number of calls t= o >>>>>>>>> xas_try_split() during split. >>>>>>>> >>>>>>>> For shmem swapin, if we cannot swap in the whole large folio by sk= ipping the swap cache, we will split the large swap entry stored in the shm= em mapping into order-0 swap entries, rather than splitting it into other o= rders of swap entries. This is because the next time we swap in a shmem fol= io through shmem_swapin_cluster(), it will still be an order 0 folio. >>>>>>> >>>>>>> Right. But the swapin is one folio at a time, right? shmem_split_la= rge_entry() >>>>>> >>>>>> Yes, now we always swapin an order-0 folio from the async swap devic= e at a time. However, for sync swap device, we will skip the swapcache and = swapin the whole large folio by commit 1dd44c0af4fa, so it will not call sh= mem_split_large_entry() in this case. >>>> >>>> Got it. I will check the commit. >>>> >>>>>> >>>>>>> should split the large swap entry and give you a slot to store the = order-0 folio. >>>>>>> For example, with an order-9 large swap entry, to swap in first ord= er-0 folio, >>>>>>> the large swap entry will become order-0, order-0, order-1, order-2= ,=E2=80=A6 order-8, >>>>>>> after the split. Then the first order-0 swap entry can be used. >>>>>>> Then, when a second order-0 is swapped in, the second order-0 can b= e used. >>>>>>> When the last order-0 is swapped in, the order-8 would be split to >>>>>>> order-7,order-6,=E2=80=A6,order-1,order-0, order-0, and the last or= der-0 will be used. >>>>>> >>>>>> Yes, understood. However, for the sequential swapin scenarios, where= originally only one split operation is needed. However, your approach incr= eases the number of split operations. Of course, I understand that in non-s= equential swapin scenarios, your patch will save some xarray memory. It mig= ht be necessary to evaluate whether the increased split operations will hav= e a significant impact on the performance of sequential swapin? >>>> >>>> Is there a shmem swapin test I can run to measure this? xas_try_split(= ) should >>>> performance similar operations as existing xas_split_alloc()+xas_split= (). > > I think a simple sequential swapin case is enough? Anyway I can help to e= valuate the performance impact with your new patch. > >>>>>>> Maybe the swapin assumes after shmem_split_large_entry(), all swap = entries >>>>>>> are order-0, which can lead to issues. There should be some check l= ike >>>>>>> if the swap entry order > folio_order, shmem_split_large_entry() sh= ould >>>>>>> be used. >>>>>>>> >>>>>>>> Moreover I did a quick test with swapping in order 6 shmem folios,= however, my test hung, and the console was continuously filled with the fo= llowing information. It seems there are some issues with shmem swapin handl= ing. Anyway, I need more time to debug and test. >>>>>>> To swap in order-6 folios, shmem_split_large_entry() does not alloc= ate >>>>>>> any new xa_node, since XA_CHUNK_SHIFT is 6. It is weird to see OOM >>>>>>> error below. Let me know if there is anything I can help. >>>>>> >>>>>> I encountered some issues while testing order 4 and order 6 swapin w= ith your patches. And I roughly reviewed the patch, and it seems that the n= ew swap entry stored in the shmem mapping was not correctly updated after t= he split. >>>>>> >>>>>> The following logic is to reset the swap entry after split, and I as= sume that the large swap entry is always split to order 0 before. As your p= atch suggests, if a non-uniform split is used, then the logic for resetting= the swap entry needs to be changed? Please correct me if I missed somethin= g. >>>>>> >>>>>> /* >>>>>> =C2=A0* Re-set the swap entry after splitting, and the swap >>>>>> =C2=A0* offset of the original large entry must be continuous. >>>>>> =C2=A0*/ >>>>>> for (i =3D 0; i < 1 << order; i++) { >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0pgoff_t aligned_index =3D round_down(index= , 1 << order); >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0swp_entry_t tmp; >>>>>> >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0tmp =3D swp_entry(swp_type(swap), swp_offs= et(swap) + i); >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0__xa_store(&mapping->i_pages, aligned_inde= x + i, >>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 swp_t= o_radix_entry(tmp), 0); >>>>>> } >>>> >>>> Right. I will need to adjust swp_entry_t. Thanks for pointing this out= . >>>> >>>>> >>>>> In addition, after your patch, the shmem_split_large_entry() seems al= ways return 0 even though it splits a large swap entry, but we still need r= e-calculate the swap entry value after splitting, otherwise it may return e= rrors due to shmem_confirm_swap() validation failure. >>>>> >>>>> /* >>>>> * If the large swap entry has already been split, it is >>>>> * necessary to recalculate the new swap entry based on >>>>> * the old order alignment. >>>>> */ >>>>> if (split_order > 0) { >>>>> pgoff_t offset =3D index - round_down(index, 1 << split_order); >>>>> >>>>> swap =3D swp_entry(swp_type(swap), swp_offset(swap) + offset); >>>>> } >>>> >>>> Got it. I will fix it. >>>> >>>> BTW, do you mind sharing your swapin tests so that I can test my new v= ersion >>>> properly? >>> >>> The diff below adjusts the swp_entry_t and returns the right order afte= r >>> shmem_split_large_entry(). Let me know if it fixes your issue. >> >> Fixed the compilation error. It will be great if you can share a swapin = test, so that >> I can test locally. Thanks. > > Sure. I've attached 3 test shmem swapin cases to see if they can help you= with testing. I will also find time next week to review and test your patc= h. > > Additionally, you can use zram as a swap device and disable the skipping = swapcache feature to test the split logic quickly: > > diff --git a/mm/shmem.c b/mm/shmem.c > index 745f130bfb4c..7374d5c1cdde 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -2274,7 +2274,7 @@ static int shmem_swapin_folio(struct inode *inode, = pgoff_t index, > folio =3D swap_cache_get_folio(swap, NULL, 0); > if (!folio) { > int order =3D xa_get_order(&mapping->i_pages, index); > - bool fallback_order0 =3D false; > + bool fallback_order0 =3D true; > int split_order; > > /* Or update major stats only when swapin succeeds?? */ Thank you for the testing programs and the patch above. With zswap enabled, I do not see any crash. I also tried to mount a tmpfs, dd a file that is larger than total memory, and read the file out. The system crashed with my original patch but no longer crashes with my fix. In terms of performance, I used your shmem_aligned_swapin.c and increased the shmem size from 1GB to 10GB and measured the time of memset at the end, which swaps in memory and triggers split large entry. I see no differe= nce between with and without my patch. I will wait for your results to confirm my fix. Really appreciate your help= . BTW, without zswap, it seems that madvise(MADV_PAGEOUT) does not write shmem to swapfile and during swapin, swap_cache_get_folio() always gets a folio. I wonder what is the difference between zswap and a swapfile. -- Best Regards, Yan, Zi