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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E68B0CCA470 for ; Tue, 7 Oct 2025 03:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BAqsmdKl53hITGHtj1mkVYMvSyvoN7BzckwVidIU+U4=; b=v94tGTvaiOQfVqh/CwTxfXm6QI AjhGGb65BFFAOHnQ5cWwI9ncX2U4kKEqVdjvHGTBmqrZr3ZHRfB22DulzLBBGcmBYIT9S3kNXrdTy p8pNaw71mVAxjtwWoWUzyn2D3IFIHe2q+nZ/vtDJCKJjLhWPkT/SJcV9s2tq6Ioj40e4X8ezrUcQw V7bjArlDH4Y2m+mTUiMdBXJ+k49KCYBPqDD47uqyzPX2yNmBXpXLW7S4Kv/EtrkAJmtByQVSWv80/ vKEyFJOz0wY4h7Yaqi04YZILZUiP/49Zme4NB8XzwHPgtSrQqC4Wb6UUMDVcIjYbEvf+TRP3j1DEU kBiDBfpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v5yo0-00000001ENw-0y16; Tue, 07 Oct 2025 03:56:04 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v5ynx-00000001EN5-0ftb for kexec@lists.infradead.org; Tue, 07 Oct 2025 03:56:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759809356; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BAqsmdKl53hITGHtj1mkVYMvSyvoN7BzckwVidIU+U4=; b=Gji2XDPUAGuAVhlhISQ77ylcoN8T0amWgWU3Fpr3MrxOdKZIogcfoWOJ32PWVExZ4AkWtC 06G8kk5BpEjx4JhtbKfMA4oFLg7HxSSLGI0BQ7hrMI0lMONM9a4w+KygtfJSS33v+wj/F3 pZua53oHrbdh4+lBHq7xtTjqBOl8SMo= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-281-DLMVmdrePgS62B1-gx2b4A-1; Mon, 06 Oct 2025 23:55:52 -0400 X-MC-Unique: DLMVmdrePgS62B1-gx2b4A-1 X-Mimecast-MFC-AGG-ID: DLMVmdrePgS62B1-gx2b4A_1759809351 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 25D3C1800452; Tue, 7 Oct 2025 03:55:50 +0000 (UTC) Received: from localhost (unknown [10.72.112.55]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D1BF41956056; Tue, 7 Oct 2025 03:55:42 +0000 (UTC) Date: Tue, 7 Oct 2025 11:55:36 +0800 From: Baoquan He To: David Hildenbrand , Breno Leitao Cc: kas@kernel.org, Jiri Bohac , riel@surriel.com, vbabka@suse.cz, nphamcs@gmail.com, Vivek Goyal , Dave Young , kexec@lists.infradead.org, akpm@linux-foundation.org, Philipp Rudo , Donald Dutile , Pingfan Liu , Tao Liu , linux-kernel@vger.kernel.org, Michal Hocko Subject: Re: [PATCH v5 0/5] kdump: crashkernel reservation from CMA Message-ID: References: <26ae6b04-3beb-47e9-9639-b081003dc9bb@redhat.com> <2e35b6dd-56dd-47e6-8dac-54f446f763f0@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2e35b6dd-56dd-47e6-8dac-54f446f763f0@redhat.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251006_205601_277974_D67CCF3F X-CRM114-Status: GOOD ( 39.72 ) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org On 10/06/25 at 06:45pm, David Hildenbrand wrote: > On 06.10.25 18:25, Breno Leitao wrote: > > On Mon, Oct 06, 2025 at 10:16:26AM +0200, David Hildenbrand wrote: > > > On 03.10.25 17:51, Breno Leitao wrote: > > > > Hello Jiri, > > > > > > > > On Thu, Jun 12, 2025 at 12:11:19PM +0200, Jiri Bohac wrote: > > > > > > > > > Currently this is only the case for memory ballooning and zswap. Such movable > > > > > memory will be missing from the vmcore. User data is typically not dumped by > > > > > makedumpfile. > > > > > > > > For zswap and zsmalloc pages, I'm wondering whether these pages will be missing > > > > from the vmcore, or if there's a possibility they might be present but > > > > corrupted—especially since they could reside in the CMA region, which may be > > > > overwritten by the kdump environment. > > > > > > That's not different to ordinary user pages residing on these areas, right? > > > > Will zsmalloc on CMA pages be marked as "userpages"? > > No, but they should have the zsmalloc page type set. > > > > > makedump file iterates over the pfns and check for a few flags before > > "copying" them to disk. > > > > In makedumpfile, userpages are basically discarded if they are anonymous > > pages: > > #define isAnon(mapping, flags, _mapcount) \ > > (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 && !isSlab(flags, > > _mapcount)) > > > > https://github.com/makedumpfile/makedumpfile/blob/master/makedumpfile.h#L164 > > > > called from: > > https://github.com/makedumpfile/makedumpfile/blob/master/makedumpfile.c#L6671 > > > > For zsmalloc pages in the CMA, The page struct (pfn)) is marked with old > > page struct (from the first kernel), but, the content has changed > > (replaced by kdump environment - 2nd kernel). > > > > So, whatever decision makedumpfile does based on the PFN, it will dump > > incorrect data, given that the page content does not match the data > > anymore. > > Right. > > > > > If my understanding is valid, we don't want to dump any page that points > > to the PFN, because they will probably have garbage. > > My theory is that barely anybody will go ahead and check compressed page > content, but I agree. We should filter them out. > > > > > That said, I see two options: > > > > 1) Ignore the CMA area completely in makedump. > > - I don't think there is any way to find that area today. The kernel > > might need to print the CMA region somewhere (/proc/iomem?) > > /proc/iomem in the newkernel should indicate the memory region as System RAM > (for the new kernel). That can just be filtered out in any case: dumping > memory of the new kernel does not make sense in any case. Agree. And I saw Jiri has excluded the crashk_cma_ranges[] from the dumped content via elf_header_exclude_ranges(). Have you encountered a real problem about the dumping, or you are just worried about it? > > > > > 2) Given that most of the memory in CMA will be anonymous memory, and > > already discard by other rules, just add an additional entry for > > zsmalloc pages. > > > > Talking to Kirill offline, it seems we can piggy back on MovableOps > > page flag. > > We should likely check the page type instead if we go down that path. Talking about the pages in CMA except of crashk_cma_ranges[], zsmalloc/zswap is true as anon mem and can be discarded. I am wondering if there's any driver or kernel pages residing in CMA and being worth to dump out.