Message ID | 20230609075049.2651723-1-songshuaishuai@tinylab.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp787390vqr; Fri, 9 Jun 2023 01:11:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63k8BC0GbW2DCcs626jXzFYqk4IdKSVKVy8FFqTariez7eaLPVNKIGSGpjO7ysx6ggEQmm X-Received: by 2002:a17:902:d4cb:b0:1b3:8445:5dae with SMTP id o11-20020a170902d4cb00b001b384455daemr425097plg.68.1686298283829; Fri, 09 Jun 2023 01:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298283; cv=none; d=google.com; s=arc-20160816; b=pAwCdJd/xkx3RXzHmLd64b5X6Nw6wXSen936Ytdl28+y982NRjYJIWB7rjWN17dOP6 O3QZpMcJtH5gZxPKkZzHqWF08UOWmkxVU3QSm4gLpL7HgDDBSYVtykI1mi3lWfcg3tH8 vM3OQNA1FeJA/xQdAYmcWSFQzSz2fik++xFZSGKu4nMkd5mZ8MnYA1NmPU9vQnukPBhr pUTGMcFE09IJLlpR1Qxw8/7xso2/FKdqSn13VsRS5V06K6Jl4+2talOvlaBQpzzaHVKL ROKg8bqGhCm7bi2zlWkoQpMu6FfQ8PhyGLC+N3YDhOONRbCpONtLcabLg6aVV6tXfoje Qc4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=IHtYVr+59Hsu5Ph7y/njzjvM6KvzFrWOWNh33NGpsg0=; b=MCmqew/0x3hcQbJ+4YHyR4hfcAOIFjkCFsWy3AcqK8lxkMJgerI58zEC35a5hmaI6V 4lVWcn5fbcxYuCxjU99ceXSj7UQz9xkmvqh0w8RNdDLqEhfkoAzMkMunV/qCmJojJ4+3 +yrsC8cf+SYijreZ+prYB6WeAlv7YCmb3iRtFym6ZqXnXICcck5GUyh0QqhcZE9ZXPld 4GJZ7pHvaT+fhIk1naZHYsJixZ1nT/GoP/4O+JHON07QrNQnW8QfxmvOYY9ka4QtrnQI HMWQYdJ3RoBqA67qZnJr9qwDRzlfKvedb1L7Haojn6cTfzwgx5uTHfVRlAkfajf+CrxI qiZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v11-20020a170903238b00b001b04c797f7csi2413497plh.210.2023.06.09.01.11.08; Fri, 09 Jun 2023 01:11:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240024AbjFIICi (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Fri, 9 Jun 2023 04:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239467AbjFIICR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Jun 2023 04:02:17 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D953149F6 for <linux-kernel@vger.kernel.org>; Fri, 9 Jun 2023 01:00:23 -0700 (PDT) X-QQ-mid: bizesmtp75t1686297177txpqd2r4 Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 09 Jun 2023 15:52:55 +0800 (CST) X-QQ-SSF: 01200000000000908000000A0000000 X-QQ-FEAT: +ynUkgUhZJmBFu75q0NPiJ6aTl945nO9gpI8bXNQ/ESzHgPsBD6fTZ5m1288J zUyIKDG/VCQPAvgJv00JVCR58ywZjCK6YjDdv0JYBuzp28QKvYJwqgFmgP0oldjR3hTAGFh PUgfCXEAj9hNkaK1ifnQvqZt2ZVmVlRKFE9S0CwxsXKkjf++zlB6yn+WLwkCpF6nmISkiYO l7FFfKrhTDo2/Gd5+cLEvSf5U2NFe/6FgXmSHV9azmKTFtTXoAbtfmPOnGUr+72hfELjQI2 LQh2KPGArq0GVhIc115bdF+haP9LAbyfiuQuKkruJFA2zoeWVupU+Wjd++LJOVZKaeyn2/k fzwyP1B9I/hfqdM+s03OjYv6W3oVvNP2lpFAA22 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14437550590923538906 From: Song Shuai <songshuaishuai@tinylab.org> To: catalin.marinas@arm.com, will@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, chris@zankel.net, jcmvbkbc@gmail.com, songshuaishuai@tinylab.org, steven.price@arm.com, vincenzo.frascino@arm.com, leyfoon.tan@starfivetech.com, mason.huo@starfivetech.com, jeeheng.sia@starfivetech.com, conor.dooley@microchip.com, ajones@ventanamicro.com Cc: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH V2 0/4] Remove WARN_ON in save_processor_state Date: Fri, 9 Jun 2023 15:50:45 +0800 Message-Id: <20230609075049.2651723-1-songshuaishuai@tinylab.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768211909021683018?= X-GMAIL-MSGID: =?utf-8?q?1768211909021683018?= |
Series |
Remove WARN_ON in save_processor_state
|
|
Message
Song Shuai
June 9, 2023, 7:50 a.m. UTC
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. In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus is not defined, but the sole possible condition to disable CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. We also don't have to check it in save_processor_state. So remove the unnecessary checking in save_processor_state for ARM,arm64,riscv,xtensa architechtures. Changes since V1: https://lore.kernel.org/linux-riscv/20230525025555.24104-1-songshuaishuai@tinylab.org/ - supplement the case of CONFIG_PM_SLEEP_SMP=n in commit message as Will suggests Song Shuai (4): ARM: hibernate: remove WARN_ON in save_processor_state arm64: hibernate: remove WARN_ON in save_processor_state riscv: hibernate: remove WARN_ON in save_processor_state xtensa: hibernate: remove WARN_ON in save_processor_state arch/arm/kernel/hibernate.c | 1 - arch/arm64/kernel/hibernate.c | 1 - arch/riscv/kernel/hibernate.c | 1 - arch/xtensa/kernel/hibernate.c | 1 - 4 files changed, 4 deletions(-)
Comments
On Fri, 09 Jun 2023 15:50:45 +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. > > In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus > is not defined, but the sole possible condition to disable > CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. > We also don't have to check it in save_processor_state. > > [...] Applied to arm64 (for-next/misc), thanks! I couldn't tell whether this series would go in as a whole but given that the patches are independent, I picked up the arm64 one. [2/4] arm64: hibernate: remove WARN_ON in save_processor_state https://git.kernel.org/arm64/c/615af0021a61
On Wed, 21 Jun 2023 08:51:43 PDT (-0700), Catalin Marinas wrote: > On Fri, 09 Jun 2023 15:50:45 +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. >> >> In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus >> is not defined, but the sole possible condition to disable >> CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. >> We also don't have to check it in save_processor_state. >> >> [...] > > Applied to arm64 (for-next/misc), thanks! > > I couldn't tell whether this series would go in as a whole but given > that the patches are independent, I picked up the arm64 one. > > [2/4] arm64: hibernate: remove WARN_ON in save_processor_state > https://git.kernel.org/arm64/c/615af0021a61 I was pretty much in the same spot until I saw this, so I'm picking the RISC-V bit and just ignoring the rest. It's testing so it might take a bit to land in linux-next, but seems pretty safe.
On Fri, 09 Jun 2023 15:50:45 +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. > > In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus > is not defined, but the sole possible condition to disable > CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. > We also don't have to check it in save_processor_state. > > [...] Applied, thanks! [3/4] riscv: hibernate: remove WARN_ON in save_processor_state https://git.kernel.org/palmer/c/91afbaafd6b1 Best regards,
Hello: This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt <palmer@rivosinc.com>: On Fri, 9 Jun 2023 15:50:45 +0800 you 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. > > In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus > is not defined, but the sole possible condition to disable > CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. > We also don't have to check it in save_processor_state. > > [...] Here is the summary with links: - [V2,1/4] ARM: hibernate: remove WARN_ON in save_processor_state (no matching commit) - [V2,2/4] arm64: hibernate: remove WARN_ON in save_processor_state (no matching commit) - [V2,3/4] riscv: hibernate: remove WARN_ON in save_processor_state https://git.kernel.org/riscv/c/91afbaafd6b1 - [V2,4/4] xtensa: hibernate: remove WARN_ON in save_processor_state (no matching commit) You are awesome, thank you!