Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1588154pxb; Thu, 28 Oct 2021 06:33:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdOT7RmSDudvGzJII4PwNpA/hhp4I44ATJK5lnkVgSeNWN3pyKtjpOAqhHqw8MARPxHx0H X-Received: by 2002:a17:90a:a087:: with SMTP id r7mr13064157pjp.84.1635428017691; Thu, 28 Oct 2021 06:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635428017; cv=none; d=google.com; s=arc-20160816; b=aaYw+HRiKWwVu6q3sHMeUleluKB3wBKctB7VDLe2ikevajdiSPN9Vmd5U8az2sr2GU XU9Wnuh86a6MK0IKDJSOlMn1kEjakkX3+jiVEV5WQR87+Mi8fBlfEV4WKSaWE6Pkc6iJ NhFqvnmZXxyhbsgyFwQ04+XFgVIpDblBAe/iY3JaGRzscA2tGtwO4vh2FUB+vWfsIyAZ 9yT1GkHEdwGvYTus71Tkrs5CmJ/FSiDN7hT53jKPBtswz82H+6E/JMyRXXwbTSbQz4f9 tk45MpvwkR39CFhmnatfAVvJsl0RnLyJF77BMZTZFEBBPGooqWx0vrDG720NzAAaKWnc brsw== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=208mrZcm3iSbU26KH7O5liggRkMjOTBbAOFuqc70QGI=; b=x2fbMp5lAsFplGeTHKa3Dav4g1n/OT+oqSDJqJDjAkVGLkAMvlMIZ0GpfezeC6K+Re OR74D29aUTw28GOHn2Vw1XleMJv2zTqz9K0GIlOH1bMS/qW+Wanj4ucpbPhm5B/gNabk F44LwdP/ZWGbCZXmWPeoOVSkR4m1tS1G7ARt2ONC5UvZAHafwfsrZcqmJr/Ju3TGv3uM v01HeNeyDpoW7aikLLjXVlYXtRSEn25/CXEjEOr1eNhF+i3FGBfSvbBm9AinUewXs0HQ foTPbw33Wd1Jl208jL3YqqF2iM1ywhYVT6IQk/5FL7NAZ+pHVD3DSAI2mJfljgpIokAn xnmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MGab7tyS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si8467377pjr.72.2021.10.28.06.33.24; Thu, 28 Oct 2021 06:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MGab7tyS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbhJ1NdT (ORCPT + 99 others); Thu, 28 Oct 2021 09:33:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:38568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbhJ1NdQ (ORCPT ); Thu, 28 Oct 2021 09:33:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DA16261040; Thu, 28 Oct 2021 13:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635427849; bh=2AU5vMARnoD7CkinUW7V2ShndNd+uKH+pR6OdrEij04=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=MGab7tyS50J9fDwYO3sPuUnkvQjjW4+A0/rRJPW4n0CpPd4gefT2D5jhu/0v3qHg5 ZkqV4ZDMqXLXjmsgPwu1ZgY/BX1CQRZu+KdgjZSNlHmvPfAWBCh+0fMQBrT5QMuOhX KscBrn7vqpxR3giMSKl1AtpncRAzLdiLsRlyZLKIsL+7o30x4vOd+La0wRysUbNBZ1 9eKa4idRFn1aVyhum3TQzYY1T4oA0L0QKapSUDWBUvIOU2g0d4FFodSrmTQAPmYZvh sQRFZ7gfRD4jFFXewvCnQXJ+6Nasi25j/IF4feL5nIWgsRYSBt2LuDQ3Ipzp/SqijB So3T6Lie2g4kQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 3E3BC5C00AA; Thu, 28 Oct 2021 06:30:49 -0700 (PDT) Date: Thu, 28 Oct 2021 06:30:49 -0700 From: "Paul E. McKenney" To: "lizhijian@fujitsu.com" Cc: "dave@stgolabs.net" , "josh@joshtriplett.org" , "rostedt@goodmis.org" , "mathieu.desnoyers@efficios.com" , "jiangshanlai@gmail.com" , "joel@joelfernandes.org" , "rcu@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 3/3] refscale: always log the error message Message-ID: <20211028133049.GC880162@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20211025032658.22889-1-lizhijian@cn.fujitsu.com> <20211025032658.22889-3-lizhijian@cn.fujitsu.com> <5f4c53e4-34aa-98f6-343f-0de18df830f2@fujitsu.com> <20211026140632.GV880162@paulmck-ThinkPad-P17-Gen-1> <0c9868b6-a143-b098-aa0d-bf525f32ed8c@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 07:21:34AM +0000, lizhijian@fujitsu.com wrote: > Hi Paul > > During adding the missing '\n', i also found there are some verbose control error message > Should we convert it like [PATCH 3/3] refscale: always log the error message These do indeed look like they should always be logged. Good catches! Thanx, Paul > lizj@FNSTPC: linux$ git grep VERBOSE.*_ERRSTRING > include/linux/torture.h:#define VERBOSE_TOROUT_ERRSTRING(s) \ > kernel/locking/locktorture.c: VERBOSE_TOROUT_ERRSTRING("writer_tasks: Out of memory"); > kernel/locking/locktorture.c: VERBOSE_TOROUT_ERRSTRING("reader_tasks: Out of memory"); > kernel/rcu/rcuscale.c:#define VERBOSE_SCALEOUT_ERRSTRING(s) \ > kernel/rcu/rcuscale.c:????????? VERBOSE_SCALEOUT_ERRSTRING("All grace periods expedited, no normal ones to measure!"); > kernel/rcu/rcuscale.c:????????? VERBOSE_SCALEOUT_ERRSTRING("All grace periods normal, no expedited ones to measure!"); > kernel/rcu/rcuscale.c:????????? VERBOSE_SCALEOUT_ERRSTRING("No expedited async GPs, so went with async!"); > kernel/rcu/rcuscale.c:????????? VERBOSE_SCALEOUT_ERRSTRING("out of memory"); > kernel/rcu/rcuscale.c:????????? VERBOSE_SCALEOUT_ERRSTRING("out of memory"); > kernel/rcu/rcutorture.c: VERBOSE_TOROUT_ERRSTRING("out of memory"); > kernel/rcu/rcutorture.c: VERBOSE_TOROUT_ERRSTRING("out of memory"); > kernel/rcu/rcutorture.c: VERBOSE_TOROUT_ERRSTRING("out of memory"); > kernel/rcu/rcutorture.c: VERBOSE_TOROUT_ERRSTRING("out of memory"); > kernel/scftorture.c:#define VERBOSE_SCFTORTOUT_ERRSTRING(s, x...) \ > kernel/scftorture.c:??????????? VERBOSE_SCFTORTOUT_ERRSTRING("all zero weights makes no sense"); > kernel/scftorture.c:??????????? VERBOSE_SCFTORTOUT_ERRSTRING("built as module, weight_resched ignored"); > kernel/scftorture.c:??????????? VERBOSE_SCFTORTOUT_ERRSTRING("out of memory"); > kernel/torture.c:?????????????? VERBOSE_TOROUT_ERRSTRING("Failed to alloc mask"); > kernel/torture.c:?????????????? VERBOSE_TOROUT_ERRSTRING(f); > > > > Thanks > > > > On 27/10/2021 13:17, Li Zhijian wrote: > > > > > > On 26/10/2021 22:06, Paul E. McKenney wrote: > >> On Mon, Oct 25, 2021 at 06:12:40AM +0000, lizhijian@fujitsu.com wrote: > >>> > >>> On 25/10/2021 11:26, Li Zhijian wrote: > >>>> Generally, error message should be logged anyhow. > >>>> > >>>> Signed-off-by: Li Zhijian > >>>> --- > >>>> ?? kernel/rcu/refscale.c | 8 ++++---- > >>>> ?? 1 file changed, 4 insertions(+), 4 deletions(-) > >>>> > >>>> diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c > >>>> index a4479f00dcdc..f055d168365a 100644 > >>>> --- a/kernel/rcu/refscale.c > >>>> +++ b/kernel/rcu/refscale.c > >>>> @@ -58,8 +58,8 @@ do {??????????????????????????????????????????? \ > >>>> ?????? }??????????????????????????????????????? \ > >>>> ?? } while (0) > >>>> ?? -#define VERBOSE_SCALEOUT_ERRSTRING(s, x...) \ > >>>> -??? do { if (verbose) pr_alert("%s" SCALE_FLAG "!!! " s, scale_type, ## x); } while (0) > >>>> +#define SCALEOUT_ERRSTRING(s, x...) \ > >>>> +??? do { pr_alert("%s" SCALE_FLAG "!!! " s, scale_type, ## x); } while (0) > >>>> ?? ?? MODULE_LICENSE("GPL"); > >>>> ?? MODULE_AUTHOR("Joel Fernandes (Google) "); > >>>> @@ -651,7 +651,7 @@ static int main_func(void *arg) > >>>> ?????? result_avg = kzalloc(nruns * sizeof(*result_avg), GFP_KERNEL); > >>>> ?????? buf = kzalloc(800 + 64, GFP_KERNEL); > >>>> ?????? if (!result_avg || !buf) { > >>>> -??????? VERBOSE_SCALEOUT_ERRSTRING("out of memory"); > >>>> +??????? SCALEOUT_ERRSTRING("out of memory"); > >>> '\n' should be added to the last to flush it. > >> And there might well be other missing "\n" instances in similar messages > >> in rcuscale.c, rcutorture.c, scftorture.c, locktorture.c, and torture.c. > >> Please feel free to send a patch for each file needing this help. > > > > Sure, i will do that. > > > > Thanks > > Zhijian > > > >> I queued your other three patches for v5.17 (not this coming merge window, > >> but the one after that), thank you!? I did wordsmith the commit logs, > >> so please check to see if I messed anything up. > >> > >> ??????????????????????????? Thanx, Paul > >> > >>>> ?????????? goto oom_exit; > >>>> ?????? } > >>>> ?????? if (holdoff) > >>>> @@ -837,7 +837,7 @@ ref_scale_init(void) > >>>> ?????? reader_tasks = kcalloc(nreaders, sizeof(reader_tasks[0]), > >>>> ????????????????????? GFP_KERNEL); > >>>> ?????? if (!reader_tasks) { > >>>> -??????? VERBOSE_SCALEOUT_ERRSTRING("out of memory"); > >>>> +??????? SCALEOUT_ERRSTRING("out of memory"); > >>> ditto > >>> > >>> Thanks > >>> Zhijian > >>>> ?????????? firsterr = -ENOMEM; > >>>> ?????????? goto unwind; > >>>> ?????? } > >