On Wed, Jan 10, 2024 at 2:46 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > > On Wed, Jan 10, 2024 at 11:08:17AM +0200, Amir Goldstein wrote: > > My thoughts are that the optimization is clearly a win, but do we > > really want to waste a full long in super_block for counting access > > event watchers that may never exist? > > Would it make more sense for it to be global, Ironically, we once tried to disabled fsnotify hooks on pipefs and found out (the hard way) that some people are using IN_ACCESS event to get notified on pipe reads or something like that, so the global option may result in less predictable performance. > and perhaps even use the > static key infrastructure to enable/disable fsnotify? We are talking about disabling specific fsnotify hooks fsnotify_access() and fsnotify_perm(). I doubt that static key infrastructure is required, because with this patch, Jens did not observe any regression compared to the code being compiled out. Thanks, Amir.