Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp902342imm; Wed, 10 Oct 2018 06:11:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV62BA1/FBStlv23zzfm63va7Q/9SNKLgr5Y2CWrHfJlNaYe+xw7O71gz8hgot3nj++eBXUd7 X-Received: by 2002:a63:64c2:: with SMTP id y185-v6mr29364930pgb.411.1539177106809; Wed, 10 Oct 2018 06:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539177106; cv=none; d=google.com; s=arc-20160816; b=rnk26JE+lWzaw/2H/novejDv0bLZrgQRbHwkytRg9Ebsg5ONQkIUjRJgvqAdovTOFw qXdlC/0uRh4bS9t27wii8e5ingPiKDyUh5W5M0zYlFw8sNM1zojZwAGEOcLMhQoJizjA zp4sNwFZ4jAV0JoGywz9vA+Hy4sa9w2oELRmQNlYbPGPo5Acnjhmyta5urbnET/FGhej wTsWm1UpUe0iuO0UrNrDRjGnlGO2wFwFIZo6/fqE6EWf9LlAzBc14TUQkJq6Mc57yQaW w3JsfbNjSQWXiBBMtapQR0ncsUpdzbS7+iou3q/9jJLafiLeOp3twPegZxYkp+Cykwz9 9bCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=dE+ZldSDUGaXAp4s3sDBWqbvV1FsQBKmmGK9VhNsKcE=; b=vVpC0ekCpGuV1vHnUkOLUHq/5ykcbHuaiZemxf3W+0GRaUK+ggseFEylUAzQR8hpab tTl139zpV6AWtb55wHOkCWDh3Y2V5bXjZphh9wsTwtB77y3UDsREGVNP7WFlCv7tpEe3 BE1i5Ku+7PyUYWOiPH6fq6+BcnWnekox+ny8E/OmHcQIItvxfFC341RxkX/gO0a23/Hk AiPPS4NyChys0hoHSRdLFiIDJjpGiXvGVjLKNuEfLjFwT6aXEzT1N+gEFpEDjjjMF5P1 Re4g6NUEe8fDqggjSkAtZTA2U2Jm3HSv4OFVGtpZkP1sF3Gs+V1kkDleiNtI9CiSjKnM eZPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x13-v6si21607107pgq.357.2018.10.10.06.11.31; Wed, 10 Oct 2018 06:11:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727059AbeJJUcv (ORCPT + 99 others); Wed, 10 Oct 2018 16:32:51 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:36116 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726656AbeJJUcv (ORCPT ); Wed, 10 Oct 2018 16:32:51 -0400 Received: from fsav303.sakura.ne.jp (fsav303.sakura.ne.jp [153.120.85.134]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w9ADAdAo089098; Wed, 10 Oct 2018 22:10:39 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav303.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav303.sakura.ne.jp); Wed, 10 Oct 2018 22:10:39 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav303.sakura.ne.jp) Received: from [192.168.1.8] (softbank060157066051.bbtec.net [60.157.66.51]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w9ADAXJR089068 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Oct 2018 22:10:38 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: INFO: rcu detected stall in shmem_fault To: Dmitry Vyukov , Michal Hocko Cc: Sergey Senozhatsky , syzbot , Johannes Weiner , Andrew Morton , guro@fb.com, "Kirill A. Shutemov" , LKML , Linux-MM , David Rientjes , syzkaller-bugs , Yang Shi , Sergey Senozhatsky , Petr Mladek References: <000000000000dc48d40577d4a587@google.com> <201810100012.w9A0Cjtn047782@www262.sakura.ne.jp> <20181010085945.GC5873@dhcp22.suse.cz> <20181010113500.GH5873@dhcp22.suse.cz> <20181010114833.GB3949@tigerII.localdomain> <20181010122539.GI5873@dhcp22.suse.cz> From: Tetsuo Handa Message-ID: Date: Wed, 10 Oct 2018 22:10:31 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/10/10 21:36, Dmitry Vyukov wrote: > On Wed, Oct 10, 2018 at 2:29 PM, Dmitry Vyukov wrote: >> On Wed, Oct 10, 2018 at 2:25 PM, Michal Hocko wrote: >>> On Wed 10-10-18 20:48:33, Sergey Senozhatsky wrote: >>>> On (10/10/18 13:35), Michal Hocko wrote: >>>>>> Just flooding out of memory messages can trigger RCU stall problems. >>>>>> For example, a severe skbuff_head_cache or kmalloc-512 leak bug is causing >>>>> >>>>> [...] >>>>> >>>>> Quite some of them, indeed! I guess we want to rate limit the output. >>>>> What about the following? >>>> >>>> A bit unrelated, but while we are at it: >>>> >>>> I like it when we rate-limit printk-s that lookup the system. >>>> But it seems that default rate-limit values are not always good enough, >>>> DEFAULT_RATELIMIT_INTERVAL / DEFAULT_RATELIMIT_BURST can still be too >>>> verbose. For instance, when we have a very slow IPMI emulated serial >>>> console -- e.g. baud rate at 57600. DEFAULT_RATELIMIT_INTERVAL and >>>> DEFAULT_RATELIMIT_BURST can add new OOM headers and backtraces faster >>>> than we evict them. >>>> >>>> Does it sound reasonable enough to use larger than default rate-limits >>>> for printk-s in OOM print-outs? OOM reports tend to be somewhat large >>>> and the reported numbers are not always *very* unique. >>>> >>>> What do you think? >>> >>> I do not really care about the current inerval/burst values. This change >>> should be done seprately and ideally with some numbers. >> >> I think Sergey meant that this place may need to use >> larger-than-default values because it prints lots of output per >> instance (whereas the default limit is more tuned for cases that print >> just 1 line). Yes. The OOM killer tends to print a lot of messages (and I estimate that mutex_trylock(&oom_lock) accelerates wasting more CPU consumption by preemption). >> >> I've found at least 1 place that uses DEFAULT_RATELIMIT_INTERVAL*10: >> https://elixir.bootlin.com/linux/latest/source/fs/btrfs/extent-tree.c#L8365 >> Probably we need something similar here. Since printk() is a significantly CPU consuming operation, I think that what we need to guarantee is interval between the end of an OOM killer messages and the beginning of next OOM killer messages is large enough. For example, setup a timer with 5 seconds timeout upon the end of an OOM killer messages and check whether the timer already fired upon the beginning of next OOM killer messages. > > > In parallel with the kernel changes I've also made a change to > syzkaller that (1) makes it not use oom_score_adj=-1000, this hard > killing limit looks like quite risky thing, (2) increase memcg size > beyond expected KASAN quarantine size: > https://github.com/google/syzkaller/commit/adedaf77a18f3d03d695723c86fc083c3551ff5b > If this will stop the flow of hang/stall reports, then we can just > close all old reports as invalid. I don't think so. Only this report was different from others because printk() in this report was from memcg OOM events without eligible tasks whereas printk() in others are from global OOM events triggered by severe slab memory leak.