Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4615690ybf; Wed, 4 Mar 2020 07:22:37 -0800 (PST) X-Google-Smtp-Source: ADFU+vtUpodsDDaEvYPTVaUMd3xFUuMTtD0u9tZ9OzPOLWmiWBXE0ve7kr9fC4cgAiDwmZGhfm0U X-Received: by 2002:a05:6830:1e07:: with SMTP id s7mr2802880otr.85.1583335357384; Wed, 04 Mar 2020 07:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583335357; cv=none; d=google.com; s=arc-20160816; b=TWoF8Q5UTDd+klcmqcZAXWh3cMeViMQaZ+Ulk9JggKkY5rqpVB0pDrNdHO9coRtERN QpTeWxIZ9LY4YCxnjayU13LBSD9U00RgATXQWTxZHiWUxkPVe7ae7FOoIDM2YTOK8Sw+ CmrumHXBF7Ea2YwVd5ezFJl2GNVc8o31bwBtjWNsqg9/gQkigXyqiZcMOgBHoeyFshgq RB55JlpzNL4Rg5Fghr5wNXD4p3h3K2L88My/mA0s1pY6pgB8eFJSmJDRgjLYYiTerheg X0+7qPEL2yXnfjMESZOnpfDTAi1rxa9/ZpLNflunl76o92B0FQ/UmMTUmO8iIUoq4ZYL DrNw== 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; bh=YwsNqOC+FwraK/TbW13BtlAyJYM411zsbsbYDryqduA=; b=fW9bfb6SyPpWRn1WFbQIIMEUUPVIqifIv6XN4yarLhh2iKl4gC7eh0lH9p0WBZDzev gEbar4p/o0chu89zBx89rp1fqCO9ftfvSO9lQbQb249DSLLz8rkS75XCFzcoN6N9CxsH ZwMBOWlzTO1EwD19SiWMop6krAiStLERxJBgRyNv+XJBSBGesyapr5FicKZ6WtpS+ivL Um4xppW5r66j4i59YEkr5oA2qp53jA3JzVy3smZLdAnulOni3JQRyRxS/7IsjdXquitL XBguq079V/Oy6HyYoV5OddvlvgOw9nxTcEoWJxM1ogFKRWGXzqtwFfBZHlbTOZtLq6sH G2tg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h7si1211855otm.165.2020.03.04.07.22.24; Wed, 04 Mar 2020 07:22:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729398AbgCDPWC (ORCPT + 99 others); Wed, 4 Mar 2020 10:22:02 -0500 Received: from mx2.suse.de ([195.135.220.15]:57458 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbgCDPWC (ORCPT ); Wed, 4 Mar 2020 10:22:02 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 73D74AC62; Wed, 4 Mar 2020 15:22:00 +0000 (UTC) Date: Wed, 4 Mar 2020 16:21:59 +0100 From: Petr Mladek To: Sergey Senozhatsky Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Lech Perczak , Greg Kroah-Hartman , Theodore Ts'o , John Ogness Subject: Re: [PATCHv2] printk: queue wake_up_klogd irq_work only if per-CPU areas are ready Message-ID: <20200304152159.2p7d7dnztf433i24@pathway.suse.cz> References: <20200303113002.63089-1-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200303113002.63089-1-sergey.senozhatsky@gmail.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2020-03-03 20:30:02, Sergey Senozhatsky wrote: > However, only printk_safe/printk_nmi do make sure that > per-CPU areas have been initialised and that it's safe > to modify per-CPU irq_work. This means that, for instance, > should printk_deferred() be invoked "too early", that > is before per-CPU areas are initialised, printk_deferred() > will perform illegal per-CPU access. > > Lech Perczak [0] reports that after commit 1b710b1b10ef > ("char/random: silence a lockdep splat with printk()") > user-space syslog/kmsg readers are not able to read new > kernel messages. The reason is printk_deferred() being > called too early (as was pointed out by Petr and John). > > Fix printk_deferred() and do not queue per-CPU irq_work > before per-CPU areas are initialized. > > [0] https://lore.kernel.org/lkml/aa0732c6-5c4e-8a8b-a1c1-75ebe3dca05b@camlintechnologies.com/ > > Signed-off-by: Sergey Senozhatsky > Reported-by: Lech Perczak > Cc: Greg Kroah-Hartman > Cc: Theodore Ts'o > Cc: John Ogness Reviewed-by: Petr Mladek Now, the question is whether to hurry this fix into 5.6 or if it could wait for 5.7. I think that it could wait because 5.6 is not affected by the particular printk_deferred(). This patch fixes a long-term generic problem. But I am open for other opinions. Best Regards, Petr