From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC2DFC433DF for ; Thu, 15 Oct 2020 13:05:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2DD332225C for ; Thu, 15 Oct 2020 13:05:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="Pi6Q3bF2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DD332225C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5B4026B005D; Thu, 15 Oct 2020 09:05:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58A516B0062; Thu, 15 Oct 2020 09:05:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 453196B0068; Thu, 15 Oct 2020 09:05:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 15D7D6B005D for ; Thu, 15 Oct 2020 09:05:58 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9AB92180AD817 for ; Thu, 15 Oct 2020 13:05:57 +0000 (UTC) X-FDA: 77374182354.23.lift01_6204c6427214 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 0E52837606 for ; Thu, 15 Oct 2020 13:05:57 +0000 (UTC) X-HE-Tag: lift01_6204c6427214 X-Filterd-Recvd-Size: 3897 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Thu, 15 Oct 2020 13:05:56 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1602767155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FGqO3ULR2w1iMMkp49sxE+R6RGpx5tMKywc3UXIqMQg=; b=Pi6Q3bF2tB+fD4gdbk/v7fcBq66CwgGkZuF09zs6bkotGUC9t5+nS47pub/tLFsdrIOdxo wzyyp+7XWPab8FlNNARa6Iu+99am7t1YmU7zX4YDfGwuYRXIO6fOZvWa1jA2dUs8n6fxqq NgymofRFUAI+gp2Q8Qz2BBKKdBWmO3c= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5DAD9AD79; Thu, 15 Oct 2020 13:05:55 +0000 (UTC) Date: Thu, 15 Oct 2020 15:05:54 +0200 From: Petr Mladek To: Tetsuo Handa Cc: Ricardo =?iso-8859-1?Q?Ca=F1uelo?= , Michal Hocko , akpm@linux-foundation.org, kernel@collabora.com, hch@lst.de, guro@fb.com, rientjes@google.com, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, linux-mm@kvack.org, Sergey Senozhatsky , Steven Rostedt Subject: Re: [PATCH] mm, oom: enable rate-limiting controls for oom dumps Message-ID: <20201015130554.GF8871@alley> References: <20201009093014.9412-1-ricardo.canuelo@collabora.com> <20201012152232.GD10602@alley> <20201012154114.GJ29725@dhcp22.suse.cz> <87993bef-3f83-0527-fa52-4f2c28eb7e56@i-love.sakura.ne.jp> <20201013090259.GC26155@alley> <9cb10e17-ac04-9f7d-2138-cc044e2b080b@i-love.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9cb10e17-ac04-9f7d-2138-cc044e2b080b@i-love.sakura.ne.jp> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 2020-10-13 19:46:32, Tetsuo Handa wrote: > On 2020/10/13 18:02, Petr Mladek wrote: > > On Tue 2020-10-13 09:40:27, Tetsuo Handa wrote: > >> Proper ratelimiting for OOM messages had better not to count on asynchronous printk(). > > > > I am a bit confused. AFAIK, you wanted to print OOM messages > > asynchronous ways in the past. The lockless printk ringbuffer is on > > its way into 5.10. Handling consoles in kthreads will be the next > > step of the printk rework. > > What I'm proposing is synchronously printing OOM messages from a different > thread, for one dump_tasks() call can generate thousands of lines which may > significantly delay arrival of non OOM related messages to consoles (or even > drop due to logbuf being full). I don't want to enqueue too many OOM related > messages to logbuf, even after printk() became completely asynchronous. This looks like a lot of complexity. I am not convinced that it is worth it. I could understand that people heavily testing OOM behavior meet this problem. But I wonder how many people really meet this problem in the real life. > > Could you please provide some examples how you would tune ratelimit > > when printing all messages to the console takes X ms and OOM > > happens every Y ms? > > My proposal is to decide whether to print the new report based on > whether all OOM candidates for that OOM domain have been flushed to > consoles. There is no X and Y. >From the printk() point of view, we need an API that would provide information whether a given message reached the consoles or not. Then it would be up to the MM-code to use it. One catch might be when console_seq is synchronized by console_lock. Because the caller of this API would become responsible for flushing all existing messages. But it should be usable. It is currently synchronized also by logbuf_lock. Best Regards, Petr