Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9300820rwb; Thu, 24 Nov 2022 10:39:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ArzbWnJ3rC7HIsjBO3HAcL3jM3+nsXzThfPoyAnl6507OV1XnUyeRXTFCZCpquFrtd5TT X-Received: by 2002:a17:902:bb84:b0:184:e4db:e3e with SMTP id m4-20020a170902bb8400b00184e4db0e3emr18718227pls.47.1669315196178; Thu, 24 Nov 2022 10:39:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669315196; cv=none; d=google.com; s=arc-20160816; b=f/x0uCoJVyMLjchtRHS/qFKNdJgX/4HzdGVZ7MKtlzSznKNeKZyzShVBE7Q6+h4MAA Je6JsGF6j+DLtQxDr+GsmZt+PYhfd8Sdo8BzVZF7UR0Nal4qqUjxF4vkxOiKM4al4x6l ochCqiT9S5hdyn9oPgbk36MhBM/NRGUKm/cjVSMFgmNBDK3RoJtu62ix4Rr4/MWz81rd S3cm+fpvPv0wHrsrE5hqCHR3Vh6pNEcc5s4ttaZ3Mbc3WkW3O9IFI3ko95XdCm3R/VhV nU0pdPP2RrUtKEKnFu+RT1rHLVI+o5+pCey+N2T4u4926LqkLdFLw2jVxI1rpA/8mpys tpKA== 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=3kTbFRyfWHcbzHx3yVRWYiE5rqpeYo8YEGSgadCWbj0=; b=cEckHwNw3XKB6POcyErQ+ZDdSzdnFoevABiz8DJljmQnJN16cGGZvCprkfwvDvmclH rzPBRV2v/VG91QZLqtnP2iBqL/XW1V//R27dTPUH49J/A+eHjTwu/G7wTLftqppGbUSd 47EmdZWdM5QRLsndMdYDziSB66YINzy2gJA0DCe3Z+5zi0OePgL3Yyn1R5xBTJRHP3RI E128XiKi9sKAikMmKushDmdEMXyzC5GEbYThBhC9jFGEMcosTeiYiXIVuePaYG40oW5k LxvBParaGI2DSH9Klfj4cniY0S1eg3IGKlQXnoPo5/8L16FKDbOEJFw8Ry46oEuJofc6 t5lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Vkg90M4m; 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 a185-20020a6390c2000000b0047697505449si2116936pge.365.2022.11.24.10.39.44; Thu, 24 Nov 2022 10:39:56 -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=Vkg90M4m; 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 S229863AbiKXSaW (ORCPT + 87 others); Thu, 24 Nov 2022 13:30:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbiKXSaS (ORCPT ); Thu, 24 Nov 2022 13:30:18 -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 057F7827CC for ; Thu, 24 Nov 2022 10:30:13 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BE17A21AC2; Thu, 24 Nov 2022 18:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1669314611; 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=3kTbFRyfWHcbzHx3yVRWYiE5rqpeYo8YEGSgadCWbj0=; b=Vkg90M4mNhJcUl8QrsNVtnjzD/xy95JD1njwwPURIS2xbYKAak3pq91OyUEEWIgE8igZ7e O774eKRuLMLhykcqjKfT9k7H8GqoFCJNav+XePn1gCNenOFEVRzBs/DZtFbkXMLj0S9LE7 h5erYl1fgbAu9caSEDDMQSKuoxW+4uk= 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 893A42C141; Thu, 24 Nov 2022 18:30:11 +0000 (UTC) Date: Thu, 24 Nov 2022 19:30:11 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: OFFLIST: Re: [PATCH printk v2 6/7] printk: Use an output buffer descriptor struct for emit Message-ID: References: <20221123231400.614679-1-john.ogness@linutronix.de> <20221123231400.614679-7-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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-11-24 19:00:14, Petr Mladek wrote: > PS: Please, wait a bit with updating the patches. I have got yet > another idea when seeing the code around dropped messages. > But I have to sleep over it. > > My concern is that the message about dropped messages need not > fit into the smaller "cbufs->text" buffer. It might be better > to put it into the bigger one. > > We might actually always use the bigger buffer as the output > buffer. The smaller buffer might be only temporary when formatting > the extended messages. > > We could replace > > struct console_buffers { > char ext_text[CONSOLE_EXT_LOG_MAX]; > char text[CONSOLE_LOG_MAX]; > }; > > with > > struct console_buffers { > char outbuf[CONSOLE_EXT_LOG_MAX]; > char readbuf[CONSOLE_LOG_MAX]; > }; > > Normal consoles would use only @outbuf. Only the extended console > would need the @readbuf to read the messages before they are formatted. > > I guess that struct console_message won't be needed then at all. > > It might help to remove several twists in the code. > > I am sorry that I have not got this idea when reviewing v1. > Well, the code was even more complicated at that time. Honestly, I haven't looked if you extended struct console_messages in later patches that added the atomic consoles. It is possible that the structure will be needed in the end anyway. This was just an idea. You know, I always try to simplify things. And many layers, pointers to the same buffers with different names, makes things complicated. Well, there are always many ways how to design the code and I do not want to delay it too much with trying them all. Please, tell me when you think that some changes are not worth the effort. Best Regards, Petr