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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01A6C27C53 for ; Wed, 19 Jun 2024 08:37:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D3BC6B0198; Wed, 19 Jun 2024 04:37:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 687D36B019F; Wed, 19 Jun 2024 04:37:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4614D6B0198; Wed, 19 Jun 2024 04:37:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 253D76B018F for ; Wed, 19 Jun 2024 04:37:24 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A07E21C19EB for ; Wed, 19 Jun 2024 08:37:23 +0000 (UTC) X-FDA: 82246983966.23.3F038F8 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) by imf07.hostedemail.com (Postfix) with ESMTP id 61BC740016 for ; Wed, 19 Jun 2024 08:37:21 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=kwr3YvHq; spf=pass (imf07.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.174 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718786238; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7numITJvHh+6j+se1peXK1jwyYEH767i6dTlNLJqsIE=; b=WjU40T/0hejhjo64lnZHpibhhj6DuNEq6u6QQRZR6j7dEjVbKvU2TUzm46vzY0rdV8nmpq ilTpZLQfzCMdqUJMmbBd7ieNICUumgF+nymarQ/vmdHBL/jGb2kUKteWJI/qfIi5ALJZ8D GN/a/bpPi/JZrO9PuZPbTfyGQ1y6lU8= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=kwr3YvHq; spf=pass (imf07.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.174 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718786238; a=rsa-sha256; cv=none; b=2RAcQvLZfc77x2dOEvna9qcIrdwQ39bSvtop58c6LELdtSumk8AhdjFASHi89WiItkwWsx GSXgMRqX084GgjA+zK4VcqYTsDrjBLV0MvuZYe77fKWxvcNsyx7gQtfXYYlOmnWu4F6l8R XrzELVPw0EeNb/q486uGS9AVZc9gPn0= X-Envelope-To: mhocko@suse.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718786239; 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=7numITJvHh+6j+se1peXK1jwyYEH767i6dTlNLJqsIE=; b=kwr3YvHqA6Igf+xN+cml8e9jMR26AWvOSTrxTCj4bFrIAccwuh0IBOpvmplT4hpQw/gqom zQG9XcIwmLAqTDZexaFxu6aoXsmcNK76kewr9xEox2YGqbvWtRsin34pDn8eyJifTxs5+L IAzMt27o4HXfF3w5yhHtSxvYDRoHAMw= X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: torvalds@linux-foundation.org X-Envelope-To: kernel-team@meta.com X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: kyle@infradead.org Date: Wed, 19 Jun 2024 01:37:16 -0700 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Michal Hocko Cc: Andrew Morton , Linus Torvalds , kernel-team@meta.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kyle McMartin Subject: Re: [PATCH] mm: ratelimit oversized kvmalloc warnings instead of once Message-ID: <5xkoffvdpruisl2fo2wg4e5vof6ajvlszhohp2lcyr5ysv4nk6@yuqpqchnaxmi> References: <20240618213421.282381-1-shakeel.butt@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 61BC740016 X-Stat-Signature: p1hoe7m1swnaicxqfztsiywqxmswwhmm X-HE-Tag: 1718786241-659108 X-HE-Meta: U2FsdGVkX19Eea2hKuNwRwTLgljRp35sMWllzIXCf1rdLumvSMcVwzMastie3r0zeF1VhVgYWpq4Ex9OPZUPIt4avbySG2rfoIvYYargtO12MCwfPKWBD8Ngy2n2IcrHkuD/GVqQcMGVzZ2+cK//xZhnywetpyxtmsDRPQbvNB8GhAqA4ZPRXQAwcGe+ZHDRm5ZFqYDf5Nf+KBKpEiXOzRLxWPZj7Vf2Wi/pQztRvHAhXNWmXR5UME/BpiejL/jwHtvUpXPPssnGJnKJ6nB0BG3yJ2E9dGg6H32MSQCDrN2OQULar8jpRFFgemnmPC2Tb5seXVRdOQTqZpaTZNgcCzfYAa564HqqU5P2t/XAvUKV5doknRoOvio57TnsRMt5xEoKXyP10xizqJTEVKg0J5E7kmY3KZaq/HWSGknmh1KySyoMExmb3zJa6yj/T9qwGAZb+y41aJwuYizW6PCQpB5psmNyViq27URoQyggfOzKfr7Mw0XjnOGGhdra4GsHtLUhDWEmR9ObMoBVtvghaGc6T5cmIvECNUMVql0it0xPFoL8IWrJdlNv2//Ztw7FiwjLkla0nNuGUG9MrPHnNfv3MGjWI92PbVNcwacksmFgrZOXnfGnXErSQU2s0cr/GJIydIy0kEj/UY8LVfFkUTLC4p1Uhb4Ho6KNP3Skcm+2zYcyqolEcZgXDaZUtQRmppX70zW7w859Ppr5afsdmYHPHKnwC0jjZ5lAE0wJlpo/8KMPBhMn/BMDj3vXxiQ93f6CewJNyn7gcuTVRpvaFzIzSzlNZfVdX11SRNDsLYe9IKv4PR8H6c9+Qb7O8ZmT3Xp/0YdJRN0BtGEi9vdwnHAciGWiSKmuoskEr7iB707xckseav804//f8ctitUqqE1JczJ4aDRy3Y5LgligYbYTtFialSWjGCsHzZPE16LSD7tbDlO41zDFqiB2hbNyRkyhfAP1y4CrC6lS1c1Y ZtK7iDtQ n+L4VpdFO3t2j7WxILzSPXZVZzeynOARH6Jyf0W46ihroqwHigV0I4voK6N/mWwD7cjnMsRTM0FM8NS6gWwRV1SPtYozf5UZfLoUSYHACCBCNS6l5MimpYJvpE8AbbwSDdlrohLF/lln8ut5b5qg7Va0f+oVGvf0l4LKvnpgoCXb2T1Og7r2aq0r8OA== 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: List-Subscribe: List-Unsubscribe: On Wed, Jun 19, 2024 at 10:30:46AM GMT, Michal Hocko wrote: > On Wed 19-06-24 01:03:16, Shakeel Butt wrote: > > On Wed, Jun 19, 2024 at 09:19:41AM GMT, Michal Hocko wrote: > > > On Tue 18-06-24 14:34:21, Shakeel Butt wrote: > > > > At the moment oversize kvmalloc warnings are triggered once using > > > > WARN_ON_ONCE() macro. One issue with this approach is that it only > > > > detects the first abuser and then ignores the remaining abusers which > > > > complicates detecting all such abusers in a timely manner. The situation > > > > becomes worse when the repro has low probability and requires production > > > > traffic and thus require large set of machines to find such abusers. In > > > > Mera production, this warn once is slowing down the detection of these > > > > abusers. Simply replace WARN_ON_ONCE with WARN_RATELIMIT. > > > > > > Long time ago, I've had a patch to do the once_per_callsite WARN. I > > > cannot find reference at the moment but it used stack depot to note > > > stacks that have already triggered. Back then there was no reponse on > > > the ML. Should I try to dig deep and recover it from my archives? I > > > think this is exactly kind of usecase where it would fit. > > > > > > > Do you mean something like warn once per unique call stack? > > Exactly! > > > If yes then > > I think that is better than the simple ratelimiting version as > > ratelimiting one may still miss some abusers and also may keep warning > > about the same abuser. Please do share your patch. > > https://lore.kernel.org/all/20170103134424.28123-1-mhocko@kernel.org/ Do you want to propose this patch again (after rebase to latest) or should I take over?