Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <dhildenb@redhat.com>
To: Breno Leitao <leitao@debian.org>, kas@kernel.org
Cc: Jiri Bohac <jbohac@suse.cz>,
	riel@surriel.com, vbabka@suse.cz, nphamcs@gmail.com,
	Baoquan He <bhe@redhat.com>, Vivek Goyal <vgoyal@redhat.com>,
	Dave Young <dyoung@redhat.com>,
	kexec@lists.infradead.org, akpm@linux-foundation.org,
	Philipp Rudo <prudo@redhat.com>,
	Donald Dutile <ddutile@redhat.com>,
	Pingfan Liu <piliu@redhat.com>, Tao Liu <ltao@redhat.com>,
	linux-kernel@vger.kernel.org, Michal Hocko <mhocko@suse.cz>
Subject: Re: [PATCH v5 0/5] kdump: crashkernel reservation from CMA
Date: Mon, 6 Oct 2025 18:45:10 +0200	[thread overview]
Message-ID: <2e35b6dd-56dd-47e6-8dac-54f446f763f0@redhat.com> (raw)
In-Reply-To: <f7x2flir2c5zpkusgiyk7qnrdqo4dek3iksyldw6w22r55s4vy@4b47lrcv3fag>

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.

> 
>   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.

-- 
Cheers

David / dhildenb



  reply	other threads:[~2025-10-06 16:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 10:11 [PATCH v5 0/5] kdump: crashkernel reservation from CMA Jiri Bohac
2025-06-12 10:13 ` [PATCH v5 1/5] Add a new optional ",cma" suffix to the crashkernel= command line option Jiri Bohac
2025-06-12 10:16 ` [PATCH v5 2/5] kdump: implement reserve_crashkernel_cma Jiri Bohac
2025-06-12 10:17 ` [PATCH v5 3/5] kdump, documentation: describe craskernel CMA reservation Jiri Bohac
2025-06-12 10:18 ` [PATCH v5 4/5] kdump: wait for DMA to finish when using CMA Jiri Bohac
2025-06-12 23:47   ` Andrew Morton
2025-06-13  9:19     ` David Hildenbrand
2025-06-14  2:41       ` Baoquan He
2025-06-19 12:46       ` Jiri Bohac
2025-06-12 10:20 ` [PATCH v5 5/5] x86: implement crashkernel cma reservation Jiri Bohac
2025-08-20 15:46 ` [PATCH v5 0/5] kdump: crashkernel reservation from CMA Breno Leitao
2025-08-20 16:20   ` Jiri Bohac
2025-08-21  8:35     ` Breno Leitao
2025-08-22 19:45       ` Jiri Bohac
2025-10-03 15:51 ` Breno Leitao
2025-10-06  8:16   ` David Hildenbrand
2025-10-06 16:25     ` Breno Leitao
2025-10-06 16:45       ` David Hildenbrand [this message]
2025-10-06 23:34         ` Tao Liu
2025-10-07  3:55         ` Baoquan He
2025-10-07  9:11           ` Jiri Bohac
2025-10-08 10:42           ` Breno Leitao
2025-10-13  4:03             ` [External] " Zhongkun He
2025-10-13  8:00               ` David Hildenbrand
2025-10-14  7:36                 ` Zhongkun He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e35b6dd-56dd-47e6-8dac-54f446f763f0@redhat.com \
    --to=dhildenb@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=jbohac@suse.cz \
    --cc=kas@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltao@redhat.com \
    --cc=mhocko@suse.cz \
    --cc=nphamcs@gmail.com \
    --cc=piliu@redhat.com \
    --cc=prudo@redhat.com \
    --cc=riel@surriel.com \
    --cc=vbabka@suse.cz \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox