Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1118605pxa; Thu, 13 Aug 2020 00:33:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8mThHQni/llRh2eFcVmzL3y/xI8jUL34/+DU/Ut6TcMbI8O9lpl6Kqu2oub5n7vgLrPK8 X-Received: by 2002:a17:906:6558:: with SMTP id u24mr3375331ejn.364.1597303999917; Thu, 13 Aug 2020 00:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597303999; cv=none; d=google.com; s=arc-20160816; b=KMocawJNvCmePLxYYLCHrgZHecBGu/1MCqhBKeiPUWvwymfcosAhi5EVx98tMDkuXF fA6OdUL3/3udpxClCGwi8cGjifErPQC2f1d4qXo7bDpnYBQEmLMTgLasO1Bm6Mbm/iap hrJDbgLW2C9xs9OablwqagzEZ2ug6lusvRGIEkMO+z74LVbyXONYzGWArmSuOeNQUo28 bG/UYy/yS03vTlfsbDZ+dFfTAn9rDkr4vlSNpEwM8YKXeeB414plqfMsyUj8bxO9fEIt oLwb/rxtJxrKlQcazDGmohcICOG/7/TVDiY2o7AkZXFtSdggNpdAWmD5JeLrEp/Za7Gf tDPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=N8QnkqgwzNEd7OqpEocX5Pz0tKKwoGXsVQW7HVv+Ahk=; b=tYx+8xqRYoAs62Wb+ygHH3uPFIHJl0cGCi4bjwALvMOh0U1u+Dm7XYC9AypZEzvZ9U wTacGYoSc/Op7BhAaJe32WriVSFhNPtH94C9aQY3sGImegSZcJDbe8afIAK9xTwRELB3 pt9TKzPY/HZeLGnIl8i2/Aka9gD1dv8NLL44xWJulInKPIaLUofuPT2c7kQ1tkz88Jft PgnauZxOchfkT9Bayyj8LyIj0xArYuldHruds6wlA4OMuK7CCUic4iy8Y0minIi1KBG+ 3HtCOxQJbaJu4dofJACEGImhlkPO8bAsoQGvHXoVnYdHOWFtflre66i15rTK8ownNnH5 L5XQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si2803253ejj.541.2020.08.13.00.32.57; Thu, 13 Aug 2020 00:33:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726486AbgHMHcB (ORCPT + 99 others); Thu, 13 Aug 2020 03:32:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:55544 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbgHMHcA (ORCPT ); Thu, 13 Aug 2020 03:32:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3F77DB1ED; Thu, 13 Aug 2020 07:32:21 +0000 (UTC) Date: Thu, 13 Aug 2020 09:31:58 +0200 From: Petr Mladek To: John Ogness Cc: Linus Torvalds , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Greg Kroah-Hartman , Peter Zijlstra , Thomas Gleixner , kexec@lists.infradead.org, Linux Kernel Mailing List Subject: Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling Message-ID: <20200813073158.GI12903@alley> References: <20200717234818.8622-1-john.ogness@linutronix.de> <87blkcanps.fsf@jogness.linutronix.de> <20200811160551.GC12903@alley> <20200812163908.GH12903@alley> <87v9hn2y1p.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v9hn2y1p.fsf@jogness.linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2020-08-13 02:30:02, John Ogness wrote: > On 2020-08-12, Petr Mladek wrote: > > So, I have one crazy idea to add one more state bit so that we > > could have: > > > > + committed: set when the data are written into the data ring. > > + final: set when the data block could not longer get reopened > > + reuse: set when the desctiptor/data block could get reused > > > > "final" bit will define when the descriptor could not longer > > get reopened (cleared committed bit) and the data block could > > not get extended. > > I implemented this solution for myself and am currently running more > tests. Some things that I changed from your suggestion: > > 1. I created a separate prb_reserve_cont() function. The reason for this > is because the caller needs to understand what is happening. The caller > is getting an existing record with existing data and must append new > data. The @text_len field of the info reports how long the existing data > is. I see. > So the LOG_CONT handling code in printk.c looks something like this: Yeah, it makes sense. > 2. I haven't yet figured out how to preserve calling context when a > newline appears. For example: > > pr_info("text"); > pr_cont(" 1"); > pr_cont(" 2\n"); > pr_cont("3"); > pr_cont(" 4\n"); > > For "3" the calling context (info, timestamp) is lost because with "2" > the record is finalized. Perhaps the above is invalid usage of LOG_CONT? I am going to answer Sergey's reply. > 3. There are some memory barriers introduced, but it looks like it > shouldn't add too much complexity. Uff. I have hooped for this. > I will continue to refine my working version and post a patch so that we > have something to work with. This looks to be the most promising way > forward. Thanks. Uff, I am happy that it seems working. Several other approaches looked much more complicated or they caused regressions. Best Regards, Petr