Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp349203rwb; Thu, 1 Dec 2022 03:04:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf53M4y3ioFVCKClUmpl8RJjDOsBY0YTjk78nIPPMlZ1xGSfcg93nvhEYjjrZbP3CTifa/I/ X-Received: by 2002:a05:6402:1381:b0:468:5b78:6381 with SMTP id b1-20020a056402138100b004685b786381mr47364989edv.373.1669892645051; Thu, 01 Dec 2022 03:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669892645; cv=none; d=google.com; s=arc-20160816; b=hxjuivs7fCFyxTsIFVWJlNY+PuJui2kViStKMXKJEQm7NnyEh0GzYR+7D0nX1EpJWI 7Yb/pXSmdWgFplhR2j0ICqsSsxJa7i0TJmRQtCSwslAumcaS9dwBJSadD4Z0jj75OiAt 6pUqBl/SSnIE/3G7r8+HgDtji+HZM6Vs1ggFGzHIAmirDL5yrZwFAVagkRFtn4BvWeXc LXdA+5G6Wes4ikJLVQW7WVHQYOp9NT+eeXslZuMkCx0/ZLpf6LcfbkYGukXXh6M0vUqE CgvaHYDaceUVqK7fZlhY9MakqRb4In0GkM30YvUV3o/E+N4zKjp4DtjH7Z+oxUXFhGUl 8D0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=y2yuajcyNF+KtJPwi+UUylTPzDzWLHsw1+1hqHwfGNw=; b=Hnzwhy8438qnWVIOC7Jcwc+d10yG3GCFI/7RMBGuqn0KI/90J57avnpCCyNflRGEEJ A02NWniS9Vl6TLCd3KlR3BPdVB05xtrzLmxW2851id7WIXagbZZNuVjUUUptAw91M86W RRMHE23rq9jQk51pYSH/Iihr0RmPPCAfp2FLrYcADMd4LbcXqTpgDAUDsQGvtQl41wNM 5XcG6EGCh1rQYybgS7pif1c0BbMviZdqxcxKvimE6r7jLiQ+fgSCd+gp9WWGURhU+XPA QD/y2C6K6F9oztY7PKBqfcW2Qxo2XpAnopKxffV3UdTKYs/x1y3gNWQs9EzNbTNxd3D+ Q/Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ckALftw8; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a05640214c600b0046c094d9b85si217214edx.348.2022.12.01.03.03.44; Thu, 01 Dec 2022 03:04:05 -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=pass header.i=@suse.com header.s=susede1 header.b=ckALftw8; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230382AbiLAKdo (ORCPT + 82 others); Thu, 1 Dec 2022 05:33:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230477AbiLAKdV (ORCPT ); Thu, 1 Dec 2022 05:33:21 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9403731DD6; Thu, 1 Dec 2022 02:32:52 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id D57E321B1C; Thu, 1 Dec 2022 10:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1669890769; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y2yuajcyNF+KtJPwi+UUylTPzDzWLHsw1+1hqHwfGNw=; b=ckALftw8qzsnAkNw5MgvyuuU71o9wQpiLuaktpcS+hJt/efqDV1ds8P8Tttvd1NFm6/kiL XuDOtSg6uhg/rn9/9CxHXtsmTb4Er7kJyC1/3XQQMSmhkK3zXT/HRya14/g+4uv905YHRn eb3PDwSYIQHjWCUWJe5z67aunsI+Ngw= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 691432C141; Thu, 1 Dec 2022 10:32:49 +0000 (UTC) Date: Thu, 1 Dec 2022 11:32:46 +0100 From: Petr Mladek To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: "Rafael J. Wysocki" , Pavel Machek , Len Brown , linux-pm@vger.kernel.org, Sergey Senozhatsky , Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org, Steven Rostedt , Dwaipayan Ray , Lukas Bulwahn Subject: Re: [PATCH v2 0/3] printk: introduce new macros pr__cont() Message-ID: References: <20221125190948.2062-1-linux@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 On Thu 2022-12-01 00:37:15, Thomas Wei?schuh wrote: > On 2022-11-30 18:57+0100, Rafael J. Wysocki wrote: > > On Fri, Nov 25, 2022 at 8:10 PM Thomas Wei?schuh wrote: > >> > >> This series adds new printk wrapper macros pr__cont(). > >> These create continuation messages with an explicit level. > >> > >> Explicit levels are useful when a continuation message is split from its main > >> message. Without the explicit level KERN_DEFAULT ("warn" by default) is used > >> which can lead to stray partial log messages when filtering by level. > >> > >> Also checkpatch is modified to recommend the new macros over plain pr_cont(). > >> > >> Lastly the new macros are used in kernel/power/process.c as this file uses > >> continuation messages during system suspend-resume which creates a high > >> likelyhood of interspersed messages. > > > > Well, if process.c is the only problematic piece of code in this > > respect, I'm not sure if adding the new infrastructure for its benefit > > alone is worth it, because it can very well do without pr_cont() at > > all. > > In general all usages of pr_cont() are problematic. > Any continuation can be split from its main message, leading to misleved > continuations. In most cases this happens "only" when a message from another CPU or interrupt context is printed in parallel. > process.c is just the one that I noticed reliably hitting this problem on my > machine. The situation in process.c was even worse. The error message was printed in the middle of the to-be-continued message. As a result, the loglevel of the pr_cont() part was always (reliably) broken when the error message was printed. > > Please see the patch below (compiled only, sorry for gmail-induced > > white space damage). I'll submit it properly later if it works for > > everyone. > > The patch looks fine to me and getting rid of usages of pr_cont() seems to be > the better aproach where it is possible. I agree. It is always better to avoid pr_cont() when possible. > Petr: do you still want me to submit the new macros even if it is not used > directly anymore? Good question. In general, new API should not be added if there is no user. So, I would prefer to do not add the API if the problem will be fixed without it. Best Regards, Petr