linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Song Shuai <songshuaishuai@tinylab.org>
Cc: catalin.marinas@arm.com, paul.walmsley@sifive.com,
	palmer@dabbelt.com, aou@eecs.berkeley.edu, chris@zankel.net,
	jcmvbkbc@gmail.com, steven.price@arm.com,
	vincenzo.frascino@arm.com, pcc@google.com, wangxiang@cdjrlc.com,
	ajones@ventanamicro.com, conor.dooley@microchip.com,
	jeeheng.sia@starfivetech.com, leyfoon.tan@starfivetech.com,
	linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH 2/4] arm64: hibernate: remove WARN_ON in save_processor_state
Date: Mon, 5 Jun 2023 15:28:58 +0100	[thread overview]
Message-ID: <20230605142857.GE21212@willie-the-truck> (raw)
In-Reply-To: <20230525025555.24104-3-songshuaishuai@tinylab.org>

On Thu, May 25, 2023 at 10:55:53AM +0800, Song Shuai wrote:
> During hibernation or restoration, freeze_secondary_cpus
> checks num_online_cpus via BUG_ON, and the subsequent
> save_processor_state also does the checking with WARN_ON.
> 
> So remove the unnecessary checking in save_processor_state.

This is a very terse summary of why this is safe.

Looking at the code, freeze_secondary_cpus() does indeed check
num_online_cpus(), or it returns an error which then causes the hibernation
to fail. However, this is all in the CONFIG_PM_SLEEP_SMP=y case and it's
far less clear whether your assertion is true if that option is disabled.

Please can you describe your reasoning in more detail, and cover the case
where CONFIG_PM_SLEEP_SMP=n as well, please?

Will

  reply	other threads:[~2023-06-05 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25  2:55 [PATCH 0/4] Remove WARN_ON in save_processor_state Song Shuai
2023-05-25  2:55 ` [PATCH 1/4] ARM: hibernate: remove " Song Shuai
2023-05-25  2:55 ` [PATCH 2/4] arm64: " Song Shuai
2023-06-05 14:28   ` Will Deacon [this message]
2023-06-07  3:00     ` Song Shuai
2023-06-08 17:26       ` Will Deacon
2023-05-25  2:55 ` [PATCH 3/4] riscv: " Song Shuai
2023-05-25  2:55 ` [PATCH 4/4] xtensa: " Song Shuai

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=20230605142857.GE21212@willie-the-truck \
    --to=will@kernel.org \
    --cc=ajones@ventanamicro.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=catalin.marinas@arm.com \
    --cc=chris@zankel.net \
    --cc=conor.dooley@microchip.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jeeheng.sia@starfivetech.com \
    --cc=leyfoon.tan@starfivetech.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pcc@google.com \
    --cc=songshuaishuai@tinylab.org \
    --cc=steven.price@arm.com \
    --cc=vincenzo.frascino@arm.com \
    --cc=wangxiang@cdjrlc.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;
as well as URLs for NNTP newsgroup(s).