From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204AbcAFGrb (ORCPT ); Wed, 6 Jan 2016 01:47:31 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:34235 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbcAFGr2 (ORCPT ); Wed, 6 Jan 2016 01:47:28 -0500 Date: Wed, 6 Jan 2016 15:48:36 +0900 From: Sergey Senozhatsky To: Jan Kara Cc: Sergey Senozhatsky , Sergey Senozhatsky , Andrew Morton , Petr Mladek , KY Sri nivasan , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] printk: Hand over printing to console if printing too long Message-ID: <20160106064836.GC781@swordfish> References: <20151210145251.GA540@swordfish> <20151222134730.GD7266@quack.suse.cz> <20151223015420.GA2008@swordfish> <20160105143717.GC14464@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160105143717.GC14464@quack.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (01/05/16 15:37), Jan Kara wrote: > > How about setting 'sync_print' to 'true' in... > > bust_spinlocks() /* only set to true */ > > or > > console_verbose() /* um... may be... */ > > or > > having a separate one-liner for that > > > > void console_panic_mode(void) > > { > > sync_print = true; > > } > > > > and call it early in panic(), before we send out IPI_STOP. > > I like using console_verbose() for setting sync_print to true. That will > likely be more reliable than using oops in progress. After all > console_verbose() is used like console_panic_mode() anyway and in quite a > few places so it is a reasonable match. another corner case. a quote from -mm a74b6533ead8 http://www.spinics.net/lists/linux-mm/msg98990.html : This patch reduces the probability of such a lockup by introducing a : specialized kernel thread (oom_reaper) which tries to reclaim additional : memory by preemptively reaping the anonymous or swapped out memory owned : by the oom victim under an assumption that such a memory won't be needed : when its owner is killed and kicked from the userspace anyway. There is : one notable exception to this, though, if the OOM victim was in the : process of coredumping the result would be incomplete. This is considered : a reasonable constrain because the overall system health is more important : than debugability of a particular application. : : A kernel thread has been chosen because we need a reliable way of : invocation so workqueue context is not appropriate because all the workers : might be busy (e.g. allocating memory). Kswapd which sounds like another : good fit is not appropriate as well because it might get blocked on locks : during reclaim as well. particularly this "workqueue context is not appropriate because all the workers might be busy (e.g. allocating memory)" part. I think printk should switch to sync mode in this case, since printk now does queue_work(system_wq, work). um... console_verbose() call from oom kill? but it'll be nice to return back to async mode once (if) memory pressure goes away. -ss