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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 B7283C2D0A1 for ; Mon, 12 Oct 2020 15:41:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 630922087D for ; Mon, 12 Oct 2020 15:41:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.com header.i=@suse.com header.b="r9w0ggth" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 630922087D 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 F251894001A; Mon, 12 Oct 2020 11:41:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EAD81940018; Mon, 12 Oct 2020 11:41:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9B0694001A; Mon, 12 Oct 2020 11:41:17 -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 A3B80940018 for ; Mon, 12 Oct 2020 11:41:17 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3BEFD8249980 for ; Mon, 12 Oct 2020 15:41:17 +0000 (UTC) X-FDA: 77363687394.11.pies06_020a1e0271fb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 1D273180F8B82 for ; Mon, 12 Oct 2020 15:41:17 +0000 (UTC) X-HE-Tag: pies06_020a1e0271fb X-Filterd-Recvd-Size: 3883 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Mon, 12 Oct 2020 15:41:16 +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=1602517275; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8JHnXOFJ44z4V/j8VGjRUMueJMDKJqDLwAs8ZyArjUo=; b=r9w0ggthNr8iOOFnIvUgsyaiZwB7mOke7MLHz7tB8YmF1IHJpgHtb3K8iJ3usY9crFWfQg 0DE3b2HHoZ4HaezxK+R5HfToN5WPHrZ8bvMZUECwvNnwho8X/kSqtf5xI5RpvKzEOKUSxT gnQLMmqlZlnvn4/PMxv/ulyKgEddnEA= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 59D2DB00D; Mon, 12 Oct 2020 15:41:15 +0000 (UTC) Date: Mon, 12 Oct 2020 17:41:14 +0200 From: Michal Hocko To: Petr Mladek Cc: Ricardo =?iso-8859-1?Q?Ca=F1uelo?= , 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: <20201012154114.GJ29725@dhcp22.suse.cz> References: <20201009093014.9412-1-ricardo.canuelo@collabora.com> <20201012152232.GD10602@alley> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20201012152232.GD10602@alley> Content-Transfer-Encoding: quoted-printable 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 Mon 12-10-20 17:22:32, Petr Mladek wrote: > > Add two sysctl entries (vm.oom_dump_ratelimit and > > vm.oom_dump_ratelimit_burst) to control the rate limiting interval an= d > > burst, respectively, of the OOM killer output (oom_kill_process()). > >=20 > > These entries are disabled by default and can be enabled during kerne= l > > configuration with CONFIG_DUMP_RATELIMIT. They take > > DEFAULT_RATELIMIT_INTERVAL and DEFAULT_RATELIMIT_BURST as their defau= lt > > values. > >=20 > > Signed-off-by: Ricardo Ca=F1uelo > > --- > >=20 > > In some setups, the amount of output that the OOM killer generates wh= en > > it kills a process and dumps the list of tasks can be too > > large. Unfortunately, the rate-limiting used for it uses the default > > values for the rate limit interval and burst. This patch allows the u= ser > > to configure these values. >=20 > It might be pretty hard to set any reasonable values. It depends on > the console speed and the amount of processes on the system. I wonder > who many people would be able to use it in reality. Agreed! > What about introducing some feedback from the printk code? >=20 > static u64 printk_last_report_seq; >=20 > if (consoles_seen(printk_last_report_seq)) { > dump_header(); > printk_last_report_seq =3D printk_get_last_seq(); > } >=20 > 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. --=20 Michal Hocko SUSE Labs