Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3737539rwb; Sun, 20 Nov 2022 21:12:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf5rmyBZke1s/Och4shc+nzqKCfbHMKtNmltg1i9hmo3AjXSB71COuqNrTdfCyB8p3ndoHbc X-Received: by 2002:a17:903:41c9:b0:185:57b6:13c3 with SMTP id u9-20020a17090341c900b0018557b613c3mr10314033ple.116.1669007533711; Sun, 20 Nov 2022 21:12:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669007533; cv=none; d=google.com; s=arc-20160816; b=UopUuO7qZguQ90l03TYxdhjzK3/N6WeY2SMaRRI1HWd3PvNL5NDCUwk5KrU0gAgtlM /9eHmp+g6NTHBT7jrN507QOmXWugLI4Sm2y2G/b0zsVcOXhTwrAaJccjt+EbkzcPwDSS OokbFH9a06+yI/C89gfLiz+9x+IXIw84u1OOli/yHg/Xh0b2cmhtllDkhlVmw15TJpyu GJAcEYqRmXmanr1wf4s9dNcwhKo3rMf5lTkTPUaDY+ojV3A4WFvI+eQiVDtTGHnIc7D/ 5oOSUfus7apKHrcHjS/gzVJg92Hy3Jg3B4v0QQ7uoTJ0Twz/MlNXn23f+wwZ3tTh+Dx1 AWUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:dkim-signature:from; bh=jMxx6RH8ct6+4I15XGbZNCKCSA1HvUtH8/UBK2vrkHw=; b=MnZh8zoVs4/N/urdfQ0576AHW1lU+9oWZ7S+iQOzebyOBZslaJHBRVVp1H4uhcBQuF nJ5wC+tY7y5rcNNgmICmAp8bz/NE+G3Ui4lVz7J6wt7yRoegK9Nyn1XpmmG8puh8Ub5d tOrA6/HczPw7eGsmQ4BGqpO7KLv/Uoj0jVr6D2l0b69E5+NW2M1+AJ9RFwhmHueuJW+m xz1ENwwmIb7UqV3i2EvNqi/bSnnIK+OMRa5kFFctRtArCCAWhaOLLLFW/xQE1bLgrSax Gmji1Ob0VdlBIs0OM8TvuOpvudT6H/Pd0Mt5dNfdFlK6eqyrA7xhP695qI0QaTH1XeAs xbwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=GyAGRJQ8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw6-20020a17090b4d0600b0021860d5ca8csi2425700pjb.52.2022.11.20.21.12.02; Sun, 20 Nov 2022 21:12:13 -0800 (PST) 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; dkim=fail header.i=@weissschuh.net header.s=mail header.b=GyAGRJQ8; 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 S229733AbiKUFKS (ORCPT + 91 others); Mon, 21 Nov 2022 00:10:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiKUFKP (ORCPT ); Mon, 21 Nov 2022 00:10:15 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8335C2BB00; Sun, 20 Nov 2022 21:10:12 -0800 (PST) From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1669007410; bh=QIeowsk5HLgajMN1xFHSXe66V1zSDio/IapbVc7+FlQ=; h=From:To:Cc:Subject:Date:From; b=GyAGRJQ8YD4Il+l7lA464JQ3wQMvXZQ3/QAZO7SOwIjTV49NX5SY5azNbAUQmPY7z qwcdB6F1bMxvzeDVMlHH7OA0d7/11xZl5YmGp7Zfs9IpCvzUcq3aQ/Dd/sn9wLaK7T Yj33hmNCeDuSX3QNAfM3Kr6dyQoDlhCV3eAWvSN0= To: "Rafael J. Wysocki" , Pavel Machek , Len Brown , linux-pm@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH] power: process: use explicit levels for printk continuations Date: Mon, 21 Nov 2022 06:09:46 +0100 Message-Id: <20221121050946.3540-1-linux@weissschuh.net> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=ed25519-sha256; t=1669007383; l=2673; i=linux@weissschuh.net; s=20211113; h=from:subject; bh=QIeowsk5HLgajMN1xFHSXe66V1zSDio/IapbVc7+FlQ=; b=F7f6T1eBqzLUPGSTBtC3tKsQxZX8q3PPm0cAKrihOWPyxUq/sjdD4o2Bo9H4DrGgggxayf4xfxf0 53Jh1NqzDEgUPCm31XKCCOYjl1KdzRAFxf14dzA0pKJ6DX1O2k2I X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=9LP6KM4vD/8CwHW7nouRBhWLyQLcK1MkP6aTZbzUlj4= Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org Many of the printk messages emitted during suspend and resume are emitted in fragments using pr_cont()/KERN_CONT. As during suspend and resume a lot of operations are happing in the kernel the chances are high that the fragments are interspersed with unrelated messages. In this case if no explicit level is specified for the fragments the standard level is applied, which by default is KERN_WARNING. If the user is only observing KERN_WARNING and *not* KERN_INFO messages they will see incomplete message fragments. By specifing the correct printk level also with the continuations this mismatch can be avoided. Also it reduces the amount of false-positive KERN_WARNING messages. Signed-off-by: Thomas Weißschuh --- kernel/power/process.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/power/process.c b/kernel/power/process.c index ddd9988327fe..0a828edc6d30 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -82,7 +82,7 @@ static int try_to_freeze_tasks(bool user_only) elapsed_msecs = ktime_to_ms(elapsed); if (todo) { - pr_cont("\n"); + pr_info(KERN_CONT "\n"); pr_err("Freezing of tasks %s after %d.%03d seconds " "(%d tasks refusing to freeze, wq_busy=%d):\n", wakeup ? "aborted" : "failed", @@ -101,7 +101,7 @@ static int try_to_freeze_tasks(bool user_only) read_unlock(&tasklist_lock); } } else { - pr_cont("(elapsed %d.%03d seconds) ", elapsed_msecs / 1000, + pr_info(KERN_CONT "(elapsed %d.%03d seconds) ", elapsed_msecs / 1000, elapsed_msecs % 1000); } @@ -135,9 +135,9 @@ int freeze_processes(void) error = try_to_freeze_tasks(true); if (!error) { __usermodehelper_set_disable_depth(UMH_DISABLED); - pr_cont("done."); + pr_info(KERN_CONT "done."); } - pr_cont("\n"); + pr_info(KERN_CONT "\n"); BUG_ON(in_atomic()); /* @@ -171,9 +171,9 @@ int freeze_kernel_threads(void) pm_nosig_freezing = true; error = try_to_freeze_tasks(false); if (!error) - pr_cont("done."); + pr_info(KERN_CONT "done."); - pr_cont("\n"); + pr_info(KERN_CONT "\n"); BUG_ON(in_atomic()); if (error) @@ -215,7 +215,7 @@ void thaw_processes(void) usermodehelper_enable(); schedule(); - pr_cont("done.\n"); + pr_info(KERN_CONT "done.\n"); trace_suspend_resume(TPS("thaw_processes"), 0, false); } @@ -236,5 +236,5 @@ void thaw_kernel_threads(void) read_unlock(&tasklist_lock); schedule(); - pr_cont("done.\n"); + pr_info(KERN_CONT "done.\n"); } base-commit: eb7081409f94a9a8608593d0fb63a1aa3d6f95d8 -- 2.38.1