Received: by 10.223.176.46 with SMTP id f43csp4298299wra; Tue, 23 Jan 2018 07:22:34 -0800 (PST) X-Google-Smtp-Source: AH8x225Rv+KPJvOd+8Cq9aDPkQKR/oSaR5/nMjjJhKjXf1rOx0BNZlGNTyNms+x9rz+8ywYAsq3n X-Received: by 10.107.170.148 with SMTP id g20mr3984438ioj.206.1516720953947; Tue, 23 Jan 2018 07:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516720953; cv=none; d=google.com; s=arc-20160816; b=wI7TNjIIyizMO6J/GkJTP1NYluF7MAX1WiR/df94/KgeTDLp0hdwqGqGRUlsktiG2p V6ayBpO364Z9rBwGYXAZPFlgII2Zp8gp6P1pPmsmox6AjTcHJXihjsLhyXS3oJxos5Iq zRyClpMmfryKZLEjU/k3M9o780IboOJqvz4ax8r/GAb8c80hPPKCEJTyMTF4DQd527hl BsaeMrteXZK2tVU7UovATYzAoBHCNZdBpy8yTEsj+uula/6Ak7u5VZ5lVZkingyiDb5B 8x3KFn6cuV7a3Lq6QvB3kprgE87qmKAeWRIy1UBWp0wujuPiKkTkUFLbZqCxQjBWmphw /aOA== 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:arc-authentication-results; bh=J6+yDiJHNOHItuI36Wpj65MJG4US6d2OSQ1sUAALyJM=; b=fK+jxzbdB2rzq7x7bdLditMxxUBO2QaGlkEAOaGDTHRPctB4PSKJ+n+F+C6v6f9IyZ ygxO96JuJQ7C7jNxlKpM+blH/EHA0QTO3UetvzCx7Bk8ubvH4DwQ8Q63P09R3H9GAfIh XbDeeRHR/v2vPENsDoFP/hhDvmBw53EWg7R6GJ8nqm5I6YuJeZ/9w2je0yBF6ypDgvc1 CzPfZ/6SQy+SUUbUC9PJCGrnZze1OC084dv48wKY2NLIvbV6EGgs5c5e7hVQAfKSvo+C eBUcp/QlGlT9svDOQ7bMzPwDDPvpgXNRhsjgQeyUwVGuJgsGvgwHo6yyvQnIB9CFQvc5 D2DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B/300KFy; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e25si15990455ioj.278.2018.01.23.07.22.20; Tue, 23 Jan 2018 07:22:33 -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=B/300KFy; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751402AbeAWPVi (ORCPT + 99 others); Tue, 23 Jan 2018 10:21:38 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:38285 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751209AbeAWPVf (ORCPT ); Tue, 23 Jan 2018 10:21:35 -0500 Received: by mail-pg0-f65.google.com with SMTP id y27so494631pgc.5 for ; Tue, 23 Jan 2018 07:21:35 -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=J6+yDiJHNOHItuI36Wpj65MJG4US6d2OSQ1sUAALyJM=; b=B/300KFyyFlPpWjm+KXOH+1zXtTnTUEPDMVXurH0Wwe0OMInNMve4C7XggZwmGbPkn fzr+suhvwT6fIaWF5zYGeVt+ZsqJlzyR1RxMsfE59Kcs2Jt8liV4OyzRigWcuzLIsF1o Mx9ay6NTZGA5F/MNWsG6fUrTt7b1muP905NQYZBkIK8Ho4/ifEWAzt5Fhnw88BUsEDIg SSx6eZ8qnlWGlxVfRch6Ld1AZETec8bdGGxnCp8se42ulIvRZ4QG80+nsfGx2RhNTmT4 VVMQIhciJA2Vr5RZ5uJ6VXuB3DGcWdyp0G1b+pq0VinmcSq6gDXJzVDLbKLiPo6JKJKL RXDQ== 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=J6+yDiJHNOHItuI36Wpj65MJG4US6d2OSQ1sUAALyJM=; b=sbWtrHQPQOf3p9v7XovNEGQ8vzG+G4IKxKrLUvuZkivvL65lfUZ6VFisuGV78gPiBH 23M+pD4KKxcoF+7bG7VKcg0naYxae4u41wgBeRj6K/AAhsaFAp8IaOKvC2X638gnsaYl WEmTxNLwA/3zTm5pK1abypMPudSkqQYjKxbHiGABxLtcu3xzUwwgFaGgsIPiy6QdoG4g 4SR04ScPbmfousqySvCPB0Be/inPPknKyBAa+I9f8PycvrQmhCMhBpk/mJkW0217gdpB QAivh+XjLr3l76ruhtS228W/wrapgeajImJM9PWtEY8TlsgBWQtNhYbz0ziGLI6o1zua 8b0A== X-Gm-Message-State: AKwxytehzqH/S82zeBo12Jf8gmYNmDWxiw7d7ZbHdy0LWKRgh4T4n9kQ 57HXHS5WzTAgrkyrH6cH/Ag= X-Received: by 2002:a17:902:8691:: with SMTP id g17-v6mr5991924plo.446.1516720894587; Tue, 23 Jan 2018 07:21:34 -0800 (PST) Received: from localhost ([121.137.63.184]) by smtp.gmail.com with ESMTPSA id m9sm5682459pff.59.2018.01.23.07.21.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2018 07:21:33 -0800 (PST) Date: Wed, 24 Jan 2018 00:21:30 +0900 From: Sergey Senozhatsky To: Steven Rostedt Cc: Sergey Senozhatsky , Petr Mladek , Tejun Heo , akpm@linux-foundation.org, linux-mm@kvack.org, Cong Wang , Dave Hansen , Johannes Weiner , Mel Gorman , Michal Hocko , Vlastimil Babka , Peter Zijlstra , Linus Torvalds , Jan Kara , Mathieu Desnoyers , Tetsuo Handa , rostedt@home.goodmis.org, Byungchul Park , Pavel Machek , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup Message-ID: <20180123152130.GB429@tigerII.localdomain> References: <20180117091208.ezvuhumnsarz5thh@pathway.suse.cz> <20180117151509.GT3460072@devbig577.frc2.facebook.com> <20180117121251.7283a56e@gandalf.local.home> <20180117134201.0a9cbbbf@gandalf.local.home> <20180119132052.02b89626@gandalf.local.home> <20180120071402.GB8371@jagdpanzerIV> <20180120104931.1942483e@gandalf.local.home> <20180121141521.GA429@tigerII.localdomain> <20180123064023.GA492@jagdpanzerIV> <20180123095652.5e14da85@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180123095652.5e14da85@gandalf.local.home> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (01/23/18 09:56), Steven Rostedt wrote: [..] > > Why do we even use irq_work for printk_safe? > > Why not? > > Really, I think you are trying to solve a symptom and not the problem. > If we are having issues with irq_work, we are going to have issues with > a work queue. It's just spreading out the problem instead of fixing it. I don't want to have heuristics in print_safe, I don't want to have a magic number controlled by a user-space visible knob, I don't want to have the first 3 lines of a lockdep splat. The problem is - we flush printk_safe too soon and printing CPU ends up in a lockup - it log_store()-s new messages while it's printing the pending ones. It's fine to do so when CPU is in preemptible context. Really, we should not care in printk_safe as long as we don't lockup the kernel. The misbehaving console must be fixed. If CPU is not in preemptible context then we do lockup the kernel. Because we flush printk_safe regardless of the current CPU context. If we will flush printk_safe via WQ then we automatically add this "OK! The CPU is preemptible, we can log_store(), it's totally OK, we will not lockup it up." thing. Yes, we fill up the logbuf with probably needed and appreciated or unneeded messages. But we should not care in printk_safe. We don't lockup the kernel... And the misbehaving console must be fixed. I disagree with "If we are having issues with irq_work, we are going to have issues with a work queue". There is a tremendous difference between irq_work on that CPU and queue_work_on(smp_proessor_id()). One does not care about CPU context, the other one does. -ss