Re: [PATCH v7 1/4] ftrace: Implement fs notification for tracing_max_latency

Steven Rostedt
2019-10-02T22:50:47Z

On Thu, 3 Oct 2019 00:04:56 +0200
Viktor Rosendahl <viktor.rosendahl@gmail.com> wrote:

> > Can fsnotify() be called from irq context? If so, why have the work
> > queue at all? Just do the work from the irq_work handler.
> >
>
> fsnotify() might sleep. It calls send_to_group(), which calls
> inotify_handle_event() through a function pointer.
>
> inotify_handle_event() calls kmalloc() without the GFP_ATOMIC flag.
>
> There might be other reasons as well but the above is one that I have
> seen a warning for, when enabling CONFIG_DEBUG_ATOMIC_SLEEP and trying
> to call fsnotify() from an atomic context.

Thanks for the context. I wonder if we should add a "might_sleep()" to
fsnotify() then.

-- Steve