Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp683130ybz; Fri, 24 Apr 2020 07:34:21 -0700 (PDT) X-Google-Smtp-Source: APiQypKegfXMq0fVlOTeUrgobQJlKTQfKPLeHH7a011QTFgNBEdyR4j0CSB3LMwTVC3lG6S6vFp0 X-Received: by 2002:a50:c60c:: with SMTP id k12mr7447134edg.111.1587738861228; Fri, 24 Apr 2020 07:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587738861; cv=none; d=google.com; s=arc-20160816; b=Nz3e3WhQpEeCm+DPb6UBfcujroobnR1BhedbC9qgEQl5IZoT3fWrHnvxORFFz+Klcx pgjHslMc+IgoMYctHYOcmDwSaHGhmNxe5x38CDKGuiq+qP0UgzcwWV60eta2d/HRMzYW koNO7IjEB4vPNt+dX3UNu4EvDsL4ygduAgp7gzQQhxOly7CRic1EG2H/hI4FuesENEJO Hm6Xz13GuSIdHeYxKfMVBckI61s9aM6XtAZ+rky5anNJMQoP8z7b+Le9T4rvttYxCt9b UwnQuIvYp5jHWTa0DtGMphWJ/H1lctZx+siW3hnes9t3rq4q/gC7KQRJNgMwegLdrR0w leRA== 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; bh=8WTlfAwikAi9rDw0Tesi9id/EX54Mc1ect41+8x0d7k=; b=wDLiuuzbQb3iUK5WnLw9KKS35qU1pLvkZr9tzeCFyKDxTVf8qoqXGQqBbfJJtZJ2yK wFQTa+z1Vi9d938U8DHo4t9I+6iM+ge7mlpRUxZTfeNpThp9m0tRarQM3LGei0qt7McW obSpdZl9cnfHe4TK1mdGOFXrejD3iw2Gqh9N//obmame89kOJ5m05L48heTheG10RWE0 C5+/RO7oi6haR/hqgPe0lQS46jtzE+rE9XOJa3L4skfkYlWLW319gdwhDuns5DAWnr+V gRQ4LaC/axXrQuz25nD0Ct2YdoI0oawDZ8fIgJJQvFiPxylXUioxnECvQmW6gX28YHZH j4PQ== 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 k11si3305515edk.406.2020.04.24.07.33.43; Fri, 24 Apr 2020 07:34: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbgDXObe (ORCPT + 99 others); Fri, 24 Apr 2020 10:31:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:34736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726698AbgDXObd (ORCPT ); Fri, 24 Apr 2020 10:31:33 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 053FD20736; Fri, 24 Apr 2020 14:31:32 +0000 (UTC) Date: Fri, 24 Apr 2020 10:31:31 -0400 From: Steven Rostedt To: Tetsuo Handa Cc: Petr Mladek , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Dmitry Safonov , Michal Hocko , Yafang Shao Subject: Re: [PATCH] printk: Add loglevel for "do not print to consoles". Message-ID: <20200424103131.7987f890@gandalf.local.home> In-Reply-To: <579fbe97-9aae-2b67-03ff-01291b9cbb7d@i-love.sakura.ne.jp> References: <20200424024239.63607-1-penguin-kernel@I-love.SAKURA.ne.jp> <20200424092816.62a61b1d@gandalf.local.home> <579fbe97-9aae-2b67-03ff-01291b9cbb7d@i-love.sakura.ne.jp> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; 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 Fri, 24 Apr 2020 23:00:01 +0900 Tetsuo Handa wrote: > Since KERN_NO_CONSOLES is for -ENOMEM situations (GFP_KERNEL allocation which > can sleep needs to invoke the OOM killer, or GFP_ATOMIC allocation which cannot > sleep has failed), we can't create buffer on demand. For process context, it > would be possible to create buffer upon fork() time. But for atomic context, > it is so difficult to create buffer on demand. We could allocate shared buffer > like logbuf but it means that we have to replicate what printk() is doing (too > much code), for when atomic memory allocation happens resembles when printk() > is called. Borrowing printk()'s logbuf is simpler. I would have a buffer allocated for this at start up. What exactly would you be "replicating" in printk? The point of printk is to print to a console, not to be a generic ring buffer. This change is breaking printk's most useful feature. -- Steve