From patchwork Tue Feb 27 01:49:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 207003 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2439675dyb; Mon, 26 Feb 2024 17:51:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWcWJrG+vsI3FMqVVERZI58x1j0eIX8Ecyy7ty/5Pnk+EGYI83lqKu73y5bJesTh2Mnm5mDS4O2B/uZFZAs1fTqtfiL6Q== X-Google-Smtp-Source: AGHT+IEaUegFtom1XosviBto/h3fvEqsxgdLDzL7ID6XKKj0ti0x8RR2KjnCqAGI64mq3GwIEBgS X-Received: by 2002:ac2:424d:0:b0:512:e3b3:adba with SMTP id m13-20020ac2424d000000b00512e3b3adbamr5360845lfl.62.1708998669049; Mon, 26 Feb 2024 17:51:09 -0800 (PST) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a8-20020a170906684800b00a3d2e0d30fesi254772ejs.658.2024.02.26.17.51.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 17:51:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82565-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=Xr7oqbB7; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-82565-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82565-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7D0251F25748 for ; Tue, 27 Feb 2024 01:51:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27CE81BC4E; Tue, 27 Feb 2024 01:50:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="Xr7oqbB7" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2120.outbound.protection.outlook.com [40.107.244.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2416DF510 for ; Tue, 27 Feb 2024 01:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708998642; cv=fail; b=cZ6LAFNPoQpoU1izItjt1KomYpCLdXrnsWKd2jiNRiPkgC1OqbBzKffOX6fW/eSH9W/AFwxtXrLoKToeVSY9hYxjhXx8jkQj/lrflfZhd9uhMR5G3jhWczrdOIUcrVBjstfuoDpv5TOmGcIdzYUNbVbGwb1HwFvJdxf/lYs3O40= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708998642; c=relaxed/simple; bh=oM7ylc0Bx50iFijoQ7TrnttsyZXngrl9Gl7CO+VOvr4=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=OgSkNO+gzlOWRsJJrDBb3Ygrths9pn4UPhc7I9lUSSLivEL2C3/AV+05AHPKtMaYFFIUJUFd5VjTlXxcoPO/pmZ0vXadxcjAJU0j4KKnfvPHXPjfM22GeecdHFISvfTy2YN2EXhoh1D+ixpvFFQNO01jBSdpXiMKc47fKHlU5kI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=Xr7oqbB7; arc=fail smtp.client-ip=40.107.244.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mdhYZLmpSCYhtqYClDeq43q4mXvAm0OPzz6dDH5c+d83M4CB1ognzk8G4xzGshrhcKmEyTQaXQHM6iQa65wyA+1maQ1WOWz5otBC9+yXgjqcEAXjow8rRu3K94NnV3C3Nv2F/1fAA27NCCE9Jv09/sW44SDj9OcUdmSvJk2rD92w92DkrDiuYfVAYBYPxgiA0c2X3oTmL7Dd5HrYG0lvloR9E44ezipGSXUVLqNtMmRzke9omOTlqzMDUimAoK+XIKRPdt6TCgQVir8YSCklSermRLzAQ7P34n9B416zIyDL1jMFZ2YcV5+Y8hYRwIYOuL2+gR7Uf5UGQDuqJlDqwg== 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=ZOXhH41sDCPGU8rsQnZo6JUy8TlCmibgdP33jv8D7Po=; b=nKqdTBODiinGY7Rw2aajY+61fO7UH5Wv69DPMHeK+SLhebD5nPIPWboyb99kSVT2BwCvKFsQxAIZO6w3/cRgJFvV6ZqK58dQm336xVyoE45tsS/g4EmVS4UWfcKkUq9+lnNH+CLi3NuZ/dpLEmwR3cKexCnXL7XiCeWP2n5J/ODwTZsB9NgjalYAm8teus9uBNiCYgN+ugaQ7yk6PNA+cIYxqEUUoFd7abZop4w4ba6+JwmKVaIJOWvcTLzbLO0n4tFzpmMN1zEKQ5U0wS5n1LYem7qbmlficT97pWdFitm+F0srL0UhbUhNjl9mNeWIvn6LCO2yQiFzW3UjRLUESQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZOXhH41sDCPGU8rsQnZo6JUy8TlCmibgdP33jv8D7Po=; b=Xr7oqbB7/QbIZyyU5mpsOzMOp8gp7zYLOGFLliukESgKqlwB1Vi+kXYs8p+WO5ifu6bmzcYKkKhKtrTqpsCGmpgHiWzeBKV/BNVlPI4a+tx7BevlhmSWVAQn/OcGfEh3dyEUPso4kwLcleU1ZPWABDJQb/F9Bekj6iWtW5vCd9M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7975.prod.exchangelabs.com (2603:10b6:510:26d::15) by MN0PR01MB7588.prod.exchangelabs.com (2603:10b6:208:373::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Tue, 27 Feb 2024 01:50:37 +0000 Received: from PH0PR01MB7975.prod.exchangelabs.com ([fe80::91c:92f:45a5:e68a]) by PH0PR01MB7975.prod.exchangelabs.com ([fe80::91c:92f:45a5:e68a%6]) with mapi id 15.20.7316.018; Tue, 27 Feb 2024 01:50:37 +0000 From: Huang Shijie To: akpm@linux-foundation.org, bhe@redhat.com Cc: patches@amperecomputing.com, vgoyal@redhat.com, dyoung@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, k-hagio-ab@nec.com, lijiang@redhat.com, Huang Shijie Subject: [PATCH v2] crash_core: export vmemmap when CONFIG_SPARSEMEM_VMEMMAP is enabled Date: Tue, 27 Feb 2024 09:49:52 +0800 Message-Id: <20240227014952.3184-1-shijie@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: CH2PR20CA0026.namprd20.prod.outlook.com (2603:10b6:610:58::36) To PH0PR01MB7975.prod.exchangelabs.com (2603:10b6:510:26d::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7975:EE_|MN0PR01MB7588:EE_ X-MS-Office365-Filtering-Correlation-Id: e7d91e85-0640-4be2-2790-08dc37367e67 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TAcZRR17FnLY31bxv7L1P4Vx1Q+0ZPcEklejjaKLy5Wew1lvWxEtQg2ZGE/QC3GqiYefpdtMbRA4zXp0VNeC+1DTZwyBZUWtMX7aI79NeV9AWy8cmctVEgAulVm8Blg0d4c/7Wav+Nhs9+nuQrsbhWjyaoe0Y5QLWOgX0BKsrIeTcqx6spAiHc/LYgKHq7E8xMbiIDwn7X2peBC5ljbI5IHz5+blzaHj98vDMhtBr1OSIqYoOC9ahvZhO1A3oL8ywK5TE7cm01w6ZSReHW2uK6IeQyQirVG+oYUF0W4frnwzKJQKwsrDRmzqokPoKhcMGSwdj2BeW+KfaymGZ9KNe+L1KN4zETWlXrnVZBhIRp7ltaWF39zcErlOSdcSh5a67llSFxr26ark4j5L0UuWNRsauC/2FavOjJTL7o+Q+4rjHIYb0clF6uGCPLkgoth43Y5PWcPxms4g/DIzXas0UxehibblyitK5rruZhGFtD4ajfZ+XRItjihAXENTkBAgF3qcMtLLnMxAshuA06wQKOiTmHq5CGpLeAnVLYTHtItyaunuht6bPUNcnAJp3HmYOA6jFCr++MAwpwPmyu4r+GwPoYT3A4jh5GSHqPKt3+FrfjHkPFzd5eINGL+gsTY9iL4Wb+am4vl5Ww9rm7RieL2OJoQh2wn7DOovouGvtfDgE8pz272GJRm3m6+whT3dBDBhfRnZgjzMe1v5qMVeSg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7975.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2deD7xSrhOV+DICCfiBTIxRW+irfIr29zFPwnG68mxTxEJ69j+qBqhGcb1TmYDugVgpFyT104CB2eE5OVYw+ap+rclGKv+zUvsjeb7tZpnpqscvNqODQdzeHDRrlf5OtzD0ovn72+QkpYPy/yrdEjvHxGi6qWAAu9o/njsy2F2s7AzrvzyC1jcUuulFaereeHhiZ7vu+oljjF8bedMgvIrmtMvszxJC+t/xwS+UcS4x2bKRCm2HIkgX4/6wplkGIOEgvmFHS0BqhBNNP1J+rpuoRdLVpZIIw8t4x/9CLs48X4FauQLdEzXgdiGrAwRnfEjeqwc6rVzH+Ed63rqu+VJuGW6vJisT0MTSSAPJe+Rm3MSL8cdGZ9MpBLG/H8IHdGh0t96cDjsBhniJx45YBExm3ZqzUuN6+57FJwLWI5xTg6y+ODuumy4ut7/UmKjfLzqz/TaTUUIEeSGQfsJGHW/rdYCXayMQGqJ46mxtCdEmP2c+dzBUzdhybGQotFwsDvlg0SwJJsOcnm/9HGFTwxbrs1sBxl0bSg5WhjEjSFdnBnxoVRP+D7K0VteTnGPPAbKfmT0O/SXqNJqWaH2FTuS2HRXQUHopPHzMZHPw/QT2R+iRyDCjL8sippsnlhH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S-Exchange-CrossTenant-AuthSource: PH0PR01MB7975.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2024 01:50:37.0687 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uUCEemQZYMEVrwrzl58iG/pqKAcq6gueuwTiNbCdBwfFqpJIbGtJC+rO5sxcWkoIgexybl9zJwc5sRkCF0mHVrC3FcSrLqOkeFJD/ds9LkX0uqUskW4LzJqo/sLyAghs X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR01MB7588 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792014988407784264 X-GMAIL-MSGID: 1792014988407784264 In memory_model.h, if CONFIG_SPARSEMEM_VMEMMAP is configed, kernel will use vmemmap to do the __pfn_to_page/page_to_pfn, and kernel will not use the "classic sparse" to do the __pfn_to_page/page_to_pfn. So export the vmemmap when CONFIG_SPARSEMEM_VMEMMAP is configed. This makes the user applications (crash, etc) get faster pfn_to_page/page_to_pfn operations too. Acked-by: Baoquan He Signed-off-by: Huang Shijie --- v1 --> v2: rebased to linux-next tree. Resend : https://lkml.org/lkml/2024/2/26/98 The v1 : https://lkml.org/lkml/2023/11/26/342 --- kernel/vmcore_info.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/vmcore_info.c b/kernel/vmcore_info.c index 8f77e238a54f..f95516cd45bb 100644 --- a/kernel/vmcore_info.c +++ b/kernel/vmcore_info.c @@ -152,6 +152,9 @@ static int __init crash_save_vmcoreinfo_init(void) VMCOREINFO_SYMBOL(mem_map); VMCOREINFO_SYMBOL(contig_page_data); #endif +#ifdef CONFIG_SPARSEMEM_VMEMMAP + VMCOREINFO_SYMBOL_ARRAY(vmemmap); +#endif #ifdef CONFIG_SPARSEMEM VMCOREINFO_SYMBOL_ARRAY(mem_section); VMCOREINFO_LENGTH(mem_section, NR_SECTION_ROOTS);