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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 473D4C2D0EF for ; Fri, 17 Apr 2020 13:55:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 093CC214AF for ; Fri, 17 Apr 2020 13:55:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cEO9ryCO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 093CC214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 947978E001D; Fri, 17 Apr 2020 09:55:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F71F8E0001; Fri, 17 Apr 2020 09:55:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E57E8E001D; Fri, 17 Apr 2020 09:55:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 63BC78E0001 for ; Fri, 17 Apr 2020 09:55:58 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1E10C180ACEF0 for ; Fri, 17 Apr 2020 13:55:58 +0000 (UTC) X-FDA: 76717495596.14.name44_6e464e135635d X-HE-Tag: name44_6e464e135635d X-Filterd-Recvd-Size: 5422 Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Apr 2020 13:55:57 +0000 (UTC) Received: by mail-il1-f194.google.com with SMTP id u5so2188662ilb.5 for ; Fri, 17 Apr 2020 06:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n410NB/6Wp1LITaQWR9HUM12gaUTTF3okN7ulBq5MsM=; b=cEO9ryCO6xj9USH9wKt7twTrXG58c9sqtrc+s1GnTj36hxfEgntqp2VS3VDJfLARAH DCrxQmPg0bx3laby9as6AcxTJFXyUcXcy/8B4HZMwWi8BQyqpG8dBTVQsB+1rquVWgL/ IGJM5Ab4xIOYzdXg0JOiu+YyMQw7tcjxldtnlGGmlM+J6gEB9pLE6kOvs9+xticbLBzu TKswoMVSSl0jB1ho3k/U7VFGGy4yZcW3ojZ5xAZCR+SPoecnpnNP3jir3UthhJUVEJaR UTY6GxvqiWQtOT6avxUgXo26BH5fMfa7kkFAI2wEfCLnzfHhR52xx+ovNCiBIzXJMuTX szoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n410NB/6Wp1LITaQWR9HUM12gaUTTF3okN7ulBq5MsM=; b=iXynFXsh4T0SNWgtawfN4aMWCZ2zWdYFJtrCp4roYEe9j7WBD2dtyWp52eK5r4W2LO o2NeBV3LvsMrnXn6NlWzgFlg8OYoC/9RTgn2ybT6xSNSP9lo7MHdPYYzcW8p8A5T53Yb fuKzEMWeHeHnTaxEByuN+ZCbp5PVBTbu1CQttKIsCpJYTDDpbkXlGQksS4Skie5NxVtB z2BspjiyHnGVMGpEVHUuJeX7PZVUCViXtmw5SY/bU9bfHv3ktQcErG6WLqTUWRltVfqo XVvoERU9XB4rbfq358c2pzoWgAhUems+ihoXnnrJpXEyyQY6k/B87PEyuLQgHVsx42PX ZCjg== X-Gm-Message-State: AGi0PuZBBY2P1H7H19fNfQiS9Zg9lwwGB5jOH7Vg4lUkvqgDYj19XFxv p4maBGMGIhSA5RKDQqKI0d7bt6U/HQrJZjXI/js= X-Google-Smtp-Source: APiQypKjn4lqQwUjKzTc6FEs7h6El6zKJHreUJXhSa1vKRVDrIa4uiUs3sjdRww141PEgaLX7h8FOwUOQN68425Em90= X-Received: by 2002:a92:9a4d:: with SMTP id t74mr3251481ili.168.1587131757104; Fri, 17 Apr 2020 06:55:57 -0700 (PDT) MIME-Version: 1.0 References: <1586597774-6831-1-git-send-email-laoar.shao@gmail.com> <20200414073911.GC4629@dhcp22.suse.cz> <20200414143229.GN4629@dhcp22.suse.cz> <634bab6a-fee1-45b8-62af-be03062ae2bf@I-love.SAKURA.ne.jp> <6d6c3793-d327-5d52-a1be-e5c30dc54ddf@i-love.sakura.ne.jp> In-Reply-To: <6d6c3793-d327-5d52-a1be-e5c30dc54ddf@i-love.sakura.ne.jp> From: Yafang Shao Date: Fri, 17 Apr 2020 21:55:21 +0800 Message-ID: Subject: Re: [RFC PATCH] mm, oom: oom ratelimit auto tuning To: Tetsuo Handa Cc: Michal Hocko , Andrew Morton , Linux MM , Petr Mladek , Sergey Senozhatsky Content-Type: text/plain; charset="UTF-8" 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 Fri, Apr 17, 2020 at 9:04 PM Tetsuo Handa wrote: > > On 2020/04/17 20:57, Yafang Shao wrote: > >>>>> I justed worried that the user may complain it if too many > >>>>> oom_kill_process callbacks are suppressed. > >>>> > >>>> This can be a real concern indeed. > >> > >> I'm proposing automated ratelimiting of dump_tasks() at > >> http://lkml.kernel.org/r/1563360901-8277-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp . > >> I believe that automated ratelimiting of dump_tasks() remains necessary > >> even after printk() became asynchronous. > >> > > > > Thanks for your information. > > I haven't read your proposal carefully, but take a first glance I > > think it would be a useful improvement. > > Thank you. That patch alone avoids just RCU stall. But > https://lkml.kernel.org/r/7de2310d-afbd-e616-e83a-d75103b986c6@i-love.sakura.ne.jp and > https://lkml.kernel.org/r/57be50b2-a97a-e559-e4bd-10d923895f83@i-love.sakura.ne.jp > referenced from that thread allows defer printing of OOM victim candidates. And > > >>> Yes, printk being too sync is the real issue. If the printk an be > >>> async, then we don't need to worry about it at all. > >> > >> I strongly disagree. dump_tasks() will needlessly fill printk() log buffer > >> (and potentially loose other kernel messages due to buffer full / disk full). > >> > > > > Yup, printk() log buffer will be a issue if the console is too slow. > > After the printk() is implemented as async, I thinks it is worth to do > > some optimization. > > my suggestion is to offload printing of OOM victim candidates to a workqueue context. > Then, even after printk() became asynchronous, that workqueue waits for completion of > printing to consoles for each OOM victim candidate. This way, only dump_tasks() where > dumping of past OOM-killer invocations has not completed will suppress dump_tasks() > from later OOM-killer invocations in a way duplicated OOM victims won't be reported > for many times (and also saves printk() log buffer / disk space). > Sounds like a good idea. > I need real world reports (like your report)... I'd appreciate it if my report could help you. Feel free to let me know if you need more infomation. Thanks Yafang