Re: [RESEND PATCH v7 1/8] kernfs: Introduce interface to access global kernfs_open_file_mutex.

From: Al Viro
Date: Wed Apr 06 2022 - 12:54:47 EST


On Wed, Apr 06, 2022 at 02:54:19PM +1000, Imran Khan wrote:

> > BTW, speaking of kernfs_notify() - can calls of that come from NMI handlers?
> > If not, I'd consider using llist for kernfs_notify_list...
>
> I see it gets invoked from 3 places only: cgroup_file_notify,
> sysfs_notify and sysfs_notify_dirent. So kernfs_notify should not be
> getting invoked in NMI context. I will make the llist transition in next
> version.

Er... Are you sure neither of those is ever called from something that is
called from .... from NMI?

It might never happen, but there's a plenty of callchains leading to that
thing and no obvious obstacles for some of those to come from NMI context;
I don't see it documented anywhere either.

Tejun, could you comment on that one?