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 740C2C433E7 for ; Tue, 13 Oct 2020 07:25:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B1BCB207C3 for ; Tue, 13 Oct 2020 07:25:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="QpJxUdq2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1BCB207C3 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 C7C47940007; Tue, 13 Oct 2020 03:25:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2CE5900002; Tue, 13 Oct 2020 03:25:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1BE1940007; Tue, 13 Oct 2020 03:25:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id 84E5A900002 for ; Tue, 13 Oct 2020 03:25:07 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1BEA8180AD806 for ; Tue, 13 Oct 2020 07:25:07 +0000 (UTC) X-FDA: 77366065854.02.dock45_260bb5e27201 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id DEE4A101E2D0F for ; Tue, 13 Oct 2020 07:25:06 +0000 (UTC) X-HE-Tag: dock45_260bb5e27201 X-Filterd-Recvd-Size: 3628 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 13 Oct 2020 07:25:06 +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=1602573905; 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=bH7xXReXa87Vd9bnUCVmbWVX9hUcGD9WWd3OERzWt/4=; b=QpJxUdq2Cc0m9qTsEBDNwXvJWib/0jnjUxNxjZFd38vdhGyT0nx/KqZvPjVOtzLnkYRP83 4YUepoeW6Ful+4pvt719ZKk1/rzNWjy1w6J60k+cq2dCcEMwW0IcB1qWRV5zEzCn3OYhnC N0eOxmhsdg6lg2jNvHN3iJ2HeBKDZIU= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2C802ACA3; Tue, 13 Oct 2020 07:25:05 +0000 (UTC) Date: Tue, 13 Oct 2020 09:25:02 +0200 From: Michal Hocko To: Tetsuo Handa Cc: Ricardo =?iso-8859-1?Q?Ca=F1uelo?= , Petr Mladek , 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: <20201013072411.GK29725@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87993bef-3f83-0527-fa52-4f2c28eb7e56@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 13-10-20 09:40:27, Tetsuo Handa wrote: > On 2020/10/13 0:41, Michal Hocko wrote: > >> What about introducing some feedback from the printk code? > >> > >> static u64 printk_last_report_seq; > >> > >> if (consoles_seen(printk_last_report_seq)) { > >> dump_header(); > >> printk_last_report_seq = printk_get_last_seq(); > >> } > >> > >> By other words. It would skip the massive report when the consoles > >> were not able to see the previous one. > > > > I am pretty sure this has been discussed in the past but maybe we really > > want to make ratelimit to work reasonably also for larger sections > > instead. Current implementation only really works if the rate limited > > operation is negligible wrt to the interval. Can we have a ratelimit > > alternative with a scope effect (effectivelly lock like semantic)? > > if (rate_limit_begin(&oom_rs)) { > > dump_header(); > > rate_limit_end(&oom_rs); > > } > > > > rate_limi_begin would act like a try lock with additional constrain on > > the period/cadence based on rate_limi_end marked values. > > > > Here is one of past discussions. > > https://lkml.kernel.org/r/7de2310d-afbd-e616-e83a-d75103b986c6@i-love.sakura.ne.jp > https://lkml.kernel.org/r/20190830103504.GA28313@dhcp22.suse.cz > https://lkml.kernel.org/r/57be50b2-a97a-e559-e4bd-10d923895f83@i-love.sakura.ne.jp > > Michal Hocko complained about different OOM domains, and now just ignores it... None of the above deals with the amount of printed data which is the point of this patch AFAIU. > Proper ratelimiting for OOM messages had better not to count on asynchronous printk(). Because? -- Michal Hocko SUSE Labs