Re: [RFC][PATCHv6 00/12] printk: introduce printing kernel thread

Tetsuo Handa
2018-01-11T11:14:30Z

Tejun Heo wrote:
> On Wed, Jan 10, 2018 at 07:08:30AM +0900, Tetsuo Handa wrote:
> > > * Netconsole tries to send out OOM messages and tries memory
> > > allocation which fails which then prints allocation failed messages.
> > > Because this happens while already printing, it just queues the
> > > messages to the buffer. This repeats.
> >
> > What? Does netconsole need to allocate memory when sending? I assume it does not.
>
> A lot of network drivers do, unfortunatley.
>

Excuse me, but can you show me an example of such traces?

Any path which are called from printk() must not (directly or indirectly)
depend on __GFP_DIRECT_RECLAIM && !__GFP_NORETRY memory allocation.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/mm/page_alloc.c?id=e746bf730a76fe53b82c9e6b6da72d58e9ae3565
If it depends on such memory allocation, it can cause OOM lockup.