public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com,
	horms@kernel.org, thunder.leizhen@huawei.com,
	John.p.donnelly@oracle.com, kexec@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5] arm64: kdump: simplify the reservation behaviour of crashkernel=,high
Date: Tue, 16 May 2023 11:00:10 +0800	[thread overview]
Message-ID: <ZGLxul+c4vYQBn27@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20230414143413.GA27911@willie-the-truck>

Hi Will,

On 04/14/23 at 03:34pm, Will Deacon wrote:
> Hi,
> 
> On Fri, Apr 07, 2023 at 10:24:19AM +0800, Baoquan He wrote:
> > On arm64, reservation for 'crashkernel=xM,high' is taken by searching for
> > suitable memory region top down. If the 'xM' of crashkernel high memory
> > is reserved from high memory successfully, it will try to reserve
> > crashkernel low memory later accoringly. Otherwise, it will try to search
> > low memory area for the 'xM' suitable region. Please see the details in
> > Documentation/admin-guide/kernel-parameters.txt.
> 
> [...]
> 
> >  arch/arm64/mm/init.c | 44 ++++++++++++++++++++++++++++++++++----------
> >  1 file changed, 34 insertions(+), 10 deletions(-)
> 
> I tried to apply this, but smatch is unhappy with the result:
> 
>   | arch/arm64/mm/init.c:153 reserve_crashkernel() error: uninitialized symbol 'search_base'.
> 
> I _think_ this is a false positive, but I must say that the control flow
> in reserve_crashkernel() is extremely hard to follow so I couldn't be
> sure. If the static checker is struggling, then so will humans!
> 
> Ideally, this would all be restructured to make it easier to follow,
> but in the short term we need something to squash the warning.

I tried to refactor the code as you suggested, while it seems not easy
to do. The complexity comes from several cases which need be handled.
I try my best to write a document with the things I think important to
help understand the code. Please help check if it helps or we just having
the current code is fine.

Thanks
Baoquan


      parent reply	other threads:[~2023-05-16  3:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07  2:24 [PATCH v5] arm64: kdump: simplify the reservation behaviour of crashkernel=,high Baoquan He
2023-04-07  2:32 ` Baoquan He
2023-04-12 11:51   ` Catalin Marinas
2023-04-13  7:45     ` Baoquan He
2023-04-13 14:30       ` Catalin Marinas
2023-04-14  2:27         ` Leizhen (ThunderTown)
2023-04-14  9:49         ` Baoquan He
2023-04-14 14:34 ` Will Deacon
2023-04-15  0:43   ` Baoquan He
2023-05-16  3:00   ` Baoquan He [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=ZGLxul+c4vYQBn27@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=John.p.donnelly@oracle.com \
    --cc=catalin.marinas@arm.com \
    --cc=horms@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thunder.leizhen@huawei.com \
    --cc=will@kernel.org \
    /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