public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rüdiger Klaehn" <rudi@gamemakers.de>
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC,PATCH] dnotify: enhance or replace?
Date: Fri, 26 Mar 2004 10:52:57 +0100	[thread overview]
Message-ID: <4063FD79.2000901@gamemakers.de> (raw)
In-Reply-To: <1080202140.8108.101.camel@localhost.localdomain>

Alexander Larsson wrote:

[snip]
 >>About recursive notification:
 >>
 >>Some way to watch for changes on a whole file system is a must.
 >>Otherwise there is really no need to replace dnotify. When I start up
 >>KDE it watches for 256 different directories in my /home directory. It
 >>would probably watch even more directories if it could. With recursive
 >>watching it would only need to watch two or three directories 
recursively.
 >
 >
 > I see no reasons for a file manager to monitor all of $HOME, unless
 > you're showing all of it. Getting all the events for $HOME will just
 > cause things to be slower.
 >
I don't know why KDE does this. Probably because of the .desktop files.
   But I can see plenty of reasons to monitor large trees. For example to
keep some kind of metadata consistent with data.

What is everybodys obsession with file managers anyway? They are the
most *boring* application of an enhanced file change mechanism, and
certainly not the most demanding.

[snip]
 >>This would require large changes, and I think figuring out all aliases
 >>to a path might as well be done in userspace. You don't gain much by
 >>putting this in the kernel, and it requires a lot of complexity.
 >
 >
 > There is no sane way to do that in userspace. How would you find all the
 > aliases? traverse the whole filesystem?
  >
This would indeed be an expensive operation. You would need a mapping
from paths to inode numbers for the files you want to watch. If you just
want to watch for changes for a single file or a small subdirectory it
is not that bad though.

Want me to code this into my userspace tool to see what I mean? I am
100% certain it can be done as long as you have inode numbers or
something else to uniquely and persistently identify a file (as opposed
to the name of the file). Unfortunately inode numbers are not unique and
persistent on all file systems, but for e.g. ext3 it should be no problem.

  > What if a new alias was created?
 >
You would get an event. And the new alias would point to the same file.
No problem there.

 >
 >>>* Some way to get an event when the last open fd to the file is closed
 >>>after a file change. This means you won't get hundreds of write events
 >>>for a single file change. (Of course, you won't catch writes to e.g.
 >>>logs which aren't closed, so this has to be optional. But for a desktop,
 >>>this is often what you want.)
 >>>
 >>
 >>Should be no problem to add this with the current approach. But it is
 >>not that bad if you are getting hundreds of write events for a single
 >>file. They are just 32 bytes, so you can just throw them away in the
 >>userspace if you are not interested in them.
 >
 >
 > If you get a changed event for every write() to a file downloading to
 > the desktop then fam and the filemanager will use 100% cpu while
 > downloading. Been there, done that, added the rate limiter. However the
 > rate limiter doesn't fix the cpu use from just getting and ignoring all
 > the events.
 >
Strange. I have my userspace tool running on the first console. It is
watching for everything on "/" (throwing away most of it immediately). I
am downloading various stuff with mldonkey, playing an mp3 file with
xmms, and running a KDE session and mozilla.

My CPU load is at an average of 5%. (Athlon 2500+ with 512mb ram)

If the file manager insists on redrawing itself each time he gets a
write event, you would get 100% cpu. But such a braindead implementation
should not be blamed on the notification mechanism.

  parent reply	other threads:[~2004-03-26  9:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-24 14:17 [RFC,PATCH] dnotify: enhance or replace? Rüdiger Klaehn
2004-03-24 15:40 ` Alexander Larsson
2004-03-24 16:15   ` Rüdiger Klaehn
     [not found]     ` <1080202140.8108.101.camel@localhost.localdomain>
2004-03-26  9:52       ` Rüdiger Klaehn [this message]
     [not found]       ` <4062C63F.6050907@gamemakers.de>
     [not found]         ` <1080219862.8108.138.camel@localhost.localdomain>
2004-03-26  9:59           ` Rüdiger Klaehn
2004-03-24 16:37   ` John McCutchan
2004-03-24 16:54     ` Rüdiger Klaehn
2004-03-24 19:53       ` John McCutchan
2004-03-24 20:00         ` Paul Rolland
2004-03-24 20:04         ` viro
2004-03-26 10:12           ` Rüdiger Klaehn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4063FD79.2000901@gamemakers.de \
    --to=rudi@gamemakers.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rudi@lambda-computing.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox