Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2547053imm; Thu, 18 Oct 2018 17:05:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV62/oCKE1twsesxx9Jy2gjCAdJGgvuiUK9Z2RKgkoLkMDWW/oAHffFAE6jxWN6HmJKUnOXm6 X-Received: by 2002:a62:7501:: with SMTP id q1-v6mr32137347pfc.225.1539907551422; Thu, 18 Oct 2018 17:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539907551; cv=none; d=google.com; s=arc-20160816; b=anISCuiHJwq+n5k/uP6LaYuyQW8vji4XkxfFdynY1kh1ogPADPgiSiZ0l22FhYa0Io SGXt76ibOyw6mhLpe0M3WKn1GMW7ySzQZnAyy3DUF/4/WhpvB7zkB9ePsIwOzKZwJ7x6 0XuztNy7d8pAsTwZL0r2MDyGNZg5/r6BjYf1rir1BVH57wmPio6k00dUFGVVui4EY+Y0 /LZL69AhtqM/LEq8Ir+J+GUHK+t7G4Cg8SX3pa57q6DPIvamQf2lY4ObOoVh55+7ULPT kYn2guU0lc+G3VJ9uWw159caoVgDXn3spdadJsR+L3ABxzKQdVfA5Yk+MNUKnOEspkiw uocw== 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=GA8rT7XlOGh1smDGBnU2qZl/5BOoj6rKb6o9SbzHd90=; b=LH3ne6Zg9FTfxU0K/BGkE9Q5Zp2b2tbOKCrdDD15N3cYFaPP88vDPN3Ww+1G7S2jA2 givv8CsNwMLHi6QiW/CPCyofwmTu8hjme8l2x2uq3gdNHWvil+ZQrCMSrGTza0HAw6aJ XDp8tY/zn+DJJVEKpHeyhKzCp/kyzZjZRd5TCp0KAmgwZDtk4bkXCGxqWomUqwgqKCPW 1DX/8+CzmxbPvot1scto3gt70Uh3LoUlm7D1fD43kexLZef4oGD3cUI0Q3CKgyr4MhJZ du/SjqhboKGPpPwS8dXp3D+Oi8sckDefAf7R/mm4BmVjoR84V6AjM0PV4OLYWq4uYIOa 74UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HrJoASfw; 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 o9-v6si22492050pfe.283.2018.10.18.17.05.36; Thu, 18 Oct 2018 17:05:51 -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=HrJoASfw; 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 S1727453AbeJSIHe (ORCPT + 99 others); Fri, 19 Oct 2018 04:07:34 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34356 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbeJSIHe (ORCPT ); Fri, 19 Oct 2018 04:07:34 -0400 Received: by mail-pf1-f193.google.com with SMTP id f78-v6so9867754pfe.1; Thu, 18 Oct 2018 17:04:08 -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=GA8rT7XlOGh1smDGBnU2qZl/5BOoj6rKb6o9SbzHd90=; b=HrJoASfw6t0k7sfRBxizRvvtefWPnbgkz1ioriPC0kU0uB5KZPSnBjUueUTJCpfpEV UKyCWxW++HFumbmV1u+LHBoHd99dPfV0xFypHal7a6v29mvwN1FSTuFo2mkvjy2jSaAS 3vGMcL8p0SepA49dQLQIjk2zkpZb7XLnCoas1LU3xg0OZCquRHttNH10Bk6iTIq2bRtO 3D8Udc13XDmPlscFHyD1/Gc49hUw89hoVEspu/MVzvszBRT3BwrqV4sYfgzdE3kllATw dE9+kCHOnSXuRhkv7wnwVmvq9qZgb2VRtOr9UzZwvFurlgZU8iwosGSLP4VBo3SBv0F8 lBlA== 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=GA8rT7XlOGh1smDGBnU2qZl/5BOoj6rKb6o9SbzHd90=; b=b5B2Rlfm795bZGL2yDLVy6j4/wAL4yRLhjR1gW07gCAJqR+y2brW468akoYbvuWCUO D1xj7urTF9zD7rNOBovOoIJFXuIyt6zXWHB9FxjPv5WQrnzY628WhTbvAhV2UKgIJoX6 LeLxCKG8fRZfqVOWcm9O2eqEd5WXDjm3+wQiviAeiWcZ3UOn9D3obY+hk6AeP2DlNOZi trTSFAnZ8vP2s3NaCS7tFQ+V+MQSfKYBgGpf+59/zZMZYkSemBXsFUocvMnlGj4xjjaL LGJgBDCDcoaNjvOeNBIAIRizo7u7jLsDyXo1jDLQvPNn9Ukzz+vCclTMpBtrvqEMjRRY Q0xA== X-Gm-Message-State: ABuFfogA9tIKxLIgGkmxmXNMWAO5moEav0+4yAheK1vVS13B+FA0urpZ QD9dQL4QPFG1BZf/0o1Cdpnb2F6X X-Received: by 2002:a63:924e:: with SMTP id s14-v6mr29756624pgn.141.1539907447942; Thu, 18 Oct 2018 17:04:07 -0700 (PDT) Received: from localhost ([110.70.52.202]) by smtp.gmail.com with ESMTPSA id 130-v6sm21222667pfz.174.2018.10.18.17.04.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 17:04:06 -0700 (PDT) Date: Fri, 19 Oct 2018 09:04:03 +0900 From: Sergey Senozhatsky To: Calvin Owens Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , linux-api@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 1/3] printk: Introduce per-console loglevel setting Message-ID: <20181019000403.GB877@jagdpanzerIV> References: <08c1dc1a96afd6b6aecc5ff3c7c0e62c36670893.1506644730.git.calvinowens@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08c1dc1a96afd6b6aecc5ff3c7c0e62c36670893.1506644730.git.calvinowens@fb.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (09/28/17 17:43), Calvin Owens wrote: > Not all consoles are created equal: depending on the actual hardware, > the latency of a printk() call can vary dramatically. The worst examples > are serial consoles, where it can spin for tens of milliseconds banging > the UART to emit a message, which can cause application-level problems > when the kernel spews onto the console. > > At Facebook we use netconsole to monitor our fleet, but we still have > serial consoles attached on each host for live debugging, and the latter > has caused problems. An obvious solution is to disable the kernel > console output to ttyS0, but this makes live debugging frustrating, > since crashes become silent and opaque to the ttyS0 user. Enabling it on > the fly when needed isn't feasible, since boxes you need to debug via > serial are likely to be borked in ways that make this impossible. > > That puts us between a rock and a hard place: we'd love to set > kernel.printk to KERN_INFO and get all the logs. But while netconsole is > fast enough to permit that without perturbing userspace, ttyS0 is not, > and we're forced to limit console logging to KERN_WARNING and higher. > > This patch introduces a new per-console loglevel setting, and changes > console_unlock() to use max(global_level, per_console_level) when > deciding whether or not to emit a given log message. > > This lets us have our cake and eat it too: instead of being forced to > limit all consoles verbosity based on the speed of the slowest one, we > can "promote" the faster console while still using a conservative system > loglevel setting to avoid disturbing applications. Hi Calvin, Do you have time to address the review feedback and re-spin v2? -ss