Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2715768rdh; Sun, 26 Nov 2023 17:06:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLqtsGeqNfdFSnGAvHh6Wfb5nxuFXYD9cPFDAxTUmCs7X+O2uR/hdqzsvRZVmijRUnzgGj X-Received: by 2002:a05:6a20:d70a:b0:18a:e7cf:7be with SMTP id iz10-20020a056a20d70a00b0018ae7cf07bemr9035654pzb.52.1701047205418; Sun, 26 Nov 2023 17:06:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701047205; cv=pass; d=google.com; s=arc-20160816; b=O1TCaDJ/PN+lDXWHKDQDCjBmSM1y79LwQ0UKWQTMWZo7Zmuyov0Eo7VMUvcJG6NQr6 ZFoyUbdDH1B+HnFGKx1Q9ISWJ82Bkk5lbY1TYM2t5I334vhkYX6D0QJmL4mw7tB9kJGX jeZYVp+dR2hxPnX3CfpvXiNhs66TORomEQXHdbJx4ucxmhqvfhikkDglUtMGo8Nmua4f DqwR3rwLD/WfDTzRpEOXuqrPvzGcR7hM8w2LwK8QV246pivl5I5fP5vr5uk2MjAiV9+I BB87Wsp+tW/U9PElkFCFrs7lx/mhh4mBhEQAfPFjmR0zJd4+xvzhQpU5frFm6al7iej5 pVQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=pFYAwb2uHkRzfJiUT3Q5WIZy/cuNKmc5tHQfzHPzR1M=; fh=AAbN07OObuniqk2m/baCFp83JTzyEnO19gxoqRURxCk=; b=elLBugsf1KvuGU6Kr93zBcVD3ZXrE20qjAZoSksVKKu5YejuaPOJKf2ZLSwJWI4QyN NO3uLNcaXPBQttv+cxii7me0p5iwoGKXp1guSRfzEiM8+ZHUayZoabV7j7e6xAbSJtlN aPyH0EsX/6FK0/vMcSiwvHMtMCwZAPPpNuNsNtohOnLggDL6wy3aL6tf/U0v7uYYCp05 8Sg7oPNT2E7TyfRRV92wC3m3ErK/1nczROMThKvTGf7r/CkIDmguTtV4Tegxu9t5AR1k ECDTd7P4NzVGWkUGdE8DT/+GS9veXgmZXsWlmolsrZzeXgnKVq0GNS/TTfHYX5C/MoJq 8VFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b="kV4YxyQ/"; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v14-20020a17090ac90e00b00285ab9d7408si3485248pjt.29.2023.11.26.17.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 17:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b="kV4YxyQ/"; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 24FA0807215C; Sun, 26 Nov 2023 17:06:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231143AbjK0BGF (ORCPT + 99 others); Sun, 26 Nov 2023 20:06:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjK0BGD (ORCPT ); Sun, 26 Nov 2023 20:06:03 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12olkn2089.outbound.protection.outlook.com [40.92.21.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B949C; Sun, 26 Nov 2023 17:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CxkJdp0QRv/hMqZecdVzYfhXFjUlCUoY4cQn3np5omlij+F1431t5kPC0Cm4sakgbGkR2BUQCGTvacyqjkgmiSxlnQ/SGk+40Q/0xe5/rh2+uQpfPEDq8GrC2YRLZLbO4VGYXobeUTP7sd40zWS26ocSQq6Zgh8gQ5IwmECSWC5IRd7bDnLVu/TRujGsaVAsuxY81w0ZCQ4rMNBJM4SUIyVv4NBnq6MKYEXDA3ovS15fGbX0TqamKq0h+x9/uSyAnc6JVKD/M3ig14w/bw9QuoD/a3kdZAWA2lpjuLg8xk42AvJRPeoxrJtmn2HsLZhU2UhMYKDlqW4sDTZUje0PWg== 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=pFYAwb2uHkRzfJiUT3Q5WIZy/cuNKmc5tHQfzHPzR1M=; b=aqXWnduc3ZtEsDsNDZ1VPkHomTSXiy2wDOnZqAXsrdXFobPRJRY5rZLmMTzSXz2fgLk/AHHlZTP2QI1scS7bTDK3mNfia9rtj1fL+oYv1k+eCsxBIylI23A30FFSsMuzEzlPleqI6YiNKUMXMZceLK4kB+l1pb4wnOWr6UBtvuU8YPrJbScYSTf2pL10vCJBvI06v3rNwOzJPM+BP8qx90B6KHg0o2b1g+GUWUEPUV0aDHFRfT1J90EeXJuxT9PWSBHr+IgjTf/xtF1fEUCc45rmQnc7ZXAyMGWxRh50qjYqTRdKASZ9nINCssYscD7GJceAh0LKjxIHotFWDva1Og== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pFYAwb2uHkRzfJiUT3Q5WIZy/cuNKmc5tHQfzHPzR1M=; b=kV4YxyQ/vQuFMxkfKtody0jFeObI8OkJDLGfF7J1D7uhlxnGr0esC9YmT9k+pp9oLpb5YUUGfJoXrQrl+fh9Q5jc//Zkm5O7uhRH02wpB0HTMFpN1ewNh0Oh8LFLKIoNqJUp6hSjHVBpRkEhmMaTtRo6v6yFqqT3hMlZJJskzxBqZ3gguuo8UEJEy2hSdM6SXKiYVhsLkDxrtcIQPQANU7GJsH2SfZDh6L5IIzHyWvi2bLx1qC5B5GFz3cFOrHXC+R9j7j0cKRGiMowct5s4xXTvwb+HRMR67y20kXNlz2erWPB3NfONn+LKpVGXY7Lve5dUWLGLcpAZ2ybo75LHog== Received: from SN6PR02MB4157.namprd02.prod.outlook.com (2603:10b6:805:33::23) by DM6PR02MB6859.namprd02.prod.outlook.com (2603:10b6:5:211::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 01:06:06 +0000 Received: from SN6PR02MB4157.namprd02.prod.outlook.com ([fe80::54e5:928f:135c:6190]) by SN6PR02MB4157.namprd02.prod.outlook.com ([fe80::54e5:928f:135c:6190%7]) with mapi id 15.20.7025.022; Mon, 27 Nov 2023 01:06:06 +0000 From: Michael Kelley To: Christoph Hellwig CC: "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "hpa@zytor.com" , "kirill.shutemov@linux.intel.com" , "kys@microsoft.com" , "haiyangz@microsoft.com" , "wei.liu@kernel.org" , "decui@microsoft.com" , "luto@kernel.org" , "peterz@infradead.org" , "akpm@linux-foundation.org" , "urezki@gmail.com" , "lstoakes@gmail.com" , "thomas.lendacky@amd.com" , "ardb@kernel.org" , "jroedel@suse.de" , "seanjc@google.com" , "rick.p.edgecombe@intel.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "linux-kernel@vger.kernel.org" , "linux-coco@lists.linux.dev" , "linux-hyperv@vger.kernel.org" , "linux-mm@kvack.org" Subject: RE: [PATCH v2 3/8] x86/mm: Remove "static" from vmap_pages_range() Thread-Topic: [PATCH v2 3/8] x86/mm: Remove "static" from vmap_pages_range() Thread-Index: AQHaHMCcNHra+kumRUKExlyvEEqwbLCF4AyAgAEpOhCAAHuSgIAF2cCA Date: Mon, 27 Nov 2023 01:06:06 +0000 Message-ID: References: <20231121212016.1154303-1-mhklinux@outlook.com> <20231121212016.1154303-4-mhklinux@outlook.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [8sq0PsiZIh4OiZxFtOxeEFKLYajZBv4t] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR02MB4157:EE_|DM6PR02MB6859:EE_ x-ms-office365-filtering-correlation-id: f9e86026-9ebc-435f-1284-08dbeee508ad x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uUczENZUO9tU8KLD4eO5/4JTMPNPddsExLkMHuBmza2d0sTIjV5lHDUU9QhIACQS9iJqsnDv0dZNNEgIGcRYua+SczxeXNBJWUxTVqdTVL5Xcz/LT9dlwt1OBspKO5vHaqsnrpYDNFLacYWtK/s1lK+i9fIMTP7kVHnRF0wfq1dmeqd1pZQ6S3h+oTvw2BX2C+DSrKEEsXulytpzwHgfiupEz71p/jeL38K/YwrZinqf85qOt31PKAZ6gUzh2WlVa1uJfiClVd8VHxqxqZZyxEHTF7hCChaK/qjQuu6jRt326GfyK0C/1gzgFh2Ij2QhkRHUtf5V6oY2mbQ4zVw05Hj/bfZjiddZwS0V8pPAwjrSSlZDw/HilQ8aKWxAqS0YUqpnYlbOgpE5rTtdCDP35UX0yeo3ha2FfKX5OsfezyRzyJ6PmirFW6S687Aq+uY7RYrE9/728Xe2Br6h8yTES4PMosxj2TkKyLYXSczOP5/oiOB4nPTqg7SH2hPTFPISsDKOfyIrU0/DnNiNFKRfuKq7iXGIRnG2WyaimK55jh/CkAbElyuR13R0c0PxpeWt x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?QNm+2Y/9H9BB7qvg69Bb9JgxlHERT+21UEB0/HpEFAXEo0hkBMglPFWxaF02?= =?us-ascii?Q?UvXvy1gXsspLeE7Xx9k4DSv6T616ezIh+ynd831TTZLP57MGdAAR+ThXdF3f?= =?us-ascii?Q?9pML6cwrjbXn1+bhINM8Vf/87elx1aieCm/99bAwRiAN964h4Coep2t/qxpa?= =?us-ascii?Q?H6Z61MZ4t9xITThEVWYyyH4Xn8nBG5DMEkhjhn3dJlvMFIK8cyLPWpKDx7jp?= =?us-ascii?Q?FV41DSbkupMfJDHd/18I0jdijD2/SL4OefrIcRHUtn3Tij+sWT+1tcBtQcw3?= =?us-ascii?Q?v2p7jlS/jk1hEdA/2tuINH/tYRCTF6z0NA07/bcnKDgQrHpKjh/Xf6p0AxLG?= =?us-ascii?Q?olluCCnfqLHg1l1OyopHNItcLtsL5GGXLZcGLI7EYqlWmnmeA/CFO4LbADBb?= =?us-ascii?Q?neKYuDYlrn/z/sHmZCvPILk0elP8I9kESegKwT/13XS3QaCJaLFINJSlUt4j?= =?us-ascii?Q?RFR5WXys6Mxd/PyJ6vf5RWqyXxKybEPMMgB6wVcKJMAemB+Nef+4Zmusd2eb?= =?us-ascii?Q?GKQGkBHuxWp51pXshzXOjPI34a5RAEqO6ZTDDNeNCiwfRAt+akATzloks98x?= =?us-ascii?Q?Cn66onciJwI2MTKnZ2KWz/5BDy6YCANQm7RckIDYgzZnq0QBtXamnar3y3ny?= =?us-ascii?Q?AvEVHTq0UoDMaaDY8IcjySsojwTe+vcaYcFR2uS6RgGZA1HI4S1FsSsvbBhj?= =?us-ascii?Q?XFb5CbXxJygUBjP0D4fD+nja4A0YL/4fbWSVSFE+FPKC1eWBE/KTab8elza5?= =?us-ascii?Q?GUXBUyGfzt5bugQNSap8LpetHPvbeX7bLGkYvl6qfzt5IiNN8BS59qiWhQ7p?= =?us-ascii?Q?/z96y1zwxZd/G6Y+FrEummobaO6/Tjw0hka9GWo1oa+PSb5yIVCDLz/AQFsj?= =?us-ascii?Q?Eg6jeb8mbiBT73rc2jrBSGQ+eOEVwzR6AGUzfofmInM5mKvlKW81Spf7wcIb?= =?us-ascii?Q?Ymc5FUuacM2P2/BIgKHCaOJE4Udew1tFDvysXjZ8Y7enEED+ZzjhYgt6ejm4?= =?us-ascii?Q?3ClWJtCi29F5PeZs2o+5PF05pOGZyNDhwOIgBOd0bmP+jQNxul8O3JYRc5sA?= =?us-ascii?Q?OqoLOSg8QrFpyeVnjZECoBVNcEAghPuOBG7QKTI+r8l7chThz5xhp2MVMJ7g?= =?us-ascii?Q?/NbT196UaWh9r6SHmdlxkY50J3RsZQ0YUNcjtCOdr16vV93/ZudJewsjr8Yc?= =?us-ascii?Q?bmkRKH9EkQLE0er71pDjY1RiCa0lYY+7822PSA=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR02MB4157.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: f9e86026-9ebc-435f-1284-08dbeee508ad X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Nov 2023 01:06:06.3058 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB6859 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 26 Nov 2023 17:06:17 -0800 (PST) From: Christoph Hellwig Sent: Wednesday, November 22, 2= 023 11:32 PM >=20 > On Thu, Nov 23, 2023 at 12:24:49AM +0000, Michael Kelley wrote: > > > I really do not want to expose vmap_pages_range. Please try to come = up > > > with a good way to encapsulate your map at a certain address primitiv= e > > > and implement it in vmalloc.c. > > > > To clarify, is your concern narrowly about vmap_pages_range() > > specifically? >=20 > The prime concern is that it took a lot of effort to make > vmap_pages_range static and remove all the abuses. I absolutely > object to undoing that. OK, so I assume that means a new variant of vmap_pages_range(), such as one that always sets the page_shift parameter to PAGE_SIZE, is also disallowed because of the same potential for abuse. So the only way to map a system memory page to a vmalloc vaddr is via vmap() or some vmap() variant, which always creates a new vmalloc area via get_vm_area(). I've done the perf measurements, and that approach won't work for this use case. Independent of the alignment requirements, the churn in creating and removing a lot of vmalloc areas has too much perf impact. The use case needs to create a single vmalloc area, and then repeatedly map/unmap a page in that existing area. I'll have to handle the top-level problem in this patch set in a completely different way. Michael