From patchwork Fri Jan 10 06:00:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13933705 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 9E048E7719D for ; Fri, 10 Jan 2025 06:03:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 307EB6B00B3; Fri, 10 Jan 2025 01:03:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B6BF6B00B4; Fri, 10 Jan 2025 01:03:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BCF06B00B5; Fri, 10 Jan 2025 01:03:09 -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 E0DC36B00B3 for ; Fri, 10 Jan 2025 01:03:08 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8AA38140846 for ; Fri, 10 Jan 2025 06:03:08 +0000 (UTC) X-FDA: 82990499256.11.228FD65 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2068.outbound.protection.outlook.com [40.107.93.68]) by imf28.hostedemail.com (Postfix) with ESMTP id B8412C000F for ; Fri, 10 Jan 2025 06:03:05 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=QKr+00fB; spf=pass (imf28.hostedemail.com: domain of apopple@nvidia.com designates 40.107.93.68 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736488985; 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=vjp6m1j2W9OFBUPeqNP0AlhzXfJRFG5q0VazBoZoLDo=; b=kawCC/9qgIkJEYOhiPWuLGLr6rlM6hYzLGPb2CpmAoXjQvdTXjVWrrxSY8YhxFnlBJSqeV JFfv9hr6D5basehq5Y0XP9yJ2/G+jVa+fYAoxcUltvUWXdpRQgH82yr8lPby1Tv6Awd+I2 nbry1D+nTSN5tTXgdX5VeI6QKQ7HhZY= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=QKr+00fB; spf=pass (imf28.hostedemail.com: domain of apopple@nvidia.com designates 40.107.93.68 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736488985; a=rsa-sha256; cv=pass; b=fVj5KQOV8DNR7wa1RgplwYScD+3mrFT99IWOaWsoQBgwgEA3qH62bgt9M+5tYSOHvfsXGQ CuEFeCZg8VDq+sgbvkhrdzkZDJJ00VQs63KK+oSXMzfG9qZKp4NcMbjqIIzxNNeuAt6pkE GBT3i7nMRkjeZtnmyqjlQJJ5ZS6k5EY= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZcCFUIQfTmGAs2iJFzuF8OhJltqNIruYM15wbS+XzYtcB1Ziz/CKQUBrGnJs0vH19fKmzBIVmU5MH+DfYtzvsB9nqiKOU0NeYYyh7SjXhkXT1bQt7AwUTn6lkKC1QeZm2LSy8BDhrzcUY3QW5mijrKC9ua0GZwO6ZEmpNVTtA/SPhcOb8IJGtv2uHLtsLhznEhpMFyyk9BsK4dqG1f2yRGQ3JWC5ykSz28zEZADHoEN2jjtPIt0z+6SxC0soZPJwvLK2s6yZM9MXFHhtCMPnFeYkDxt7i4E62+eZcqEZ4zW01taszeoLWqSMKC1oh5/jsADCTzibM869RcAaqxUdvg== 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=vjp6m1j2W9OFBUPeqNP0AlhzXfJRFG5q0VazBoZoLDo=; b=OoEfWt7qnzdrsso9pqMotrrpUWFGFQ4qXwRRIeQdRjaSbE6tvInhN4c4AGgOIE75AsETpGFHWPLGg1FhdehHEUO6uG2I6bvvq0t+G29+EgvcZLPz3vpICzwWlsHS7NQLfRmj+TdKU06nsSXrPuUcDy18d57th6L108pug6qPs0plz//ode9O3jOFSdo7++Pl35o5aVoC/bwaKqSRwIFnkT/KFNUhbWomUV1cwfM4u94LlNVE3Ru72rcb6vwmVNkFUZ2+PdJ7jmlRfosEKfBpMrCIoizUQFjOs2w/AmvR9WndFT8hBTcUhJxXWgI+1VTFyl5iSWd/cE+Eo86Bkk/o1Q== 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=vjp6m1j2W9OFBUPeqNP0AlhzXfJRFG5q0VazBoZoLDo=; b=QKr+00fBefzYTJp7tq5iChuIrlzvuqh52P6AqX/dqLUUnBG8GsL8urZwTIOj9LRMhyc92vbRp/RAznKicirLxd6+k/DXAVYK40RMNeN15vzkCm4fDpnNuRiyvrRjHazdFuHRZG8TdDPg/XyxA5w2JYu5VX8KzwybR5oa/e5OLU31Ax5ipBzpx4gPBHXll5XdhftLhG1Tij0A1Va8sAuLY3ZUXWsTeJEw/WeYQMPcKbAUtsiju+j01R9lLFE1LfDCC4P3v/kZizC52d7mhc2sYtrbY9r1WadKpFflxuBqTj3KLngdxaPOo+561eiDe3e6M0CCXtYTftgkOiTUMY85cQ== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by SA0PR12MB7002.namprd12.prod.outlook.com (2603:10b6:806:2c0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.13; Fri, 10 Jan 2025 06:03:03 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%7]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 06:03:03 +0000 From: Alistair Popple To: akpm@linux-foundation.org, dan.j.williams@intel.com, linux-mm@kvack.org Cc: alison.schofield@intel.com, Alistair Popple , lina@asahilina.net, zhang.lyra@gmail.com, gerald.schaefer@linux.ibm.com, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, david@redhat.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com, chenhuacai@kernel.org, kernel@xen0n.name, loongarch@lists.linux.dev Subject: [PATCH v6 20/26] mm/mlock: Skip ZONE_DEVICE PMDs during mlock Date: Fri, 10 Jan 2025 17:00:48 +1100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: X-ClientProxiedBy: SY5PR01CA0110.ausprd01.prod.outlook.com (2603:10c6:10:246::8) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|SA0PR12MB7002:EE_ X-MS-Office365-Filtering-Correlation-Id: afa4d788-8ee3-44f5-be5b-08dd313c71b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: uS5EiES9d3/74tjwqgbjPXKb1tMMWwLoBPx5/VZ2LB6BO77fx5M2QYCfMBnXIjHqxhbf7wR7N0AbftIrElhTp3N2jkjPk6SsLisHctmf2FhBu1+uzmK5QBqoCfelx9+dIK4hTDSgAsLHhVl0LxiH/OIaGVLNr5B8dcJH/hrhyEziPk2YexWEQKjMaNBP1ffxAQIpS5tb/3/fi7COtGdAHKyhy6sTsF9yPAgBhmss2hx/PuOmccvN7uwYRNufTQfu1bR1/mkI8eLsjTbBSk/iMxUaUbbHj7xKLndl76EAZG8mnR4+7I1SknlaUQb1sirJ4cLpaK1yNe35LybpZ2KzyPKdTiHHh9476pRkQrbQdcsZ/oIoJoTQZLrEHT4xsSUcmq4lamEcxS2fvGICQ8d4yXoFkJZsbt7PcUOVu6HVGu7vRSErBVL0YwrDc6P1O2KUTftK4xmQlJ3LQpkceCr7PGqdkGwV6GAZ6OWnTikwlqC3lfm42iYyQlpEFwMsSjMUOgoFDkisV3lB8GG6Qk1ADDaWEJ5f1vJ686uyqD1Q+IZpQjpQKjhYaQ5NGIoEWAknWR+10Mtsn6t/+dCV7cr8fS1ioXgSc6pSphAm3BOL4IZt7+sQFaDhRuMzMiWn6wk73MHii2buVTynuMFJtdlW0uHlt7t8dG45p5WfPmfFuuvW/B/qZHRbn8qEBbgh1XQ31Ln5oTu2qArPwe21v+HybiaRQ80/9bdINbf1cQ4vK3/EthyNjG/Hv/CYXxpwZclsCOfZTSpjr2HC+xrBMp/2Q9M1LXT27s/Ah2o1/sWoJrVAmUD2z4Rdglof1ldapP15xUi+imaC7Cmm900VNN5H1zMpw44ou9WmCrXfmLpBw9vRcoFFO41eg4ux5kK5cjHxYhNrjMvslcT3U4kAmQDTXtwxefO7rx9/3Ybdskk8us0nYbmZyPC6Dd4tnQWGxtwgI3PCSOdZS5/jirdv/dk69vZaqbxsIfJqWpLZhp4Dl6vSLVTFCm+xkk2YspPmaC8ldguKIsRuILwcW8K5VaEny/XUcCHkJk0SVw6Fu2/qpZu+l2nHceTwfCiA1IBoqZjMG3bnxMT3jSUPzXp48yDn2MbYPJ84x/OOP9wyKk5CW1SNld/ob4jRIFfJ8GxZ26VbX3uUM2E3KpCkT8KEZ91v2HL1nC98iAHFMRhHVe7D7s0kxUpiHrAuPjVhFqg8GkFXVmnQY/kvDmZ2EuiPaz1+JJwvjIbJuo9J63gaSdTcNHGJIo3IAqbKq0vR7UO5MpacuOTEyfqiU7hgS+w8DWtN3XoL6h8h6sFRr3xoMRBVdgPHcSZFFdcIkSm+B8n1WquSTYTW3yEqSZqZcOnUormw0pqpF/cdAsdqnWKR2BotABY4Cnui2qd3nuz2iXcd5Tvd X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB7726.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSp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jFmYUHDOOX1JWyt5lG6e5NFcCyewu1c+8hOCXzfBCXVPiUJ2+JOOpuooFxxk2oUe+huj1PdZPhMyVQIbOzoANQzspSmdJ0P/Gt1Rr2C/eRoU7ZHqewjsMXfcx00zKC5o7hR6A1W2Z0TuEbMrpqO3pC8w9wA8U5vL8UeWSyc1k5896G7plMYfQ3nfkhxXBWYkV52ArAFZnP1V6a6rpPfxG8GaQpsEFDC40Pckmj/7SWtkrZvTJvE0hsCVFG6vuVTGu9vzAvW7lXY+IDIEIgBimoWTiWVmVEs7qVZo9p7Vso/RMFyIiQfNxROCiZ2PRu8WchXRu9mbzQmO7U7SG04GC0Z5z1Uv6mTYBMX7mAMEufXv14uwHrvDNUk12qjkRNSYekcthtHY4Ibwkd/Y8TU8EXabdIAeDGWlF3yHTtGOmSiD3hLeKpmCRQy1bLuw/lQWMWplvzpv9bEec9UCeBw88R1uQzE/MRpIc17x68dp/DLHduCT5AHyB6F4GCXSNX+/0IOjhf4gTuCdfq7CEiSXsk X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: afa4d788-8ee3-44f5-be5b-08dd313c71b8 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 06:03:03.3250 (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: LG6biLSqoKt4cLY4S8ShavfRhAIL0kQr11bOyLlTWefO8Fvz0a9jMErzwprAX/nSk8i6i2DEdBT13HF4Rat2Zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7002 X-Rspamd-Server: rspam05 X-Stat-Signature: rgzeefpch68c3m55gom7beeim3ig19ao X-Rspamd-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DlqybC+OArDG+WKNcV2UwI5jsnyUDne9msrsZ6UZLVAXAK87Nw2NEkeltJl9ovgioT3p7mX+BXys3G6KTq6K+cztXhGQl4QiCm2+ghnPAXQUprUX4vPCKAXR+c0MDSfnn5WrQ3xMR9UY1faND223aMiA9AuuipKCkykPkGf2wehUSj6ZRip5crx9JTtGBzcMBHkhCAwVpYKU0NUmRr894Ijxuv1g0ID9UIN2ovvkUSmlk/xj1RPwktlXsDytEuI0WGYlpIYCPX/RdKC/9CabSCemgP2PPxBQabmAlQHP4jiwmkVoKaXUVUGFr8VVhH72lnYoRj9N0R/sTIcRU0Y92j6RauR9u0WuWD1W8owMG6IRVQMYgGYPveGe7n3Mjwk1tLytcFD2MI67S5ibiva7dqgaNvKMKMW0eQuWOSEXBr066XBR2wfBXQWndAvoH6QmnjjcjAfc 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: At present mlock skips ptes mapping ZONE_DEVICE pages. A future change to remove pmd_devmap will allow pmd_trans_huge_lock() to return ZONE_DEVICE folios so make sure we continue to skip those. Signed-off-by: Alistair Popple Acked-by: David Hildenbrand --- mm/mlock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mlock.c b/mm/mlock.c index cde076f..3cb72b5 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -368,6 +368,8 @@ static int mlock_pte_range(pmd_t *pmd, unsigned long addr, if (is_huge_zero_pmd(*pmd)) goto out; folio = pmd_folio(*pmd); + if (folio_is_zone_device(folio)) + goto out; if (vma->vm_flags & VM_LOCKED) mlock_folio(folio); else