Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp979250imc; Mon, 11 Mar 2019 03:55:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJAq1D3/iRuXbLzZHm2eVMwuOmWOvagFKD3cAz88khPVxA6KlbsQhm52hitSzHMTSaxNhW X-Received: by 2002:a62:5c87:: with SMTP id q129mr31915631pfb.180.1552301706747; Mon, 11 Mar 2019 03:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552301706; cv=none; d=google.com; s=arc-20160816; b=uAJAbW/UXRmk1Az37M1SGvY4nTrwtO5td9oAKlVWdoZ9wNByTgJ1q/MrVEJ8Qb0Pcn NqOaSG4vjwcAGucJ4AyybIJ91KHDYo+ANEvb0/f+/npFR+ReK3ejGknaQ5Xugy4eyhpc 13X3KqASJ5GLLiBN74fbMihCw3leLcX/AL6p9o8oYbGQwWtoXj5B1eDDMjguCfUlvfx3 2CQ08cdjIEAHxAjuD+LKK5sUBzUPoKgxhWagNLIYm5fzQEFHuErxZ3JY+SN6RSsUgPmq iOQYyQWwLofVp5rSJ3iMd1TEK2AJkNf3iQPHz5jsCOLtXBY/gpMFc99ytJqx8PIdW6H3 7o8A== 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:dkim-signature; bh=f9GUBLzPM6PHpJSqSDnCR+4kzjT/7SfvFLCfRMnAwXw=; b=ha5DSy38ECzvxmHJO0jYeca4ZlZCD2kY7+kG3pt6zam6EsEf3jNDQoOnW+c+Euo6CU aUPVl/6oIIvyHzSdPVoIG0sFT6d9E/wstlAwdWiNejAgd15+sxFWUuIaWsm2U+Fmf3/e gzDOLkGgy9MOl7ctjCWsqIGx0xnQlBvU9QilevPcI9Tf3qw+ADvlnIkuGIJUB0vkqK8K P8C3lJOB6xeZQDOMKS0WAe0/z3JAD0MOhELn2N/oeJo/uFr2iY6gcmEuBwDey5Eq9k4P o9JoFlHKed656RoF6fAWZ8bUYBWkL99pI2Sd17Sk0ftPpmhmDNTPkEecT7t4fuj0rI95 2b7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jnh7wUaV; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si5049075plt.12.2019.03.11.03.54.51; Mon, 11 Mar 2019 03:55:06 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jnh7wUaV; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727220AbfCKKyR (ORCPT + 99 others); Mon, 11 Mar 2019 06:54:17 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40363 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbfCKKyQ (ORCPT ); Mon, 11 Mar 2019 06:54:16 -0400 Received: by mail-pf1-f194.google.com with SMTP id h1so3409977pfo.7; Mon, 11 Mar 2019 03:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=f9GUBLzPM6PHpJSqSDnCR+4kzjT/7SfvFLCfRMnAwXw=; b=jnh7wUaV5Q0iZ5qFLqFJL4KdSKIQ8fxLnK2EP9Ivio0fDiy2WMZ/9ew2ktBG3XeVs9 PLd2H1xu/fcVOerxa1UXgWdjF1YJxBUBqneA5RbWfIaBA8ao/csL7eabPrA3TBP5BnZH FhM86O4gzSYVsXijSHZZFyCDBhOfinWCI1wk1fqunqoNMCa3zwpAbMUSPLETSozkGSw6 Qk6eyaLmmrXj9PIyQTdZzNMgAgcUXWiBhIaohnw6ohnngwTSr2VeN9M1S666KEL7Tn2b uxaPAS23H1u0zzNN3Zz5m8vxrwmLDxxREzige5XpGsp8bOxSHr3igqLINGkJXF+QGkrD Yw2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=f9GUBLzPM6PHpJSqSDnCR+4kzjT/7SfvFLCfRMnAwXw=; b=Pjwm0FJIucBsbpOsWh2896sdICIQ6UoWx/mS9HkxyC2Hm+l18zc+7m4WdnCagURRDp YdW/FwHUP04HaIzls3h0vsqOzd0xOOFk1pRuMXghxokarpNxShJS1grTNH8eaSkV7U9S ulLN5qWeeLvgU4s9/7Y3jfyvTq+vIGlEpnhrgCapmsEjZ+BK67owPFWoK4GKjZNa11Xp KvpiWsIZUyR2yHaK19FT+h/3gdTaRhHt8YRQDT8kCFwZ4Rm0o5RT/Hi25WB/iKWQefIn vkHEvUHdbufKeJMfC5f0ShgNHZjcS2vfYwPtxKCTLxowJgANay5+4MSCA/8245MKeNUL +brQ== X-Gm-Message-State: APjAAAWKmgP7498DqC2I2HYRyXmwK+TyjtN9C6cQ5A8VFUxe2EHl5+vX GPPjOEkjZtECobFv47k/b6Y= X-Received: by 2002:a62:ea0f:: with SMTP id t15mr32823425pfh.124.1552301655756; Mon, 11 Mar 2019 03:54:15 -0700 (PDT) Received: from localhost ([175.223.26.132]) by smtp.gmail.com with ESMTPSA id p2sm7583221pgs.7.2019.03.11.03.54.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 03:54:14 -0700 (PDT) Date: Mon, 11 Mar 2019 19:54:11 +0900 From: Sergey Senozhatsky To: John Ogness Cc: Sergey Senozhatsky , 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 Message-ID: <20190311105411.GA368@jagdpanzerIV> 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: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (03/07/19 10:53), John Ogness wrote: [..] > > 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. Well, it's not like it's unacceptable for me. It's just we've been there, we had preemptible printk(); and people were not happy with it. Just to demonstrate that I'm not making this up: > > From: Tetsuo Handa : > > [..] > > > > Using a reproducer [..] you will find that calling cond_resched() > > (from console_unlock() from printk()) can cause a delay of nearly > > one minute, and it can cause a delay of nearly 5 minutes to complete > > one out_of_memory() call. preemptible printk() and printk() do opposite things. I can't really say that I care for fbcon; but fully preemptible netcon is going to hurt. > 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. Hmm. OK. So one of the things with printk is that it's fully sequential. We call console drivers one by one. Slow consoles can affect what appears on the fast consoles; fast console have no impact on slow ones. call_console_drivers() for_each_console(c) c->write(c, text, text_len); So a list of (slow_serial serial netcon) console drivers is a camel train; fast netcon is not fast anymore, and slow consoles sometimes are the reason we have dropped messages. And if we drop messages we drop them for all consoles, including fast netcon. Turning that sequential pipline into a bunch of per-console kthreads/irq and letting fast consoles to be fast is not a completely bad thing. Let's think more about this, I'd like to read more opinions. -ss