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 E53FED75BB4 for ; Thu, 21 Nov 2024 04:35:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3929A6B0085; Wed, 20 Nov 2024 23:35:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3427F6B0088; Wed, 20 Nov 2024 23:35:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 231496B0089; Wed, 20 Nov 2024 23:35:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 016E66B0085 for ; Wed, 20 Nov 2024 23:35:20 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7E34CA1262 for ; Thu, 21 Nov 2024 04:35:20 +0000 (UTC) X-FDA: 82808837454.02.D8FD68C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 2BC9940002 for ; Thu, 21 Nov 2024 04:34:05 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QKkeR8ps; spf=pass (imf07.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732163568; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mKMqxRLlVvUCqserKLr/Bagm1GzwWwOkUXng3lrWCp4=; b=tw5HlPFT595k85vPk2AlYHSKaz2GViC5Yc8rLk79ZnB+ZEd0lLr5nCn00fv3O1ateHJbLO gH6QBwb8KM/Z1tnCMTfrUE3GfiPvOCzFymlxOlUaijz5UG4mcSXMRoOOH5BiLjpTvCF+9l qknsUTtdh++nPhrvtoky5spTL8U+jU4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732163568; a=rsa-sha256; cv=none; b=YTTF/BOkduPzTWu+8XMMilrZe7FZGG2YRHGExT6L+VF14AYbP5OQgCzX8MR6Q7K4o+yHbl 3pnRMvXflZwTcBk06BJYEJytr1Kw5gBCC5syAxlJyiJLlGXlIALn6EpNIMohz/tY4sWoux gW8B20iIVBgSMOfrWcYUMSkjucDM6l4= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QKkeR8ps; spf=pass (imf07.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732163718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mKMqxRLlVvUCqserKLr/Bagm1GzwWwOkUXng3lrWCp4=; b=QKkeR8psekQeWE1j1g9ZJaoKFFUPqQM+jnavQ9zwGJu5A6PW/wdmb7uFekQGeqzEhpUwWX h6FEDgYjPTqfhvi3HQWRRiwXmRwwIPGnxZxx+zXLtFEuCVdaIayFbLO6hCMQpv9ZkoNK9j 9JK48CIkNMoCgTJxMRPsR7r0UPhr+3A= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-NE4qc6erMmah3GjoeKhcQQ-1; Wed, 20 Nov 2024 23:35:16 -0500 X-MC-Unique: NE4qc6erMmah3GjoeKhcQQ-1 X-Mimecast-MFC-AGG-ID: NE4qc6erMmah3GjoeKhcQQ Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 51C9B19560AE; Thu, 21 Nov 2024 04:35:13 +0000 (UTC) Received: from localhost (unknown [10.72.113.10]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 77E3B30000DF; Thu, 21 Nov 2024 04:35:10 +0000 (UTC) Date: Thu, 21 Nov 2024 12:35:05 +0800 From: Baoquan He To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, kexec@lists.infradead.org, Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Vivek Goyal , Dave Young , Thomas Huth , Cornelia Huck , Janosch Frank , Claudio Imbrenda , Eric Farman , Andrew Morton Subject: Re: [PATCH v1 04/11] fs/proc/vmcore: move vmcore definitions from kcore.h to crash_dump.h Message-ID: References: <20241025151134.1275575-1-david@redhat.com> <20241025151134.1275575-5-david@redhat.com> <120bc3d9-2993-47eb-a532-eb3a5f6c4116@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <120bc3d9-2993-47eb-a532-eb3a5f6c4116@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2BC9940002 X-Stat-Signature: bbupg7dneikznznx97rw1n4zsiegrh85 X-HE-Tag: 1732163645-604209 X-HE-Meta: U2FsdGVkX1/iC8gR01tjHCQ3fHcgKWwdYYVj6ad7yQivVg3O2CiXp5FUc+S9+S1uwNIY4/96/+DpMmCFSRHH0hzrDxSvM5AlDQthGVi7joAaQ5LZccZopXkxSlzA+tF5hj0uH55j0rxG6oMuB1R7SqV+ZzTxH2aUlo1rRCpbbGmyM566DKa+691JRMuojKCYkMwrrxIe7RPN1WVURHx+a459ZnMCb6J4Apj5PElArc/0uMdsFJBzVMEuCBGNRviAKLQ1HbPjtJWBe16t9M/KpzS9UEPRw/KcxGQ/2L2Zi/6kJFMtzaBRHuPD1r334xsCgthvkPvA84i1lq0byXol59uAD0H+I0Uw3vNqQ6FnsAzHRFYMP2MCh2Lh+Uj9jGwZuJ9p+GHc31L83y2fFYj0eJQV7WQnqPoh4DRK61sUrOWiAXwaETmfIJNcpgmq9+6+9ws0EuI7R7ucmpcWMTDLelOHuEd6R43ELJtPKmHOyHNSJ0YWdHGs2mSGajhAVT9xb016LIYGSpF+L5K8R00dnQIwpTkYzl66j2zTmBwJvD3yor6UyyU+dnIZbQcuEO3+yAd3QDT5EetU7Hky5vReZEePZ1fP4dLuwFDsEnNfvhBMC2zRNdu4BBw30c/ABIG8Zv514k4+X779ejN5X0WNNFmoHRdK4/qf0n1oAGeZeZV2dX+xnOn92KFfFIkLruc66hMVncjcxtaIJnY9Sjlucd011HKvxsIGdcDj40xmfX8KYt2Ug+YZ9TwKIPiElQkT6pQ8/5/aoQtckVrOgLB/fdsmkQ3hjNuSByAVfdWsgbsy0I7jgOLU7jKH7NomoDksgwM9bnzPu3BOB5KEQOuQIs1w1xOKm5yI2JV/r0GQY+W7k8Tncfq9UObFguwPkIanrhyYCOtpv3Mq/QPMJipI45dUBwjjRdagZDP9heFvhwNpPbPiVnxq7m4zXnBsZdNFeGkWN8EST6cmKqr6ZIs vsRhChbY ujjZ2LAwDqMw8XxmZWskhF6nbh7sfcX/t76g/WRthLzGGf8LoU7dBGG+87ZOkbRkNKOaIvuHglsSVhhp4LhFhz1onUEfE6SiNDtXcodMvRFIMq+ON9UoUyZrTdX+uQRLzeudcR5Yct+IhLGItdnQ+Ztz1ppQTgAceYT1XMt5+wKiMs2t8f3WPpRmyvMwr/HUhwg4RwIQiU1BtlMBK1Ao3izs3EWKF1SFjeglHuwhW6r3ZSlJc7RtY50zyh69HM+lgQhmdkEkTDZtFTus0ENg7PI7N8k2KePk4uHc725L9LW8MjPk+gA6kLMFIu+jqOXsudBGhDJrAhqalVU0YCSFnB83xwNsfJk6gaNbXGD/rPQSw7alTUYFGd1o6O835gmoOARuj9biXuKRPINXsb+RcWJNJeA== 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 11/20/24 at 11:28am, David Hildenbrand wrote: > On 20.11.24 10:42, Baoquan He wrote: > > On 11/15/24 at 10:59am, David Hildenbrand wrote: > > > On 15.11.24 10:44, Baoquan He wrote: > > > > On 10/25/24 at 05:11pm, David Hildenbrand wrote: > > > > > These defines are not related to /proc/kcore, move them to crash_dump.h > > > > > instead. While at it, rename "struct vmcore" to "struct > > > > > vmcore_mem_node", which is a more fitting name. > > > > > > > > Agree it's inappropriate to put the defintions in kcore.h. However for > > > > 'struct vmcore', it's only used in fs/proc/vmcore.c from my code > > > > serching, do you think if we can put it in fs/proc/vmcore.c directly? > > > > And 'struct vmcoredd_node' too. > > > > > > See the next patches and how virtio-mem will make use of the feactored out > > > functions. Not putting them as inline functions into a header will require > > > exporting symbols just do add a vmcore memory node to the list, which I want > > > to avoid -- overkill for these simple helpers. > > > > I see. It makes sense to put them in crash_dump.h. Thanks for > > explanation. > > > > I'll add these details to the description. Thanks. > > > > > > > > > > > > And about the renaming, with my understanding each instance of struct > > > > vmcore represents one memory region, isn't it a little confusing to be > > > > called vmcore_mem_node? I understand you probablly want to unify the > > > > vmcore and vmcoredd's naming. I have to admit I don't know vmcoredd well > > > > and its naming, while most of people have been knowing vmcore representing > > > > memory region very well. > > > > > > I chose "vmcore_mem_node" because it is a memory range stored in a list. > > > Note the symmetry with "vmcoredd_node" > > > > I would say the justification of naming "vmcore_mem_node" is to keep > > symmetry with "vmcoredd_node". If because it is a memory range, it really > > should not be called vmcore_mem_node. As we know, memory node has > > specific meaning in kernel, it's the memory range existing on a NUMA node. > > > > And vmcoredd is not a widely used feature. At least in fedora/RHEL, we > > leave it to customers themselves to use and handle, we don't support it. > > And we add 'novmcoredd' to kdump kernel cmdline by default to disable it > > in fedora/RHEL. So a rarely used feature should not be taken to decide > > the naming of a mature and and widely used feature's name. My personal > > opinion. > > It's a memory range that gets added to a list. So it's a node in a list ... > representing a memory range. :) I don't particularly care about the "node" > part here. Ah, I missed that about list node. There are list items, list entries and list nodes, I didn't think of list node at tht time. > > The old "struct vmcore" name is misleading: makes one believe it somehow > represents "/proc/vmcore", but it really doesn't. (see below on function > naming) Yeah, agree. struct vmcore is a concept of the whole logical file. > > > > > > > > > If there are strong feelings I can use a different name, but > > > > Yes, I would suggest we better keep the old name or take a more > > appropriate one if have to change. > > In light of patch #5 and #6, really only something like "vmcore_mem_node" > makes sense. Alternatively "vmcore_range" or "vmcore_mem_range". > > Leaving it as "struct vmcore" would mean that we had to do in #5 and #6: > > * vmcore_alloc_add_mem_node() -> vmcore_alloc_add() > * vmcore_free_mem_nodes() -> vmcore_free() > > Which would *really* be misleading, because we are not "freeing" the vmcore. > > Would "vmcore_range" work for you? Then we could do: > > * vmcore_alloc_add_mem_node() -> vmcore_alloc_add_range() > * vmcore_free_mem_nodes() -> vmcore_free_ranges() Yeah, vmcore_range is better, which won't cause misunderstanding. Thanks.