[lkml]   [2010]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [GIT PULL] notification tree - try 37!
[Adding linux-fsdevel here as well.]

On Tuesday 17 August 2010 10:09:50 Andreas Gruenbacher wrote:
> > > Q: What prevents the system from going out of memory when a listener
> > > decides to stop reading events or simply can't keep up? There doesn't
> > > seem to be a limit on the queue depth. Listeners currently need
> > > CAP_SYS_ADMIN, but somehow limiting the queue depth and throttling when
> > > things start to go bad still sounds like a reasonable thing to do,
> > > right?
> >
> > It's an interesting question and obviously one that I've thought about.
> > You remember when we talked previously I said the hardest part left was
> > allowing non-root users to use the interface. It gets especially
> > difficult when thinking about perm-events. I was specifically told not
> > to timeout or drop those. But when dealing with non-root users using
> > perm events? As for pure notification we can do something like inotify
> > does quite easily.
> >
> > I'm not certain exactly what the best semantics are for non trusted
> > users, so I didn't push any patches that way. Suggestions welcome :)
> The system will happily go OOM for trusted users and non-perm events if the
> listener doesn't keep up, so some throttling, dropping, or both needs to
> happen for non-perm events. This is the critical case. Doing what inotify
> does (queue an overflow event and drop further events) seems to make sense
> here.
> The situation with perm-events is less severe because the number of
> outstanding perm events is bounded by the number of running processes.
> This may be enough of a limit.
> I don't think we need to worry about perm-events for untrusted users. We
> can start supporting some kinds of non-perm-events for untrusted users
> later; this won't change the existing interface.

Another case where fanotify fails to generate useful events is when a listener
runs out of file descriptors; events will simply end up with fd == -EMFILE in
that case. I don't think this behavior is useful; instead, reading from the
fanotify file descriptor (he one returned by fanotify_init()) should fail to
give the listener a chance to react.


 \ /
  Last update: 2010-08-20 02:03    [W:0.210 / U:0.008 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site