lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAesultdR77oRaSI@pathway.suse.cz>
Date: Tue, 22 Apr 2025 16:50:34 +0200
From: Petr Mladek <pmladek@...e.com>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
	Kuniyuki Iwashima <kuniyu@...zon.com>,
	Mateusz Guzik <mjguzik@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	John Ogness <john.ogness@...utronix.de>,
	Sergey Senozhatsky <senozhatsky@...omium.org>,
	Jon Pan-Doh <pandoh@...gle.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Karolina Stolarek <karolina.stolarek@...cle.com>
Subject: Re: [PATCH RFC 0/9] Reduce ratelimit's false-positive misses

On Fri 2025-04-18 10:13:49, Paul E. McKenney wrote:
> Hello!
> 
> This v2 series replaces open-coded uses of the ratelimit_state structure
> with formal APIs, counts all rate-limit misses, replaces jiffies=0 special
> case with a flag, provides a ___ratelimit() trylock-failure fastpath
> to (almost) eliminate false-positive misses, and adds a simple test.
> 
> The key point of this series is the reduction of false-positive misses.
> 
> The individual patches are as follows:
> 
> 1.	Add trivial kunit test for ratelimit.

I have suggested few cosmetic changes for the above patch.

> 2.	Create functions to handle ratelimit_state internals.
> 
> 3.	Avoid open-coded use of ratelimit_state structure's ->missed
> 	field.
> 
> 4.	Avoid open-coded use of ratelimit_state structure's ->missed
> 	field.
> 
> 5.	Avoid open-coded use of ratelimit_state structure's internals.
> 
> 6.	Convert the ->missed field to atomic_t.
> 
> 7.	Count misses due to lock contention.
> 
> 8.	Avoid jiffies=0 special case.
> 
> 9.	Reduce ___ratelimit() false-positive rate limiting, courtesy of
> 	Petr Mladek.
> 
> 10.	Allow zero ->burst to disable ratelimiting.
> 
> 11.	Force re-initialization when rate-limiting re-enabled.
> 
> 12.	Don't flush misses counter if RATELIMIT_MSG_ON_RELEASE.
> 
> 13.	Avoid atomic decrement if already rate-limited.
> 
> 14.	Avoid atomic decrement under lock if already rate-limited.

The rest looks good. And I think that it is a great improvement.
Feel free to use for the entire patchset:

Reviewed-by: Petr Mladek <pmladek@...e.com>

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ