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

From: Michal Hocko
Date: Tue Mar 05 2019 - 07:57:28 EST

On Tue 05-03-19 10:23:03, Tetsuo Handa wrote:
> Also, both nopage_rs in warn_alloc() and oom_rs in oom_kill_process() are not
> working well. This is because ___ratelimit() function assumes that operations
> to be ratelimited complete fast enough to be able to repeat many times within
> a second. If one operation to be ratelimited takes many seconds (or even
> minutes), ___ratelimit() becomes always true and can not ratelimit at all.

And this is a fundamental problem of the ratelimiting and something to
think about and address. The underlying assumption of the ratelimit
implementation that the throttled operation is mostly too short to
consider is just wrong in this and potentially many other cases. Well
basically whenever the API is used for printing. So rather than working
around this and complicating the code around I would focus on making
ratelimit implementation more robust for long taking operations.
Michal Hocko