From: Alexander Graf <graf@amazon.com>
To: Baoquan He <bhe@redhat.com>, Zhongkun He <hezhongkun.hzk@bytedance.com>
Cc: <kexec@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
<nh-open-source@amazon.com>
Subject: Re: [PATCH v3] kexec: Enable CMA based contiguous allocation
Date: Wed, 21 May 2025 17:30:32 +0200 [thread overview]
Message-ID: <3e1ffd2e-b002-48b5-b41c-24787aa652e3@amazon.com> (raw)
In-Reply-To: <aC2rNv49pzy1Wh3D@MiWiFi-R3L-srv>
On 21.05.25 12:30, Baoquan He wrote:
>
> On 05/21/25 at 03:47pm, Zhongkun He wrote:
>> On Wed, May 14, 2025 at 2:40 AM Alexander Graf <graf@amazon.com> wrote:
> ......
>>> /**
>>> * kexec_locate_mem_hole - find free memory for the purgatory or the next kernel
>>> * @kbuf: Parameters for the memory search.
>>> @@ -648,6 +684,13 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf)
>>> if (kbuf->mem != KEXEC_BUF_MEM_UNKNOWN)
>>> return 0;
>>>
>>> + /*
>>> + * Try to find a free physically contiguous block of memory first. With that, we
>>> + * can avoid any copying at kexec time.
>>> + */
>>> + if (!kexec_alloc_contig(kbuf))
>>> + return 0;
>> IIUC, The kexec_locate_mem_hole() function is also used in
>> the KEXEC_TYPE_CRASH kimage, but kexec_alloc_contig() does not skip it.
>> This can cause kdump to fail and lead to CMA memory leakage.
> That is true and good catch, and fix is needed to skip cma alloc for
> kdump.
Thanks for catching this! I added a check to ensure we don't use the CMA
logic with crash kernels in v4 and posted it.
Alex
Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
prev parent reply other threads:[~2025-05-21 15:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-13 18:02 Alexander Graf
2025-05-21 7:47 ` [External] " Zhongkun He
2025-05-21 10:30 ` Baoquan He
2025-05-21 15:30 ` Alexander Graf [this message]
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=3e1ffd2e-b002-48b5-b41c-24787aa652e3@amazon.com \
--to=graf@amazon.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=hezhongkun.hzk@bytedance.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nh-open-source@amazon.com \
--cc=pasha.tatashin@soleen.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
all inboxes | Powered by JetHome®