From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751654AbcGMXJC (ORCPT ); Wed, 13 Jul 2016 19:09:02 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33074 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbcGMXIz (ORCPT ); Wed, 13 Jul 2016 19:08:55 -0400 MIME-Version: 1.0 In-Reply-To: <20160713153910.GY4695@ubuntu> References: <20160701165959.GR12473@ubuntu> <20160701172232.GD28719@htj.duckdns.org> <20160706182842.GS2671@ubuntu> <20160711102603.GI12410@quack2.suse.cz> <20160711154438.GA528@swordfish> <20160711223501.GI4695@ubuntu> <20160712231903.GR4695@ubuntu> <20160713054507.GA563@swordfish> <20160713153910.GY4695@ubuntu> From: "Rafael J. Wysocki" Date: Thu, 14 Jul 2016 01:08:51 +0200 X-Google-Sender-Auth: wIMdlcCPqZC-EoTJzdyo3yZYCzc Message-ID: Subject: Re: [Query] Preemption (hogging) of the work handler To: Viresh Kumar Cc: Sergey Senozhatsky , Jan Kara , Sergey Senozhatsky , "Rafael J. Wysocki" , Tejun Heo , Greg Kroah-Hartman , Linux Kernel Mailing List , vlevenetz@mm-sol.com, Vaibhav Hiremath , Alex Elder , johan@kernel.org, Andrew Morton , Steven Rostedt , Linux PM , Petr Mladek Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2016 at 5:39 PM, Viresh Kumar wrote: > On 13-07-16, 14:45, Sergey Senozhatsky wrote: >> On (07/12/16 16:19), Viresh Kumar wrote: [cut] >> >> something like below, perhaps. will this work for you? > > Maybe not, as this can still lead to the original bug we were all > chasing. This may hog some other CPU if we are doing excessive > printing in suspend :( How can it hog that CPU, exactly? > suspend_console() is called quite early, so for example in my case we > do lots of printing during suspend (not from the suspend thread, but > an IRQ handled by the USB subsystem, which removes a bus with help of > some other thread probably). Why doing a lot of printing from an IRQ is not regarded as a bug? Are all of those messages printed actually useful? > That is why my Hacky patch tried to do it after devices are removed > and irqs are disabled, but before syscore users are suspended (and > timekeeping is one of them). And so it fixes it for me completely. > > IOW, we should switch back to synchronous printing after disabling > interrupts on the last running CPU. > > And I of course agree with Rafael that we would need something similar > in Hibernation code path as well, if we choose to fix it my way. Well, the patch proposed by Sergey is sufficient to fix the deadlock issue and it is not clear that anything more needs to be done. My suggestion, then, would be to use this patch to start with and see if things really go worse then. Thanks, Rafael