Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5777440imb; Fri, 8 Mar 2019 02:00:59 -0800 (PST) X-Google-Smtp-Source: APXvYqyJJlsMRFVJbtopi6q+KViSdRRzrkheSJg9N7fwZjf/w8GxF+3lvihA9RkeTTyyk+u97jaK X-Received: by 2002:a17:902:9a09:: with SMTP id v9mr17434751plp.225.1552039259230; Fri, 08 Mar 2019 02:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552039259; cv=none; d=google.com; s=arc-20160816; b=Sf3lWUmtI3dMlgky1bOiYFhE123KSKHPz2TFV736YGKPz2fFdv8JskF26ILWco9xn0 qDKU91lcjR1LFBRIqnlEtiCxXQ/WURj55M17lZmpX99YK7MwpTgFY6J6NmtL71t0OtL6 hnnDbdX0+glvYtxhpV8YsxgHGxwgAk688hXfaWdwgv07LuHmWHHzZLrk0BieN/U4DQo7 OOhABZnYX1dpQhzMj0thf5xhpv9iL6E0wvlxnD1U/veEgLNwhlyxukxUonytAydwBXUT ij/DZfhKwyuU7AP1U6mT74oiWOEEnDy8ol0iET0dVkbyDKhQyPknP00Qzma0fSS6+MvY DzoQ== 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=Ncw/3XA3GlO6WnrxE1ApCYjJVkahQoMYkqwKJk6dhGw=; b=twAsE/uG8d/NMEyDVjk9bGzkeMvp6hxSHVz34LS9vnHiatp2Vz3ciFPBQP2S+R9gps EEHE8RJyHg3TzIcPyYC5D9pXsMbaBUun1m6BEDNl53M0SgYNIeT6GYYAvDfQlyuJkX95 BnIAYdQauwPMTzzvas8CJhgz9CDnUw8U577aqAKT1Z4W0ljDXeulQSob6x994c6jMB61 4mYCmo9NvPVnpotoN0hStSqZB6I620pJclxhg7eMWF+90LbMft0G5q2DgpHuc9cxch1N JllCB0ttiPniOCuF/RpjHbK7UsISNGu7DXKwCBW0jqfkQ34FcUjy55sLQi3ukjg91vfF EURg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b27si5921701pgb.366.2019.03.08.02.00.43; Fri, 08 Mar 2019 02:00:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbfCHKAW (ORCPT + 99 others); Fri, 8 Mar 2019 05:00:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:53384 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726286AbfCHKAW (ORCPT ); Fri, 8 Mar 2019 05:00:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C0977AF50; Fri, 8 Mar 2019 10:00:19 +0000 (UTC) Date: Fri, 8 Mar 2019 11:00:16 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , linux-kernel@vger.kernel.org, Peter Zijlstra , Steven Rostedt , Daniel Wang , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , Alan Cox , Jiri Slaby , Peter Feiner , linux-serial@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC PATCH v1 00/25] printk: new implementation Message-ID: <20190308100016.d2v6avtotjo3eyxo@pathway.suse.cz> References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190213025520.GA5803@jagdpanzerIV> <874l9721hf.fsf@linutronix.de> <20190304052335.GA6648@jagdpanzerIV> <87lg1rggcz.fsf@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lg1rggcz.fsf@linutronix.de> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2019-03-07 10:53:48, John Ogness wrote: > On 2019-03-04, Sergey Senozhatsky wrote: > > If there are setups which can be fully !atomic (in terms of console > > output) then we, essentially, have a fully preemptible kthread printk > > implementation. > > Correct. I've mentioned in another response[0] some ideas about what > could be done to aid this. > > I understand that fully preemptible kthread printing is unacceptable for > you. Since all current console drivers are already irq safe, I'm > wondering if using irq_work to handle the emergency printing for console > drivers without write_atomic() would help. (If the printk caller is in a > context that write() supports, then write() could be called directly.) > This would also demand that the irq-safe requirements for write() are > not relaxed. The printk-kthread might still be faster than irq_work, but > it might increase reliability if an irq_work is triggered as an extra > precaution. It is getting more and more complicated. The messages would be pushed directly, from irq, and kthread. It would depend how the code would look like but I am not much optimistic. Note that you could not pass any data to the irq_work handler. It would need to iterate over the logbuffer and take care of all non-handled emergency messages. Anyway, we could solve this later. We need to keep the current console_unlock() handling as a fallback until enough consoles support the direct mode anyway. Best Regards, Petr