Received: by 10.223.176.46 with SMTP id f43csp4357117wra; Tue, 23 Jan 2018 08:14:41 -0800 (PST) X-Google-Smtp-Source: AH8x224UDmmkQF6oE3guFLAFA3HvhxJsy4ev9A+jK562kl3rv+3g2Qk3+lU/f+jpV0P6K/+6agIc X-Received: by 10.36.26.137 with SMTP id 131mr4192914iti.25.1516724081769; Tue, 23 Jan 2018 08:14:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516724081; cv=none; d=google.com; s=arc-20160816; b=mhjw97C3moCIKz9qKy3RBYwDvtrfitwKHvze7kWYTQ5vEXARiu0DNYzBFMhPoXJGT9 KhcLYMy+qFOBXCUkro3rU8IeAWPBXyBpqKCJ9c3u9ife3a5oQuwbIRSOU5F6TAtp45A7 0tzQC3mAsgFNCTzLaWgy5EXZFX5a/2kCyWWHtrN0/PkjCno0lPs21rDNBXRz8rAQd+XQ Ch6x0d0E0Hf8WSdLDL+SibTaw5kVZq7reN44VUiMY7jTGr7X+8nuh/8231AxzTHNCDmX xwdW+TYT2SS8bBCr4nPx8rrU9GcIGV6aTcL0FMew30Jm9OqN80CW5+oAwzR3Cvg/AWDg uRwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=jROxfNkulDJteRQrECenJ2ETIuVSJYFR8/LIPrloGgQ=; b=LIHlWxPWj88u0aE+anbGjg5e+55GuHa8kgEfRR5sP1LLzK3s3ko6nNY//aGNRFYxZi WaZQDyKr9UwM6u/jFHYiIcX3HWE5Hd9HxrRtDeMJTtc0EadEDaTRGZYIgvBDu81xLJ1/ jDWl5wEkVj2HqEqp/iRTdiPfOfRYoX4B5cf2h4BYnf0AKpSIOxxGJWoTAvx/3iTozdzb nf3RauqejAMaKwhJ9r4yRTBN3vSlbwNG8b765cpuSEdpXD3/IaFZP0RvhM+KOCzVOgLy CSqSISlPHwGg6EhQMiIai6r4pso7KVYfzKC0HeRmECuDS9S/L4kgyIY6EfGVR8G7sSuh odOA== 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 d16si8759067iob.10.2018.01.23.08.14.28; Tue, 23 Jan 2018 08:14:41 -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 S1751940AbeAWQNh convert rfc822-to-8bit (ORCPT + 99 others); Tue, 23 Jan 2018 11:13:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:51064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbeAWQNf (ORCPT ); Tue, 23 Jan 2018 11:13:35 -0500 Received: from gandalf.local.home (cpe-172-100-180-131.stny.res.rr.com [172.100.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 83D952178B; Tue, 23 Jan 2018 16:13:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83D952178B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 23 Jan 2018 11:13:30 -0500 From: Steven Rostedt To: Tejun Heo Cc: Sergey Senozhatsky , Sergey Senozhatsky , Petr Mladek , 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 Subject: Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup Message-ID: <20180123111330.4356ec8d@gandalf.local.home> In-Reply-To: <20180123154347.GE1771050@devbig577.frc2.facebook.com> References: <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> <20180123152130.GB429@tigerII.localdomain> <20180123104121.2ef96d81@gandalf.local.home> <20180123154347.GE1771050@devbig577.frc2.facebook.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Jan 2018 07:43:47 -0800 Tejun Heo wrote: > So, at least in the case that we were seeing, it isn't that black and > white. printk keeps causing printks but only because printk buffer > flushing is preventing the printk'ing context from making forward > progress. The key problem there is that a flushing context may get > pinned flushing indefinitely and using a separate context does solve > the problem. > Does it? From what I understand is that there's an issue with one of the printk consoles, due to memory pressure or whatnot. Then a printk happens within a printk recursively. It gets put into the safe buffer and an irq is sent to printk this printk. The issue you are saying is that when the printk enables interrupts, the irq work triggers and loads the log buffer with the safe buffer, and then the printk sees the new data added and continues to print, and hence never leaves this printk. Your solution is to delay the flushing of the safe buffer to another thread (work queue), which I also have issues with, because you break the "get printks out ASAP mantra". Then the work queue comes in and flushes the printks. And since the printks cause printks, we continue to spam the machine, but hey, we are making forward progress. Again, this is treating the symptom and not solving the problem. I really hate delaying printks to another thread, unless we can guarantee that that thread is ready to go immediately (basically spinning on a run queue waiting to print). Because if the system is having issues (which is the main reason for printks to happen), there's no guarantee that a work queue or another thread will ever schedule, and the safe printk buffer never gets out to the consoles. I much rather have throttling when recursive printks are detected. Make it a 100 lines to print if you want, but then throttle. Because once you have 100 lines or so, you will know that printks are causing printks, and you don't give a crap about the repeated process. Allow one flushing of the printk safe buffers, and then if it happens again, throttle it. Both methods can lose important data. I believe the throttling of recursive printks, after 100 prints or whatever, will be the least likely to lose important data, because printks caused by printks will just keep repeating the same data, and we don't care about repeats. But delaying the flushing could very well lose important data that caused a lockup. -- Steve