public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] inotify 0.9
Date: Mon, 20 Sep 2004 16:16:58 -0400	[thread overview]
Message-ID: <cindco$ats$1@gatekeeper.tmr.com> (raw)
In-Reply-To: <1095352742.23385.148.camel@betsy.boston.ximian.com>

Robert Love wrote:
> On Thu, 2004-09-16 at 11:07 -0400, Bill Davidsen wrote:
> 
> 
>>Did you work for Microsoft? Bloat doesn't count? And is this going to be 
>>  low memory you pin? And is every file create or delete (or update of 
>>atime) going to blast this mess through cache looking for people to notify?
> 
> 
> No.  I suggest looking at the source.
> 
> We are pinning the very inodes we are using.  So,

Well, I guess I misread the intent, I was assuming an inode could be 
watched even if it wasn't (at the time of watch) being used. So while I 
may want to know when any inode in a directory is used, I don't 
particularly desire to have them all pinned in memory.

If you say that's the only way, then clearly only huge system will be 
able to do that type of monitoring.
> 
> 	(a) There is no cache effects because the inodes are already
> 	    in use.  So when you go to, say, write to a file the kernel
> 	    already has the inode handy, and we just check in O(1) to
> 	    see if the inode has a watcher on it.  We never walk a list
> 	    of inodes (why would you ever do that?  how would you do
> 	    that?).
> 	(b) Many of the pinned inodes are already in memory, cached,
> 	    since the probability of of used inodes and watched inodes
> 	    is high.  Right now, on a system without inotify, I have
> 	    60MB of inodes in memory.
> 	(c) The inodes are pinned to prevent races.  Or, don't even
> 	    look at it like this.  Just look at it as elevating the
> 	    ref count on the data structure while we are using it.

I'm not clear on what race you would get sending a notify to a user mode 
process that an inode had changed, but if you say there could be one I 
can't argue.
> 
> But here is the kicker: I don't think this pinning behavior is any
> different than dnotify.  So this is a total utter nonissue.

If you assume you are going to create the same resource demands doing 
one thing as another then it becomes a non-issue. I was suggesting that 
it would be desirable not to use as many resources.
> 
> 
>>>Older release notes:
>>>I am resubmitting inotify for comments and review. Inotify has
>>>changed drastically from the earlier proposal that Al Viro did not
>>>approve of. There is no longer any use of (device number, inode number)
>>>pairs. Please give this version of inotify a fresh view.
>>
>>We are hacking all over the kernel to save 4k in stack size and you want 
>>to pin up to 32MB?
> 
> 
> The 4K is 4K per process, and it is done not to save 4K once (or even
> 4K*number of processes) but because first order allocations (8KB on x86)
> become nontrivial as memory becomes fragmented.
> 
> I bet on most modern systems there is already much more than 32MB of
> inodes in memory, and you have to explicitly add watches anyhow.

If by modern you mean huge memory servers, you are right. If you mean 
modest desktops which might be able to identify problems by watching a 
set of inodes, I suspect the inode usage is lower.
> 
> 
>>If I were doing this, and I admit I may not understand all of the 
>>features, I would have a bitmap per filesystem of inodes being watched, 
>>and anything which did an action which might require notify would check 
>>the bit. If the bit were set the filesystem and inode info would be 
>>passed to user space which could do anything it wanted. Use of the 
>>netlink is an example of ways to do this.
> 
> 
> Race, race, race, if even possible to implement "a bitmap per filesystem
> of inodes" in a sane way.
> 
> 
>>Then the user program could do whatever it wanted in nice pageable 
>>space, allow as many watchers as it wished, and be flexible to anything 
>>a site wanted, scalable, could use semaphores, fifos, network 
>>monitoring, message queues... in other words low impact, scalable, and 
>>flexible.
> 
> 
> If you assume that you have to pin the inodes while you watch them (and
> you do), then inotify really is this minimum abstraction that you talk
> of.

As I said, if you assume pinning the inodes you can't make any 
significant reduction in memory use.
> 
> 
>>Feel free to tell me there is some urgent need for this feature to be 
>>present and fast, I learn new things every day.
> 
> 
> You act like file notification is something new.  Every operating system
> provides this feature.  Linux currently does, too: dnotify.
> 
> But dnotify sucks, and modern systems are hitting its numerous limits.
> So, enter inotify.

I guess all of us running laptops and the like with memory in MB rather 
then GB just aren't modern... the limit we hit is mostly memory size.

-- 
    -bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
  last possible moment - but no longer"  -me

  reply	other threads:[~2004-09-20 20:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-15 15:52 [RFC][PATCH] inotify 0.9 John McCutchan
2004-09-15 18:00 ` Robert Love
2004-09-16 15:07 ` Bill Davidsen
2004-09-16 16:27   ` Chris Friesen
2004-09-16 22:48     ` Bill Davidsen
2004-09-16 16:39   ` Robert Love
2004-09-20 20:16     ` Bill Davidsen [this message]
2004-09-20 21:05       ` Robert Love
2004-09-20 22:59         ` Bill Davidsen
2004-09-21  0:02           ` Robert Love
2004-09-16 16:46   ` Jan Kara
2004-09-16 22:34     ` Bill Davidsen
2004-09-16 22:57       ` David Lang
2004-09-16 23:22       ` Robert Love
2004-09-16 23:35         ` Alan Cox
2004-09-17  2:29           ` Robert Love
2004-09-17  3:08             ` Nicholas Miell
2004-09-17 14:39             ` Alan Cox
2004-09-17 15:48               ` Robert Love
2004-09-17 14:51                 ` Alan Cox
2004-09-17 15:55                   ` Robert Love

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='cindco$ats$1@gatekeeper.tmr.com' \
    --to=davidsen@tmr.com \
    --cc=linux-kernel@vger.kernel.org \
    /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