Re: [PATCH] inotify to minimize stat() calls
- From
Thomas Rast <trast@inf.ethz.ch>
- Date
- Apr 25, 2013, 19:59 UTC
- Message-ID
- <87bo92nzzi.fsf@hexa.v.cablecom.net>
- In-Reply-To
- <CAKXa9=rvDQ7DXwCiTp9PTc55gNTW2UDZ4auaYG5tbboomrDAGQ@mail.gmail.com>
Robert Zeh <robert.allan.zeh@gmail.com> writes:
Show 9 quoted lines
> On Thu, Apr 25, 2013 at 3:18 AM, Thomas Rast <trast@inf.ethz.ch> wrote: >> >> I don't get this bit. The lstat() are run over all files listed in the >> index. So shouldn't your daemon watch exactly those (or rather, all >> dirnames of such files)? > I believe that fill_directory is handling watching only files in the index. > I had some problems a while back when I was only watching the > directory with some of the inotify structures coming back empty, which > is why I started watching each individual file.
This probably doesn't scale well enough. For example on my system the maximum number of watches I can set[1] is 64k. linux.git contains 38k files and the total number of files in all repos of an android clone I have lying around is almost 300k.
Can you clarify what went wrong if you only watch directories? After all the events should be the same, except that you need to reassemble the actual filename from the 'name' field in inotify_event and the directory name associated with the watch descriptor.
I'll keep the rest of your mail for another reply ;-)
[1] /proc/sys/fs/inotify/max_user_watches
--
Thomas Rast
trast@{inf,student}.ethz.ch