Re: [PATCH v5 0/2] printk: Console owner and waiter logic cleanup

From: Tejun Heo
Date: Wed Jan 10 2018 - 17:45:02 EST


Hello, Steven.

On Wed, Jan 10, 2018 at 02:44:55PM -0500, Steven Rostedt wrote:
> Yes, there can be the case that printks are added via an interrupt, but
> then again, it's an issue that a single CPU. And printks from interrupt
> context should be considered critical, part of the ASAP category. If
> they are not critical, then they shouldn't be doing printks. That may
> be a place were we can add a "printk_delay", for things like non
> critical printks in interrupt context, that can trigger offloading?

Ideally, if we can annoate all those, that would be great. I don't
feel too confident about that tho. Here is one network driver that we
deal with often.

$ wc -l $(git ls-files drivers/net/ethernet/mellanox/mlx5) | tail -1
48029 total

It's close to 50k lines of code and AFAICT this seems to be the trend.
Most things which are happening in the driver are complicated and
sometimes lead to surprising behaviors. With memory allocation
failures thrown in, idk.

I think our exposure to this sort of problem is pretty wide and we
can't reasonably keep close eyes on them, especially for problems
which only happen under high stress conditions which aren't tested
that easily.

> > Oh yeah, sure. It might actually be pretty simple to combine into
> > your solution. For example, can't we just always make sure that
> > there's at least one sleepable context which participates in your
> > pingpongs, which only kicks in when a particular context is trapped
> > too long?
>
> The solution can be extended to that if the need exists, yes.

I think it'd be really great if the core code can protect itself
against these things going haywire. We can ignore messages generated
while being recursive from netconsole, but that would mean, for
example, if that giant driver messes up in that path (netconsole under
memory pressure), it'd be painful to debug. So, if we can, it'd be
really great to have a generic protection which can handle these
situations.

Thanks.

--
tejun