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

From: Michal Hocko
Date: Thu Mar 21 2019 - 04:49:48 EST


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@xxxxxxxxxxxxxxxxxxx
> >> 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