Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11916183rwl; Tue, 3 Jan 2023 06:37:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3J8xymV9zHIhbPacN5FVamzUASdBwdX77MKvzR7t1bMj1Cg8PrgTsaXF356O2xV7BUWdP X-Received: by 2002:a05:6a20:3d03:b0:ad:2abb:5a5e with SMTP id y3-20020a056a203d0300b000ad2abb5a5emr86815477pzi.61.1672756631080; Tue, 03 Jan 2023 06:37:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672756631; cv=none; d=google.com; s=arc-20160816; b=e0ZAJTqNq8UUJPLWNbEYr83hk8QJCVQFRRLF4yaCl+9isAIbG5ri9UA0cbP6g1wnwF E0P2jd4I5DGy02U48Sm9RtzpC7gEYAVt5Ln2xgc/ixNft5oPkttQhF/dPNlSNsk6gwEh /q0GYAXphw+L+RqxM074/M5bUewZdERUPMUa3IrE6skiFOFGhg4J4Rd5L3Juofg5G5Ug rVAMIIicvZtnM8jMtkJYSTw3rjYWbQs2v1JnCYob5RzpozIF4n6CYEE+BK7pQ+KQeiNZ 0srIKs2ji+/kK9JgZWQtFgrkLACnRhnTSNxu1vSa4z7WEgBiaF2QXSL8dpz+EAx9c7gr 1YvQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=J8oq+XhQ+3+x7Vpym61jDcEqm3Tvv2/Ah6NareozzB0=; b=lHlObXtXF2UPQoZmuIGkqw2ajo7IkTKPyTL/HVV5YI8skRNmFUIGryGrgaLr2hiBxr wmCrNmbVL/wnraXoOf74bKxNeCudgRt6o1gHxRy6uy1GA1RrOJbZAeith27e4bWvegw7 uN50l5vnE/y3maPiEqsyvMtEofvby7rgMMattfVAoAU9VMCp0zbTVWty2Ozv9Hlxtl+G qrvImMnpS3Dbi2Fx5LtAhYBgs7rDjMvGjeDFpRfyhvHC3X76tXzCiRlEZyfJ0TWoLvMG UoR3gI24CjG12TwdDURTmnifbq/BeaoKvtOq0ZzC1Ft4VPsUORTDe+5IFiVOjZ0MtvlO JeeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=l8FjXtN8; 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 f1-20020a636a01000000b004792b08adaasi33185482pgc.418.2023.01.03.06.37.03; Tue, 03 Jan 2023 06:37:11 -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=l8FjXtN8; 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 S233360AbjACORG (ORCPT + 61 others); Tue, 3 Jan 2023 09:17:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237979AbjACOQm (ORCPT ); Tue, 3 Jan 2023 09:16:42 -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 8DF23120BF for ; Tue, 3 Jan 2023 06:16:29 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id AC0153EA98; Tue, 3 Jan 2023 14:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1672755387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J8oq+XhQ+3+x7Vpym61jDcEqm3Tvv2/Ah6NareozzB0=; b=l8FjXtN8zdh0U4meV9iZO62MyXEqmKTWP7Q/m4r6dcTsBw67WgZxLxxwqJdnq8R7O1ac9J svGmsNYXfEcWXVb5VHooaapMnlHXsp+a+dehl143P+plwid0/zPp0FE+OU24iIF1J8TwiC tLKC3ELw211EDTJKmcmRNqsg4h2VDTU= 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 9185F2C141; Tue, 3 Jan 2023 14:16:27 +0000 (UTC) Date: Tue, 3 Jan 2023 15:16:27 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v3 6/6] printk: introduce console_prepend_dropped() for dropped messages Message-ID: References: <20221221202704.857925-1-john.ogness@linutronix.de> <20221221202704.857925-7-john.ogness@linutronix.de> <87y1qjdimw.fsf@jogness.linutronix.de> <87o7rfd96w.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o7rfd96w.fsf@jogness.linutronix.de> 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 Tue 2023-01-03 14:50:23, John Ogness wrote: > On 2023-01-03, Petr Mladek wrote: > > Well, what about making sure that something more useful is always > > printed. For example: > > > > /* > > * Make sure outbuf is sufficiently large before prepending. > > * Keep at least the prefix when the message has to be truncated. > > * It is a rather theoretical problem when someone tries to > > * use a minimalist buffer. > > */ > > if (WARN_ON_ONCE(len + PREFIX_MAX + 1 >= outbuf_sz)) > > return; > > I am fine with this. We won't see this warning anyway. Few lines would > ever be printed correctly if anyone ever tries to use a buffer so small. Yup. > > If we want to use this way. It would probably make sense to > > rename PREFIX_MAX to CONSOLE_PREFIX_MAX. > > Actually, I would like to rename all of those limit macros to something > that makes more sense for the new code base: > > CONSOLE_EXT_LOG_MAX -> CONSOLE_MESSAGE_MAX > > CONSOLE_LOG_MAX -> SYSLOG_MESSAGE_MAX Heh, we actually do not need this. The size of @scratchbuf might be LOG_LINE_MAX/PRINTK_RECORD_MAX. The scratch buffer is newly used only to read the plain message. The prefixes are added to @outbuf. > LOG_LINE_MAX -> PRINTK_RECORD_MAX > > PREFIX_MAX -> CONSOLE_PREFIX_MAX I like this. > I have a patch to do this ready, but I did not want to post it until we > are finished with the thread/atomic work. It would make sense to do this as part of this patchset. But I do not want to delay it too much. Feel free to do it later. Best Regards, Petr