Re: ratelimit API: was: [RFC PATCH] printk: Introduce "store now but print later" prefix.

Michal Hocko
2019-03-21T08:49:47Z

On Thu 21-03-19 17:13:54, Tetsuo Handa wrote:
> On 2019/03/21 0:25, Petr Mladek wrote:
> >> This requires serialization among threads using "rs". I already
> >> proposed ratelimit_reset() for memcg's OOM problem at
> >> https://lkml.kernel.org/r/201810180246.w9I2koi3011358@www262.sakura.ne.jp
> >> but it was not accepted.
> >
> > IMHO, the main problem was that the patch tried to work around
> > the ratelimit API weakness by a custom code.
> >
> > I believe that using an improved/extended ratelimit API with
> > a sane semantic would be more acceptable.
> >
>
> Michal, are you OK to use ratelimit_reset() in out_of_memory()
> if ratelimit_reset() is accepted?

I do not know what ratelimit_reset is but if that is a new API for
a more reasonable ratelimiting then sure, I do not have any objections.
I have been objecting to one-off hacks to workaround problems of the
existing api.

--
Michal Hocko
SUSE Labs