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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 4A968C2D0EF for ; Sat, 18 Apr 2020 10:14:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DDFA621D7E for ; Sat, 18 Apr 2020 10:14:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDFA621D7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=i-love.sakura.ne.jp Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7DA9F8E0005; Sat, 18 Apr 2020 06:14:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 789C98E0003; Sat, 18 Apr 2020 06:14:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69F7C8E0005; Sat, 18 Apr 2020 06:14:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id 4E61D8E0003 for ; Sat, 18 Apr 2020 06:14:23 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 066C0180AD5C5 for ; Sat, 18 Apr 2020 10:14:23 +0000 (UTC) X-FDA: 76720566006.25.girl71_7d775b8136e2e X-HE-Tag: girl71_7d775b8136e2e X-Filterd-Recvd-Size: 4248 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Sat, 18 Apr 2020 10:14:21 +0000 (UTC) Received: from fsav107.sakura.ne.jp (fsav107.sakura.ne.jp [27.133.134.234]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 03IAE3ak016015; Sat, 18 Apr 2020 19:14:03 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav107.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav107.sakura.ne.jp); Sat, 18 Apr 2020 19:14:03 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav107.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 03IADwqF015929 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Apr 2020 19:14:03 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [nacked] mm-oom-avoid-printk-iteration-under-rcu.patch removed from -mm tree To: Michal Hocko , akpm@linux-foundation.org Cc: guro@fb.com, linux-mm , rientjes@google.com, shakeelb@google.com, Yafang Shao References: <20200131043324.wkArXTf6-%akpm@linux-foundation.org> <20200417152637.GQ26707@dhcp22.suse.cz> From: Tetsuo Handa Message-ID: <68371d79-dfae-e9b9-38df-dbb916607a82@i-love.sakura.ne.jp> Date: Sat, 18 Apr 2020 19:13:57 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200417152637.GQ26707@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 2020/04/18 0:26, Michal Hocko wrote: > On Fri 17-04-20 23:33:41, Tetsuo Handa wrote: >> On 2020/01/31 13:33, akpm@linux-foundation.org wrote: >>> The patch titled >>> Subject: mm, oom: avoid printk() iteration under RCU >>> has been removed from the -mm tree. Its filename was >>> mm-oom-avoid-printk-iteration-under-rcu.patch >>> >>> This patch was dropped because it was nacked >> >> This patch was once nacked by Michal Hocko. But based on >> https://lkml.kernel.org/r/CALOAHbArHa-QZ2hXnLOhEJ3Ti=C69-LPtjZB9zqPcuTKeHsV4g@mail.gmail.com >> that dump_tasks() will become a real world problem with slow consoles (even if >> printk() becomes asynchronous), I propose you to revive this patch as a first step for >> implementing workable ratelimit for dump_tasks(). This patch can be applied as-is >> on current linux.git and linux-next.git (only offset difference). > > My nack still applies. Slow consoles are really a pain and they are > going to be addressed by the upcoming printk work from a large part. > Your patch doesn't address the problem it merely shift it around while > making code even more obscure and harder to maintain. Your nack is wrong. The upcoming printk work will not address the problem. > > For the specific issue that you are pointing out, a simple and working > workaround is to reduce the loglevel or disable dump_tasks. There is no > real reason to add ugly kluges IMHO. I do need dump_tasks() output in order to understand memory usage as of invocation of the OOM killer (rather than verifying whether the OOM killer chose appropriate OOM victim). I really do not want to reduce the loglevel or disable dump_tasks(). You are misunderstanding the problem. Asynchronous printk() cannot solve a problem that printk() buffer is needlessly flooded with OOM related messages, which can result in loss of non OOM-related messages if console is slow and can result in bloating of log files if console is not slow. My proposal is to minimize duplicated OOM-related messages by keeping dump_task() synchronous (even if printk() becomes asynchronous) by offloading the printing to a workqueue context. This patch is the first step for making it possible to offload the printing to a workqueue context. Waiting for printk() to become asynchronous is completely irrelevant.