Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4850240imb; Thu, 7 Mar 2019 01:55:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyeoOcL2SA8fG6MA6w6uDrG2JxVeH2EhBJa2/bw9UieTtUG12SkvFE+m1ubZZnPm1dhUsIP X-Received: by 2002:a63:f648:: with SMTP id u8mr10370953pgj.91.1551952501521; Thu, 07 Mar 2019 01:55:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551952501; cv=none; d=google.com; s=arc-20160816; b=v15loZBk9V9PEpFsBmsBfXVYJGrSIsgfEMaRLdOIjtvBD0DS9CZIeO9rs17y7eCgxR utMsdul4VDoiCjmkf08tRrIhok7Uij2WletiwISonW5f0J+m5o3AFGgYXLsO6rrl0BTH 1iFIyrnAaKgis1qV7yXoEVUZwb0aTJITj7FLWjKgi5VQyGYO6pIjjJmwLLdzhAVLwCe1 BhvRANCDOeRZxDApj/dMqCMpPRoRzgE3YRA16G05g9KjpGW84mE3FcSHiuW43rsAsDU9 HZjsA/MvK36zdT4n5HQxTj9ftfwfNcZnQq2LtwtVL2bazAgJo7moKoj9ZUxV75Lrzj80 7CAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=gHnApHJt1M/eGBjDMULt8DUKcKuN8mzSgHuHYmhr/Ns=; b=TrpHlpS1ksa0JWwFd+oQWbvcSBz6SogcJ89KBRCPvhDiZkmzGCPFQIjBrHowf8wVAT a79rfDUW5zJ1bNQCjtggCP52QDSZdYceODl1oCDiq0tHDGS2xkd2pTg4m0zy0qRH9nAU VwCnLEMOLRHnnAWLiKQhlN0O9sP9EHFOFaeCNK/ajboxYlhYPxcGthllOWhZetml50JM 5P+VgZfS1bSt2Sl60fZtof2RNaxpJdb9zWaBylH8P5ryy1mnHBf5LAuNKdIOkCjmGYu/ MS0AxiWFMEuom0kUGhijRtN35lkV/fIMUY2u2RmGhz3EZSU/pnnFRrrzShCPK91la6DM jA1A== 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 n10si3358025pgi.95.2019.03.07.01.54.45; Thu, 07 Mar 2019 01:55:01 -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 S1726150AbfCGJy1 (ORCPT + 99 others); Thu, 7 Mar 2019 04:54:27 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:53701 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725795AbfCGJy0 (ORCPT ); Thu, 7 Mar 2019 04:54:26 -0500 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1h1pio-0004Y5-DQ; Thu, 07 Mar 2019 10:53:50 +0100 From: John Ogness To: Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Petr Mladek , 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 References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190213025520.GA5803@jagdpanzerIV> <874l9721hf.fsf@linutronix.de> <20190304052335.GA6648@jagdpanzerIV> Date: Thu, 07 Mar 2019 10:53:48 +0100 In-Reply-To: <20190304052335.GA6648@jagdpanzerIV> (Sergey Senozhatsky's message of "Mon, 4 Mar 2019 14:23:35 +0900") Message-ID: <87lg1rggcz.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-03-04, Sergey Senozhatsky wrote: >>>> - A dedicated kernel thread is created for printing to all consoles >>>> in a fully preemptible context. >>> >>> How do you handle sysrq- printouts on systems which can't >>> schedule printk-kthread? >> >> If those sysrq printouts are at the emergency loglevel (which most >> are), then they are printed immediately to the emergency >> consoles. This has already proved useful for our own kernel debugging >> work. For example, currently sysrq-z for very large traces result in >> messages being dropped because of printk buffer overflows. But with >> the emergency console we always see the full trace buffer. > > Are we sure that all systems will always have ->atomic console(-s) > enabled? Is it possible to convert all console drivers to ->atomic? > fbcon, for instance (with scrolling and font scaling, etc)? No, I am not sure if we can convert all console drivers to atomic consoles. But I think if we don't have to fear disturbing the system, the possibilities for such an implementation are greater. > 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. John Ogness [0] https://lkml.kernel.org/r/87o96p9gtx.fsf@linutronix.de