Received: by 10.223.164.221 with SMTP id h29csp4470155wrb; Thu, 19 Oct 2017 16:42:42 -0700 (PDT) X-Google-Smtp-Source: ABhQp+T1sz1BBhryUTIAjpkrOl2ys3zSKemPFP3QgUCQ2ggDDH/FeYFTlywfO8kTaKBmhoZL3equ X-Received: by 10.98.60.198 with SMTP id b67mr3074340pfk.163.1508456561948; Thu, 19 Oct 2017 16:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508456561; cv=none; d=google.com; s=arc-20160816; b=PdZpHkRxDQx1ngXw2LZNORJdYE+KjP7aswAkNT2s4MpQCoX8P9NXmjWIoNkoSirp37 +oYHeum3gScTqB1tAbf8Qkk0gtxq0pSNZqJ4/YLGyNKSREwKy7GWU2olXGciZ3jkwImW E/SddaXpIw1ETNc5FmKnNrpSkbmtpc8N2U9hBU9Ofypl3ABNI6k8gkw3xRrFvoIBBIAM Dna7uH5suKrEx1WLcl2LsisdHPfsnjrTIEkyVEuOkIVw1V5vtTJNOs4eyvk6pRFhmiJT zmKpPxOlkS4RRJZBzQOEmYrNwSbSX43DyH5h+Ikste1XU5lhZZwhcJjrdO/y2Zjn81Wj Qfng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature :arc-authentication-results; bh=e+tnnKKI+2bKUpIZkIX8C0zL1JY53oyhTjSQOpCSmpA=; b=bhz9doa9noUePSd+nCFH+IPszujllV/W8qJhpGCumNpAR9JaFyX0Goc4B+r5WtmKJy zBjGGKQIS+rV/s0VHQAvVSbX8C8Zf3ZFDuY9cyQm+FO/R9W39lRBxovHn3oJr9pjk1Da Zwv/GY67jdE10+8Vouyiu2PSnmVQ85kZzdD3QJ5fcX1V3j4lBHJH+sHwU8LHBYn7aZHx hfOXfAxeEf6GN/uee9d2sWPtfyMB9P0DgziHGCu4yCa1/Tie5o0mS70IFXWTj6DFp84y gEi7XEH7Lvr4jwo/T7KCB00A3Nfh3fjPhE4BvLiUS49c6rHPxl5nvPvjYUpNF3VMd7g+ F5rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=QN9UFvpK; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=eAl8PN4K; 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=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v32si8839829plb.415.2017.10.19.16.42.27; Thu, 19 Oct 2017 16:42:41 -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=@fb.com header.s=facebook header.b=QN9UFvpK; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=eAl8PN4K; 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=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751576AbdJSXmD (ORCPT + 99 others); Thu, 19 Oct 2017 19:42:03 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:45970 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750993AbdJSXl7 (ORCPT ); Thu, 19 Oct 2017 19:41:59 -0400 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.21/8.16.0.21) with SMTP id v9JNb74S003711; Thu, 19 Oct 2017 16:40:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=e+tnnKKI+2bKUpIZkIX8C0zL1JY53oyhTjSQOpCSmpA=; b=QN9UFvpKPDlhtOUtNVxvxcCxyknj3VXibn50gs7LxUo5UT1geClcM2nsdiKU12tObsw6 +fyq687qyi7uOOVK8bwmdP0oGl1+wzS6IppjQmv1fa9WW6/3pQIxXuTbzqFcXb6Ioi5A EcvvwmSjx+76ke5LWn4Y3/GrkchhXwKScVo= Received: from maileast.thefacebook.com ([199.201.65.23]) by m0001303.ppops.net with ESMTP id 2dq11shajs-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 19 Oct 2017 16:40:53 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.29) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 19 Oct 2017 19:40:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=e+tnnKKI+2bKUpIZkIX8C0zL1JY53oyhTjSQOpCSmpA=; b=eAl8PN4KQ3PgZUzhaFDWxLbyDzvniWaLvRUK7mDlK4aMhvzVXWfpV8CCgVBeteb63pAxY1Pa0/kTOrSPQeYZvFxvYj2TVN6oJ/v1++hP20x8sq0H3p9B0tqh2j+7PzTiecUmldV1iZpdtD4/OmS2AbadhCx+wfjdQd4jmyxjZXE= Received: from [IPv6:2620:10d:c082:10e2:f854:b4a:e5b7:56db] (2620:10d:c090:200::4:b52c) by BN6PR15MB1218.namprd15.prod.outlook.com (10.172.205.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 23:40:49 +0000 Subject: Re: [PATCH 1/3] printk: Introduce per-console loglevel setting To: Petr Mladek , Sergey Senozhatsky , Steven Rostedt CC: , , , References: <08c1dc1a96afd6b6aecc5ff3c7c0e62c36670893.1506644730.git.calvinowens@fb.com> From: Calvin Owens Message-ID: Date: Thu, 19 Oct 2017 16:40:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <08c1dc1a96afd6b6aecc5ff3c7c0e62c36670893.1506644730.git.calvinowens@fb.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::4:b52c] X-ClientProxiedBy: SN4PR0501CA0054.namprd05.prod.outlook.com (10.167.112.159) To BN6PR15MB1218.namprd15.prod.outlook.com (10.172.205.148) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fa4a3bd7-08cc-4b58-3b3c-08d5174ad47d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254172)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423095);SRVR:BN6PR15MB1218; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1218;3:y+CtMeBtwkczamxge0wcGVSFzRWPEyc6n6pgxnW/aArdHO50p1ecZTWomQlDQ3TKF+if6YEqHY65MIGkK+QQ3lODB3HbXvS0BKarlgd7/Q6vrGV21NM0E207yrxkhs1JHSaodUdmDKc1J7LoHsqf2waxHyZlVO+M8squpOcRHt8hGCm95To1EZLzRm1L5ogruEA1z5UCMv9ElG9Tf4arKM9wdLPEdEeQHGnt0a3Ja28o7YSxiBCVkf49wqMc2iwB;25:LUyPlV1DwXriWDuUiWM1H+fof0fV/tbWyKGi56YhtDy/KzQDznbO7ZVsfi7Xpg2msKy74EzfaqyAsc8q31XM2Ma9/N7C9F4c9HKf1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B/jCgfxoazn1H;4:tpuLnIg7pmk2DGWR61ODSK7SwVLRZTC0cK1YUl8oJ26fyzk5M7djG4HGcRtrOZ5Ek0jOY3hZTJvtalHXuHMDtQYCoVKxs91kX7p8kRzoAUxiGVIYf1MkvK9pwffBUQ79fUFu6Qr0zmlTljLnJSfagFUnR6mMBTw+WDbyK46k3P1QwNHNwZAeS+ZNiqx3+9LYFx0XSpxOvhCpRG3Td3qcStm/oq2itP5kBB2RbqUnYr+QId0dlfJnSIhmJM4e8gsO4StrusxrlgSQY3dCcsXogMIVGGNizy9u5ULz2yF7u7JktQZ+Nx9g7qAgpcwT3NMvaiKv5K01B2D+bqPgUWnxtA== X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(81227570615382); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123558100)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR15MB1218;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR15MB1218; X-Forefront-PRVS: 0465429B7F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(199003)(24454002)(189002)(478694002)(966005)(53936002)(6246003)(25786009)(53546010)(316002)(4326008)(7736002)(58126008)(110136005)(305945005)(97736004)(39060400002)(76176999)(6306002)(81166006)(64126003)(50986999)(1706002)(6116002)(8936002)(478600001)(230700001)(5890100001)(8676002)(23676002)(54356999)(50466002)(81156014)(31686004)(2906002)(6666003)(33646002)(2950100002)(101416001)(86362001)(31696002)(36756003)(105586002)(65956001)(68736007)(106356001)(65806001)(47776003)(5660300001)(6486002)(229853002)(189998001)(83506002)(65826007);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1218;H:[IPv6:2620:10d:c082:10e2:f854:b4a:e5b7:56db];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjE1TUIxMjE4OzIzOlduZzI1di9iNGFrajVxcTBDUVhVN3VMZ0du?= =?utf-8?B?OEZvTFBCUzl3SHJiNndQbkdHSVR6V3NrMUpOTStXU25tbnJybjFsMTArN2Zq?= =?utf-8?B?ZFFDS1J5cHZYU1pCZWdDWG1HaHczNzVpVUJ1OG8wQTVyQi95dCsvSnZDUThC?= =?utf-8?B?eWRwSWEzNHJPdDV4Tngvdlg0VUNOL3hNOXBKRWlDVUxSWTFnaHg1SVh5eldz?= =?utf-8?B?elVNNzhlWmdBcXJ3clZuTzIrRTZqbnpra01Yb1BFUWhGcVYycDhHcmtoWHgw?= =?utf-8?B?dWlsaEN5NjdQQ0lvbElZaHVxQzVuT2pGNmNUY0JNVzNpNUtJZzFMa2MyWThG?= =?utf-8?B?aElodHYrMTdMTVdCaE5ZYVlyTXNLWmpDTVR1QXhzaW4yWGxiTkVYR2JtNmR3?= =?utf-8?B?U01IckZqbUVBKzJpZVRrbXVXaWpMN3dOMG1qMkcrRTZTNW9MY255b1g4VUp2?= =?utf-8?B?K2NsdFVYZlNZYktBcUJVd1g3aldYNVFCYnkxUCtLcDdXMXJDRHhzMVBzNEl2?= =?utf-8?B?SFFPOVA5SVFDUU9ZT09IcytkUHdyajlodG1WWHBZY3FrUnBtZytiTGhsbjRX?= =?utf-8?B?WStmU09lTmk1R0FrY25TbGdHTkFzZjg5NHBhR09icmU3VXNBT3lKSHhUVDY2?= =?utf-8?B?Y2JUNnArbEZFbkVodVlQOVZ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KzwgzFuuZR/91CNO83TC7QTb01zRg5+dMt5WE8SxAN3OnYP3pf94mzWJ8aWK2NyfqyZbKzKaw63VvVjaWkLRzNuJi7z4KRvU2o0oxAbmy7Tz4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1218;20:NSLLvFOBtC66GDYOP78f8uYnZO9XknoFA1worna2B5mP5/aBjTLdoIBP/+biNb/YCxDuVgVmw8ktmoXxtgPXeiGnc11WVW8aLRKFXfIezVsOLPhPIFEKkZxZmQYKKqkJZSPsX4/ajPvsr7CYup96SkZ0HXV8+PcFljHZ+5k2F9c= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 23:40:49.2945 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1218 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-19_12:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/28/2017 05:43 PM, 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. Any thoughts on this series? Happy to resend again, but if there are no objections I'd love to see it merged sooner rather than later :) Happy to resend too, just let me know. Thanks, Calvin > 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. > > Cc: Petr Mladek > Cc: Steven Rostedt > Cc: Sergey Senozhatsky > Signed-off-by: Calvin Owens > --- > (V1: https://lkml.org/lkml/2017/4/4/783) > > Changes in V2: > * Honor the ignore_loglevel setting in all cases > * Change semantics to use max(global, console) as the loglevel > for a console, instead of the previous patch where we treated > the per-console one as a filter downstream of the global one. > > include/linux/console.h | 1 + > kernel/printk/printk.c | 38 +++++++++++++++++++------------------- > 2 files changed, 20 insertions(+), 19 deletions(-) > > diff --git a/include/linux/console.h b/include/linux/console.h > index b8920a0..a5b5d79 100644 > --- a/include/linux/console.h > +++ b/include/linux/console.h > @@ -147,6 +147,7 @@ struct console { > int cflag; > void *data; > struct console *next; > + int level; > }; > > /* > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 512f7c2..3f1675e 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -1141,9 +1141,14 @@ module_param(ignore_loglevel, bool, S_IRUGO | S_IWUSR); > MODULE_PARM_DESC(ignore_loglevel, > "ignore loglevel setting (prints all kernel messages to the console)"); > > -static bool suppress_message_printing(int level) > +static int effective_loglevel(struct console *con) > { > - return (level >= console_loglevel && !ignore_loglevel); > + return max(console_loglevel, con ? con->level : LOGLEVEL_EMERG); > +} > + > +static bool suppress_message_printing(int level, struct console *con) > +{ > + return (level >= effective_loglevel(con) && !ignore_loglevel); > } > > #ifdef CONFIG_BOOT_PRINTK_DELAY > @@ -1175,7 +1180,7 @@ static void boot_delay_msec(int level) > unsigned long timeout; > > if ((boot_delay == 0 || system_state >= SYSTEM_RUNNING) > - || suppress_message_printing(level)) { > + || suppress_message_printing(level, NULL)) { > return; > } > > @@ -1549,7 +1554,7 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) > * The console_lock must be held. > */ > static void call_console_drivers(const char *ext_text, size_t ext_len, > - const char *text, size_t len) > + const char *text, size_t len, int level) > { > struct console *con; > > @@ -1568,6 +1573,8 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, > if (!cpu_online(smp_processor_id()) && > !(con->flags & CON_ANYTIME)) > continue; > + if (suppress_message_printing(level, con)) > + continue; > if (con->flags & CON_EXTENDED) > con->write(con, ext_text, ext_len); > else > @@ -1856,10 +1863,9 @@ static ssize_t msg_print_ext_body(char *buf, size_t size, > char *dict, size_t dict_len, > char *text, size_t text_len) { return 0; } > static void call_console_drivers(const char *ext_text, size_t ext_len, > - const char *text, size_t len) {} > + const char *text, size_t len, int level) {} > static size_t msg_print_text(const struct printk_log *msg, > bool syslog, char *buf, size_t size) { return 0; } > -static bool suppress_message_printing(int level) { return false; } > > #endif /* CONFIG_PRINTK */ > > @@ -2199,22 +2205,11 @@ void console_unlock(void) > } else { > len = 0; > } > -skip: > + > if (console_seq == log_next_seq) > break; > > msg = log_from_idx(console_idx); > - if (suppress_message_printing(msg->level)) { > - /* > - * Skip record we have buffered and already printed > - * directly to the console when we received it, and > - * record that has level above the console loglevel. > - */ > - console_idx = log_next(console_idx); > - console_seq++; > - goto skip; > - } > - > len += msg_print_text(msg, false, text + len, sizeof(text) - len); > if (nr_ext_console_drivers) { > ext_len = msg_print_ext_header(ext_text, > @@ -2230,7 +2225,7 @@ void console_unlock(void) > raw_spin_unlock(&logbuf_lock); > > stop_critical_timings(); /* don't trace print latency */ > - call_console_drivers(ext_text, ext_len, text, len); > + call_console_drivers(ext_text, ext_len, text, len, msg->level); > start_critical_timings(); > printk_safe_exit_irqrestore(flags); > > @@ -2497,6 +2492,11 @@ void register_console(struct console *newcon) > newcon->flags &= ~CON_PRINTBUFFER; > > /* > + * By default, the per-console minimum forces no messages through. > + */ > + newcon->level = LOGLEVEL_EMERG; > + > + /* > * Put this console in the list - keep the > * preferred driver at the head of the list. > */ > From 1579832872468894514@xxx Fri Sep 29 00:47:14 +0000 2017 X-GM-THRID: 1579832872468894514 X-Gmail-Labels: Inbox,Category Forums