Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp974904ybf; Sat, 29 Feb 2020 21:23:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwgNs7djbTzLFQ5AGdM/48iTzYpQUifRfuZsPzDuRkq9VVQ+BJWnxSzP4urmZHF+sGdLLA5 X-Received: by 2002:a9d:5885:: with SMTP id x5mr8705027otg.132.1583040207687; Sat, 29 Feb 2020 21:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583040207; cv=none; d=google.com; s=arc-20160816; b=jV6VNL00Jf3EyCiQ5MJ9q+Av7mSMcbZpnOjV3zLFFCYQm2o+N+hGBLmSwTD6m7z0OS BokudCmuX5B6TfJagnNypf8PDTdpDKKRCtNT0tpdBn4w9VFw+8MpqGILXfaq8jwRuqE9 vKmzKgAhzc6RA9URHPIOa9hKnkgkj1SzbLmwjWacRameemb3P6ini+BJB58bDgS2uGOe zqlzjdT3szdmJi1xwDpP8+vVxV5D2MQ5qt5HzOulta2aqFFnoVqElnAag9JMYHE3pvGD 5fFwZ+Oj2tSvviWr4VbmEha8217+LuyNLXt5F616YpLKLGYebaYWaTMiezEOE0eQ6nov 7kNw== 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=HK1vzU5vvIBaejockOry64ZPx0jB3s54YWpqriTgeSE=; b=OVsmkKOnNclh3TsE3I23EDmFr9zgcRiciNchfn32T7LA1fVBV/iV1a97W8Ym90uNIP 6rdDids/WLzQ0pGnWYpH9fgf0yo4RsVgDf5qvUzym5+Cv+bAuCfguevcaC/Fp3xKV3F7 soiDvPLj5ZbV8ohhSx64Mlx2i9zaVu5zgp1aYxkUSvg1zdtobYLlpL/SeKKkVqfPSXPJ 6NB9I/jZIcBj/NS/50YZ0ByrqdRLkrh+2QY+999W6gQP8QWYsY/OO/pJok16OdwetGOe 05xyMO5WIeJM+DbqYw4yNAJlJ8SX4dBHyJdr5dhmiSAaLQT8D4dI9NbnydeJGtlTgyKc e77A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VjyyG9at; 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 f9si4658300oti.44.2020.02.29.21.23.15; Sat, 29 Feb 2020 21:23:27 -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=VjyyG9at; 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 S1727054AbgCAFWY (ORCPT + 99 others); Sun, 1 Mar 2020 00:22:24 -0500 Received: from mail-pg1-f182.google.com ([209.85.215.182]:38088 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgCAFWX (ORCPT ); Sun, 1 Mar 2020 00:22:23 -0500 Received: by mail-pg1-f182.google.com with SMTP id d6so3701532pgn.5 for ; Sat, 29 Feb 2020 21:22: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=HK1vzU5vvIBaejockOry64ZPx0jB3s54YWpqriTgeSE=; b=VjyyG9atwGjNmLS++K4PgL21FUipe7nIE+Gl0i6iS6+hGSEWE2lEgYrvqHwyYJle3L NrZqObcg0fwZNKU8jXflYpoYtGwF8+KgCtiLerVelANE8wQHIbcXTDtKkeTiQgQxrY/M Hgp4MzurYm5pOiNFKMkIxZondwUenKH+yW0o+6AmY5rERsM7icX3PuZ+fHc/hKW+KybR Xc37Ia0UgcSru24c9Ddp38Pxb4Jx1E6AId0X77dv+lLz9Zw7DOpgCBskvoOu3ocTInOD BcR4XSc8ILI9shcNT4VI94hzP8u8xHjOlm69NnpbZSUlh/2HghylAvsv6n03Xul72dRU tMaQ== 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=HK1vzU5vvIBaejockOry64ZPx0jB3s54YWpqriTgeSE=; b=KeMY+Zl9xq5otN0Q/6ROqRVDgCaFRefC59XLrA6nRfRjbF51sq+yNtePYf8mKx8w1O Kek395RU53mggx+nYzScEezzLSKPRuPxOGP+qp9+UtItpmoi4NLb7Lrp702XhP0rqpoD DrHF5FaKVPWdaXvuJEg4d/33KCik22wXcgtcJ41r6PH7JYe5DVXH/WGAYP7Znu89nKvu U2M89XlUJg9nEjUf4Kr1767wMHsDteW8RnKyjZNW00bJd7iej59P2rOmRiLcuoqwDV2x EcFl+6jYFSAvBmjD8ACUPOTI7QgSUvJb6oaTnURfMXm9AFxgRMKqhyFajIT779olXs5T gkeQ== X-Gm-Message-State: APjAAAWoASThEWe6qPcUE4Y89+r6q5s33TOR1ndB5wS8xU/EVk8sK8iC RVliiXswGVW9EmeAmh68aiy8WpKk X-Received: by 2002:a63:5b1e:: with SMTP id p30mr12451616pgb.71.1583040142240; Sat, 29 Feb 2020 21:22:22 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id 5sm3680873pfw.179.2020.02.29.21.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Feb 2020 21:22:21 -0800 (PST) Date: Sun, 1 Mar 2020 14:22:19 +0900 From: Sergey Senozhatsky To: Steven Rostedt Cc: Sergey Senozhatsky , "Theodore Y. Ts'o" , Petr Mladek , Greg Kroah-Hartman , Lech Perczak , "linux-kernel@vger.kernel.org" , Arnd Bergmann , Krzysztof =?utf-8?Q?Drobi=C5=84ski?= , Pawel Lenkow , John Ogness , Tejun Heo , Peter Zijlstra Subject: Re: Regression in v4.19.106 breaking waking up of readers of /proc/kmsg and /dev/kmsg Message-ID: <20200301052219.GA83612@google.com> References: <42d3ce5c-5ffe-8e17-32a3-5127a6c7c7d8@camlintechnologies.com> <20200228031306.GO122464@google.com> <20200228100416.6bwathdtopwat5wy@pathway.suse.cz> <20200228105836.GA2913504@kroah.com> <20200228113214.kew4xi5tkbo7bpou@pathway.suse.cz> <20200228130217.rj6qge2en26bdp7b@pathway.suse.cz> <20200228205334.GF101220@mit.edu> <20200229033253.GA212847@google.com> <20200229184719.714dee74@oasis.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200229184719.714dee74@oasis.local.home> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/02/29 18:47), Steven Rostedt wrote: [..] > > > What do folks think? > > > > Well, my 5 cents, there is nothing that prevents "too-early" > > printk_deferred() calls in the future. From that POV I'd probably > > prefer to "forbid" printk_deffered() to touch per-CPU deferred > > machinery until it's not "too early" anymore. Similar to what we > > do in printk_safe::queue_flush_work(). > > I agree that printk_deferred() should handle being called too early. > But the issue is with per_cpu variables correct? Not the irq_work? Correct. printk_deferred() and printk_safe()/printk_nmi() irq_works are per-CPU. We use "a special" flag in printk_safe()/printk_nmi() to tell if it's too early to modify per-CPU irq_work or not. I believe that we need to use that flag for all printk-safe/nmi per-CPU data, including buffers, not only for irq_work. Just in case if printk_safe or printk_nmi, somehow, are being called too early. > We could add a flag in init/main.c after setup_per_cpu_areas() and then > just have printk_deferred() act like a normal printk(). At that point, > there shouldn't be an issue in calling printk() directly, is there? Sure, this will work. I believe we introduced a "work around" approach in printk-safe because noone would ACK a global init/main.c flag for printk(). If we can land a "per_cpu_areas_ready" flag (I've some doubts here), then yes (!), let's use it and let's remove printk-safe workaround. -ss