From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753160AbcBJQvT (ORCPT ); Wed, 10 Feb 2016 11:51:19 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35644 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753055AbcBJQut (ORCPT ); Wed, 10 Feb 2016 11:50:49 -0500 Subject: Re: [PATCH] printk: avoid livelock if another CPU printks continuously To: Steven Rostedt , Petr Mladek References: <1454963703-20433-1-git-send-email-dvlasenk@redhat.com> <20160210144416.GE12548@pathway.suse.cz> <20160210161016.GF12548@pathway.suse.cz> <20160210112530.04c5512f@gandalf.local.home> Cc: Denys Vlasenko , linux-kernel@vger.kernel.org, srostedt@redhat.com, Tejun Heo , Jan Kara , Sergey Senozhatsky , Andrew Morton , Kyle McMartin , KY Srinivasan , Dave Jones , Calvin Owens From: Peter Hurley Message-ID: <56BB6A66.6020502@hurleysoftware.com> Date: Wed, 10 Feb 2016 08:50:46 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160210112530.04c5512f@gandalf.local.home> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/10/2016 08:25 AM, Steven Rostedt wrote: > On Wed, 10 Feb 2016 17:10:16 +0100 > Petr Mladek wrote: > >>> Note, it's not that performance critical, and the loop only happens if >>> someone else is adding to the console, which hopefully, should be rare. >> >> I probably used too strong words. It is possible that the performance >> impact will not be critical. But the behavior is non-deterministic. >> I think that the approach taken by Jack is more promising. >> I mean the offloading of the console stuff to a workqueue. > > My worry about that is that it never comes out. The point about printk, > is that it should pretty much be guaranteed to print. If the system is > dying, and we push it off to a work queue, and that workqueue never > runs, then we lose critical data. I agree. I thought a more promising approach was Pan Xinhui's patch from August [1] which hands off console output to the incoming cpu. The reqd state machine is described in more detail in the revised patch [2]. Unfortunately, the patch was abandoned. I think he may have misunderstood when I also referred to Jack's patches; I meant to simply draw attention to concurrent work for review and comparison. [1] original https://lkml.org/lkml/2015/8/11/333 [2] revised https://lkml.org/lkml/2015/8/12/321