Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5549581imb; Thu, 7 Mar 2019 19:11:39 -0800 (PST) X-Google-Smtp-Source: APXvYqw+x6aRMkTUBM37O4ixe76eddYa5tDE/Op7ao90enOm68nQIh5nT0BBNZeUNBqe7Lbm9iQw X-Received: by 2002:a17:902:846:: with SMTP id 64mr16202382plk.266.1552014699384; Thu, 07 Mar 2019 19:11:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552014699; cv=none; d=google.com; s=arc-20160816; b=m58FQRfr5bngVzjGYe+ug+2YQD+8oD0kwQ1dLWZfg5l98S9nwfyadQf/l+mhUDNBz4 aLQXiD5y9eYHAgmXy1Ik41cEkTyrT0pbedcWNdl69wbkZYO+cKSXChtDBcpTi0+xoPVh mzULH2UkW+20LDN9s59XbYycjzSYAg4NakZBEgW+gO/U0Nd9k0Zkg4HPx9WdZpEHOIyc RR3i+3Zh0VgVD5KbboN2eMUf4GlqUzin6Slv7c0TJZNDHwSTBymTQfw6hKHCxXNr6N/z WlRDo4M98yaHO9BmniV7u28NWrZFfR0CNni7cB8KeWLBtfkuqcLbyUxXvh3NGKwOLu9e z0mg== 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=r58CcJqGlkjX5t1gE9hwdGtnjPHn3TSgMqKl38HW6RI=; b=ZYB0wDdf9kXJWc3j+miOCTFT7Gh84TugY8N7x3IZLmw6Q43Iwvh7BIZ+eRd6slYSEI OxwXBk4LJ0Ocgn/YQnyZrrQumxdhAzzHOk3VcG6Dx0pgiGIt3Udzb79Y2vw3xP7wahUW 3zbJaY0UUEAq5+6yVPeQpUnk8ppI/64G8f6bcWHYYrwbFLizjAqqTf/q051h48iCFg8J ItwE7RzudCHoQ7AP+LfAw/zyYDymXcWNlzNFhxfqW1sYMv++iX5/EnVzyWPPejC/P3Xz ODONcY9Agj/bpVZDo8R+58cf5DIy6uArIvNMJmrYlNAzz+HxfFBdStquPW17bnawayXd Vx7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fZUOyuxg; 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 24si1259497pgl.359.2019.03.07.19.11.23; Thu, 07 Mar 2019 19:11:39 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fZUOyuxg; 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 S1726687AbfCHDKj (ORCPT + 99 others); Thu, 7 Mar 2019 22:10:39 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43263 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbfCHDKi (ORCPT ); Thu, 7 Mar 2019 22:10:38 -0500 Received: by mail-pg1-f196.google.com with SMTP id l11so12920664pgq.10; Thu, 07 Mar 2019 19:10:37 -0800 (PST) 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=r58CcJqGlkjX5t1gE9hwdGtnjPHn3TSgMqKl38HW6RI=; b=fZUOyuxgQiPB/aeLl+LEWYMUFvN05GRR9vzfvwH9V4taDcBhsdAwz+ufziywiyEiWy xdG5Awd/8GzmLikLwj7oqmgoo528PMIjXDD2oYw6O1z8NKGso96AJ5KyzjvlBVYgUpft eXNbnevVKsk2KMmNMfd9B79Wlsfvvqzi5KJawqTKPq08YHhId2bsUpeIlBVyOzelmVYy ScUtp4Sod2MB9+GZmrus746c4/BoPLEjGU5RUDYw8MEtnTBF8TVjvcJUpUETQrwM8D+4 UtqXyEuKR7s+8Q5vswR+hdZyZHTpF8ten+zKvUYDoDMjH6w3JBgYJ3QFJGBT5jcT16/V 5FeA== 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=r58CcJqGlkjX5t1gE9hwdGtnjPHn3TSgMqKl38HW6RI=; b=f1wT05GDd3FiUe2V8Sf+Wjnw4k1z9Ov2eGhqWtKeeAPJgoJ/Qi/p1rHTG/RiasKJH4 qfb6e+SWp3lTEyjiggDxXwZAc+d4Zbae4JboMBcDLRS9QtgMoTgIO3h4LYRyWYOXONpq ykX2Rm0VHfVfh0OTzlDsOmvCfe8/4XtzQRfcqXOWyqX3nsy1y+DHyfBGB2rt6LwNXSAo 9rBMnqIv8q8PRVTkrIwmne8UAasol1hKymk2HohGgVaf+ZE8KMY4ffs2MmZfrSgNAf7Z KQLCqXY24IFgR9cB5z5MJYTrB8p2nEDDnpmvizY0AoRUwkcypidSaITu2GXMmOtibayj zL6A== X-Gm-Message-State: APjAAAX8KzqHbWJdexl5URTyAiaUzJhybIKH3EtcZnHyCjPyUxw4DcHN yLUydzQVdN2CVqGonz3PbQM= X-Received: by 2002:a62:449b:: with SMTP id m27mr16395336pfi.79.1552014637227; Thu, 07 Mar 2019 19:10:37 -0800 (PST) Received: from localhost ([175.223.36.163]) by smtp.gmail.com with ESMTPSA id p5sm8456223pfn.154.2019.03.07.19.10.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 19:10:36 -0800 (PST) Date: Fri, 8 Mar 2019 12:10:32 +0900 From: Sergey Senozhatsky To: Calvin Owens Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Greg Kroah-Hartman , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH 1/4] printk: Introduce per-console loglevel setting Message-ID: <20190308031032.GA30056@jagdpanzerIV> References: <06cd267ef5439a9391368423b608959f5f1b1a63.1551486732.git.calvinowens@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06cd267ef5439a9391368423b608959f5f1b1a63.1551486732.git.calvinowens@fb.com> 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/01/19 16:48), Calvin Owens wrote: [..] > 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; > - } > > /* Output to all consoles once old messages replayed. */ > if (unlikely(exclusive_console && > @@ -2405,7 +2402,7 @@ void console_unlock(void) > console_lock_spinning_enable(); > > 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(); So it seems that now we always format the text and ext message (if needed) and only then check if there is at least one console we can print that message on. Can we iterate the consoles first and check if msg is worth the effort (per console suppress_message_printing()) and only if it is do all the formatting and call console drivers? -ss