Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1050564pxa; Thu, 20 Aug 2020 00:46:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqLvcHew5EmESm6dcYy7mWw1A+8ehMUDD84TSImhiVPtmAbPCQAVs4FAMBB/OGiIRObbMO X-Received: by 2002:a17:906:d18c:: with SMTP id c12mr1953394ejz.151.1597909581288; Thu, 20 Aug 2020 00:46:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597909581; cv=none; d=google.com; s=arc-20160816; b=dckiUY6gwWlutBqdAr9rhyYG+GKCjiHMGmR5rbUDsG+tcritak5j2jDRk+Bf/YTvri Ejzudoa78EUXCZ0tYRjlqMNe+jpaUxEVqKqlyVTtprnqhLOZ00faXkWuftButr2c7+kb y44RH2W7iQGAIfePBn4t09pO9c7tHOXioUH80RyVnh2v3JuB6+ToSoMSAUuC/L/tnf2C nfJGR6id8tXBolL7yn6TNAttI1c6CEOBTHdNFPwTDOe3Oc74Dj6erbbeQUFB/xbqjE2S rcfpoo+0IHtvdStTqlv44Ai7PiKG8PbJ1SY4OaPpgTYRef02vDYQ8WgGBf9oTuCl9FPn gSaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=owgUZf93rArX8WR/kayrj3rQPAuukuQ1POnsfqzskO8=; b=b+pGgViwAWn4hJl2V3Z5vEi5KuLAaWEIrtZkcwO8j7+/HaVYpTkCB1DuQ9aCC2i5MX OC+5dWR0gxARYneyoMh+A5fNooeibcES9Xe3zRSRdPwUffiUqcjL7TAPAP6i6MWwemxI mhW4SbaU9tTXpjtEXaHbIc6mxltCu79nI1wDmT+Xo+zAwKSn+Mu1fUdloka/VZldJ/SD b/ijGuZ5RBX5huM9iFPrm+rVE5qfsIN8BdIjKeKVFu/KKQiOtk7SkClSVzbpoEDdPIyB VLG0+goj6W232D7pF3QMDxiWADQp49es33/FiT7SvwQ3EmlaywrPUd7PwYmjTKKND6R2 WFyA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si914873edt.99.2020.08.20.00.45.56; Thu, 20 Aug 2020 00:46:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbgHTHo3 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 20 Aug 2020 03:44:29 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:52664 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbgHTHo3 (ORCPT ); Thu, 20 Aug 2020 03:44:29 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-79-EZQzNz_MMTW5m19NmXdomw-1; Thu, 20 Aug 2020 08:44:24 +0100 X-MC-Unique: EZQzNz_MMTW5m19NmXdomw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 20 Aug 2020 08:44:23 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 20 Aug 2020 08:44:23 +0100 From: David Laight To: 'Joe Perches' , John Ogness , Linus Torvalds CC: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Greg Kroah-Hartman , Thomas Gleixner , Sergey Senozhatsky , "linux-kernel@vger.kernel.org" Subject: RE: [RFC PATCH 1/5] printk: implement pr_cont_t Thread-Topic: [RFC PATCH 1/5] printk: implement pr_cont_t Thread-Index: AQHWdomYXzVvufyPxEOt+PNltcCbQKlAmzJg Date: Thu, 20 Aug 2020 07:44:23 +0000 Message-ID: References: <20200819232632.13418-1-john.ogness@linutronix.de> <20200819232632.13418-2-john.ogness@linutronix.de> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joe Perches > Sent: 20 August 2020 01:34 > > On Thu, 2020-08-20 at 01:32 +0206, John Ogness wrote: > > Implement a new buffering mechanism for pr_cont messages. > > > > Old mechanism syntax: > > > > printk(KERN_INFO "text"); > > printk(KERN_CONT " continued"); > > printk(KERN_CONT "\n"); > > > > New mechanism syntax: > > > > pr_cont_t c; > > > > pr_cont_begin(&c, KERN_INFO "text"); > > bikeshed: > > I suggest: > > printk_begin(&printk_context, fmt, ...) > printk_continue(&printk_context, fmt, ...) (maybe printk_next()) > printk_end(&printk_context, fmt, ...) I see some very long source lines looming ... Blue bikeshed: You'd probably want printk_end(&ctx, NULL) to work. Although the example doesn't show where the '\n' comes from. Although I guess it is now inferred and actually deleted from 'normal' printk() call. I've no idea how you'd 'size' the number of buffers. You could use kmalloc(), perhaps falling back on a local buffer. While might lead to: pr_init(&ctx, level, GFP_KERNEL); pr_cont(&ctx, fmt, ...); pr_flush(&ctx); David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)