Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp994531ybk; Wed, 20 May 2020 18:05:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzm1ZXMj9Yjg/TRNvDTo2o1Fk1QroUdlNm+YEKOjCR+pqd74S7ZNG/GLw2Aj8bGGRgPlzJY X-Received: by 2002:a17:906:3048:: with SMTP id d8mr1430852ejd.97.1590023122926; Wed, 20 May 2020 18:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590023122; cv=none; d=google.com; s=arc-20160816; b=IFinZkj9ztZK5BnZM5jKJLE7JZ3BqrRxMqKiHFhqnufteja8SyqcLe5iDT6m9gCTmE XA9aaE3OWLnJmGZk+jUlmb1lkicGVwQuGwfNALlB32SK7FcU2O0KRmO7awX4a3p6ITwN g/ufB1dYgugJFEjDz0zT/ZqHxp3sfO2N3Pk1hW6sSFWC0OYQw2ydsSZy3pvTytBx0Kn7 pnbRPXjUxyomAQxSL4WdydPHke0Rh9tcQQH86Dgs9/9YWEwVKAxdtCLC9qV0mub8VOB5 9nNnWA4tmonW9/vak+ydEjzXN9ogJp44bpB8JVR3hSKsB9RuBmYVhmym1Rl/pc6dibrr OE5A== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=fz1NcqyioC6aRAmmhWSaGE5/izWyf1VbUcBsHpg8LmY=; b=tOvgulnWRkx8NkobQgWZBDFXHOvgzyLN8/IQnvLDKIWsFylRk2NrFGo0cdN6etqOZP bdSKqMpeN6nyTbF2IwFniEyTt1cPrcjKLud4yQwt066FPsLUvdTJmjJNc81u5UE1QsJ8 mB/yuOTdhLwu2g+0dwlxoN5WWyzPmjLfhDmjoXJr6XUNgUFp64pkW5n/YKGPM+klyIu/ Ka9FM5l3OMOncsSZu8zgiho7UpqwQ8h9jvSjrlyfeVPh3wyhnMcMeQWO6r36yonjl+26 b2k3U4B3h8y1/UwV3dUcZTwh5ijtm7NGwPz0JVWNdaYCWEzBluqFT1VNDi/dqhvQrKbt /zsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mlD0NWP7; 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 13si2327234edx.388.2020.05.20.18.04.59; Wed, 20 May 2020 18:05:22 -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=default header.b=mlD0NWP7; 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 S1726925AbgEUBAb (ORCPT + 99 others); Wed, 20 May 2020 21:00:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:44300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbgEUBAb (ORCPT ); Wed, 20 May 2020 21:00:31 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F1F1720756; Thu, 21 May 2020 01:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590022829; bh=YOyt1iDZVUUF5ekq+tL2O9qk5txddvwGrHYhkwkU7Xk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mlD0NWP7mOFXhfGd7hLIoNkhNthShxdnvrcRNTfrEhZvUhqLd4P8uDMwUQYOa96TD nnCrSNKSIUyMutss4d4RUOgcUKKysOTZ85Do0XbIjZYwnbiPioXc9rL79jOl9NazdK QPKlRbrSbSStWW6j40BI+vDAZp+OgHyLGZ3zM4b8= Date: Wed, 20 May 2020 18:00:28 -0700 From: Andrew Morton To: Joe Perches Cc: Sergey Senozhatsky , Chenggang Wang , linux-kernel@vger.kernel.org, Petr Mladek , Steven Rostedt Subject: Re: [RFC PATCH 2/2] init: Allow multi-line output of kernel command line Message-Id: <20200520180028.8fc1b7890774c6f92a6c2623@linux-foundation.org> In-Reply-To: <19a8c717f8d9dc76f2b09e6dd19f3fbb71bf29c5.camel@perches.com> References: <2b3832fed9370f0f8dfd1ea33dddb1d05a36e265.1589916689.git.joe@perches.com> <20200520044127.GB938@jagdpanzerIV.localdomain> <20200520121000.GF520@jagdpanzerIV.localdomain> <19a8c717f8d9dc76f2b09e6dd19f3fbb71bf29c5.camel@perches.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 May 2020 13:36:45 -0700 Joe Perches wrote: > On Wed, 2020-05-20 at 21:10 +0900, Sergey Senozhatsky wrote: > > On (20/05/19 21:58), Joe Perches wrote: > > [..] > > > > Maybe we can > > > > use here something rather random and much shorter instead. E.g. > > > > 256 chars. Hmm. How > > > > > > min(some_max like 132/256, PRINTK_LOG_LINE_MAX) > > > > > > would work. > > > > An alternative approach would be to do what we do in the > > print_modules() (the list of modules which can definitely > > be longer than 1K chars). > > > > We can split command line in a loop - memchr(pos, ' ') - and > > pr_cont() parts of the command line. pr_cont() has overflow > > control and it flushes cont buffer before it overflows, so > > we should not lose anything. > > It doesn't matter much here, but I believe > there's an 8k max buffer for pr_cont output. > > include/linux/printk.h:#define CONSOLE_EXT_LOG_MAX 8192 > > Anyway, no worries, it simplifies the loop if > done that way. I'm wondering if we shold add a kernel puts() (putsk()? yuk) which can puts() a string of any length. I'm counting around 150 instances of printk("%s", ...) and pr_foo("%s", ...) which could perhaps be converted, thus saving an argument.