Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp242879ybl; Wed, 11 Dec 2019 17:25:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyo2YzHPjpbJbndIwyp9RCsMngjVb4wswGF/hOFSURx2esuJZ0GO2FBpfvrcrW+zTRaaEWb X-Received: by 2002:a9d:eea:: with SMTP id 97mr4806953otj.177.1576113924880; Wed, 11 Dec 2019 17:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576113924; cv=none; d=google.com; s=arc-20160816; b=y1AkIP8r1/2Rrle0YfPNFocFwwDnzbMMy1gO3mL7wKrLVx3EdObGUXNSOzI4Pq1tWU p0mzyEhfGx/xmRtvuILpwlly8zoq5P7yuM1KTZq6M2aM/mww+5nU56H3uA+HAtS+Cw5S ZLgjTfnd5rL4MAoJAWsVFcud5b/Bu5uu367psQaJqvNk/vw7fUTFbuZKX36/ilUXQOR2 UpDKUJgJxGKemWMc2gxEuBN1YoK0FFY28lDoG1OsdxaALzzIzJU2ZJaUJs0KydaGutrg tCv3Ds88266xZxiLp0fWaKzPP0vDKtU2RBocxiF6oDfu6SVFaiWynJikcQxGtH34dv+r UYvA== 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=3JnTxmN8bRkEHsxonCr7JuulpHDsIp/mbioLEIpCtLo=; b=O/W8ehb/0B8sGUDEzbO6RhNczTIm3JWeJ5zK73WHSxBAUH7WuNCKB9OqzWVWDksQWg yLimr1B5CUuqlFHr8SoOk4bglvNZFzJlwKdH8uq29Or50Q6s5l4kji/MGlqwK2KyKrNN NhsIiNiEwV1HxLcy964zek6nepgMQszZ9M6LKs1TLHPJwbq/jCBd0jpYj0STsTouIjfn cznRqzaKlcl6IE+qw3NfuOQm15RYRwK52g2p6/A0HzZPcqVdWrzcsNvQG5ePeGijWVb4 xvj2bbxrxfSz/2ihCdZxUcxLxZ/gBex9ocCMS95UrDc0wsDHde8J9fl9ddAw+KkuJ+6F TKHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OzWGsDSW; 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 i205si2273837oih.257.2019.12.11.17.25.12; Wed, 11 Dec 2019 17:25:24 -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=OzWGsDSW; 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 S1727434AbfLLBXX (ORCPT + 99 others); Wed, 11 Dec 2019 20:23:23 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:46013 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727224AbfLLBXX (ORCPT ); Wed, 11 Dec 2019 20:23:23 -0500 Received: by mail-pj1-f65.google.com with SMTP id r11so288962pjp.12 for ; Wed, 11 Dec 2019 17:23:22 -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=3JnTxmN8bRkEHsxonCr7JuulpHDsIp/mbioLEIpCtLo=; b=OzWGsDSWOHh4LCnZfVnogP8qxHuXMKTE6ClCai9ULySKFzMaz+rwU4bDRtYNOvfAdf Mg+rzFD+6nSC95jAVllMVgm81bdHnTuLce6EY2TFQy4G0UmWR7tQCp8cJfGgY1IGBG8X H6eiFCG4vC3F7V3Z9OwOj61KTZsZYBkXecHc6F+gF83Gc4w652OWla91sQQTKQdnxoFo BHnjrnGYAaWi8McCfpa6z9lWINyu55vwcLVlqFJhcKgU7ys/k3TN8VZgZX2hOZhzlwWs vP2vhCOgBShw/SdlFqKfNm8F9QMr98/yP8KdYXXuVktbI3vY1jHD711lM8qBjYmmSL0U 4Pjw== 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=3JnTxmN8bRkEHsxonCr7JuulpHDsIp/mbioLEIpCtLo=; b=EtuLD7iW+WFs/94wfV/+RP8FZ7P8LwP0Z3TSEr9CTgYgpSekAklFzzd46T4O4X9a0H 9ILFis+VDlbykrHkXBT+S0TPvJjsreFGZomYWgoDrazi7t8omFz5Yu+F0Ii+QdhjyVo4 siu9Wj8wyEYg1umY0aolr6IRQcJxWA99Ry8husVgvxvoTiFXmUwfmkNhbF2ETvNqiZ7c B9KhO0WbUWvGmdFYdZO211SbiV6PXhu8OKmuUBc5kr8eN52AXEFSVc/Rt3swfuupr+jW X9fAf9Fo6e0njmMWHc9UQcvWTghRyk0340cD63GLfbxK4NxBsEzhXXavyIyJbOmnjxXY yrkw== X-Gm-Message-State: APjAAAWMwKp32x9/GsB/y0Pzi0UJTzHHC9WzPF19t0xX3z/n2goLR7OQ vyqEL03m+JYvGCeLHvoA7l8= X-Received: by 2002:a17:902:aa8f:: with SMTP id d15mr6884521plr.80.1576113802399; Wed, 11 Dec 2019 17:23:22 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:250d:e71d:5a0a:9afe]) by smtp.gmail.com with ESMTPSA id q9sm4305225pgc.5.2019.12.11.17.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 17:23:21 -0800 (PST) Date: Thu, 12 Dec 2019 10:23:19 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , AlekseyMakarov Subject: Re: [RFC/PATCH] printk: Fix preferred console selection with multiple matches Message-ID: <20191212012319.GP88619@google.com> References: <20191210091502.qoq55fdjad6aixab@pathway.suse.cz> <50d2c44a15960760c6a9d24442a93fa4b31b7594.camel@kernel.crashing.org> <20191211091740.p6bgjy7sy75maenw@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191211091740.p6bgjy7sy75maenw@pathway.suse.cz> 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 (19/12/11 10:17), Petr Mladek wrote: > And this would exactly happen as pointed out by Sergey. match() does > also some setup operations. I would be scared to call them twice. > > > This looks indeed a lot more invasive. Is there any reason why what I > > propose wouldn't work as a first patch that can easily be backported ? > > Your solution is not acceptable because it might cause calling > match() more times. > > The reverse search of list of console does not work for ttySX > consoles because the number is omitted when matching. And the messages > will appear only on the first matched serial console. There is > a paragraph about this in the commit message of my patch. A fast path for preferred_console match()/setup() sounds like something that may work. There won't be double setup()-s and we scan console list in the same direction. We just have separate match()/setup() for preferred_console. Do you think this won't do the trick? -ss