Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S269499AbUJFVIR (ORCPT ); Wed, 6 Oct 2004 17:08:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S269561AbUJFVIO (ORCPT ); Wed, 6 Oct 2004 17:08:14 -0400 Received: from sigma957.CIS.McMaster.CA ([130.113.64.83]:56722 "EHLO sigma957.cis.mcmaster.ca") by vger.kernel.org with ESMTP id S269499AbUJFVAd (ORCPT ); Wed, 6 Oct 2004 17:00:33 -0400 Subject: [RFC][PATCH] inotify 0.13.1 From: John McCutchan To: linux-kernel@vger.kernel.org, gamin-list@gnome.org, rml@ximian.com, viro@parcelfarce.linux.theplanet.co.uk, akpm@osdl.org, iggy@gentoo.org, ben@bagu.org Content-Type: multipart/mixed; boundary="=-uEh/5ByAyqC+VlGOK/tZ" Message-Id: <1097097180.12126.2.camel@vertex> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 06 Oct 2004 17:13:00 -0400 X-PMX-Version-Mac: 4.7.0.111621, Antispam-Engine: 2.0.1.0, Antispam-Data: 2004.10.6.1 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_VERSION 0, __SANE_MSGID 0' X-Spam-Flag: NO Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 73243 Lines: 1077 --=-uEh/5ByAyqC+VlGOK/tZ Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, Here is release 0.13.1 of inotify. Attached is a patch to 2.6.8.1 Forgot one patch in 0.13.0 so here is an updated diff. --New in this version-- -dnotify configurable (rml) -ioctl return val (rml) -locking (rml) -unsign nr_watches (rml) -fix deadlock (rml) -add CLOSE_WRITE/CLOSE_NOWRITE events (rml) -CLOSE_* events are delivered in all circumstances now (rml) (0.13.1) -fix MOVED_FROM filename bug (rml) -misc cleanups (rml,me) -MOVED_FROM/MOVED_TO cookie code (me) -inotify_inode_data uses slab cache (me) -clean up release notes (me) John McCutchan Release notes: --Why Not dnotify and Why inotify (By Robert Love)-- Everyone seems quick to deride the blunder known as "dnotify" and applaud a replacement, any replacement, man anything but that current mess, but in the name of fairness I present my treatise on why dnotify is what one might call not good: * dnotify requires the opening of one fd per each directory that you intend to watch. o The file descriptor pins the directory, disallowing the backing device to be unmounted, which absolutely wrecks havoc with removable media. o Watching many directories results in many open file descriptors, possibly hitting a per-process fd limit. * dnotify is directory-based. You only learn about changes to directories. Sure, a change to a file in a directory affects the directory, but you are then forced to keep a cache of stat structures around to compare things in order to find out which file. * dnotify's interface to user-space is awful. o dnotify uses signals to communicate with user-space. o Specifically, dnotify uses SIGIO. o But then you can pick a different signal! So by "signals," I really meant you need to use real-time signals if you want to queue the events. * dnotify basically ignores any problems that would arise in the VFS from hard links. * Rumor is that the "d" in "dnotify" does not stand for "directory" but for "suck." A suitable replacement is "inotify." And now, my tract on what inotify brings to the table: * inotify's interface is a device node, not SIGIO. o You open only a single fd, to the device node. No more pinning directories or opening a million file descriptors. o Usage is nice: open the device, issue simple commands via ioctl(), and then block on the device. It returns events when, well, there are events to be returned. o You can select() on the device node and so it integrates with main loops like coffee mixed with vanilla milkshake. * inotify has an event that says "the filesystem that the item you were watching is on was unmounted" (this is particularly cool). * inotify can watch directories or files. * The "i" in inotify does not stand for "suck" but for "inode" -- the logical choice since inotify is inode-based. --COMPLEXITY-- I have been asked what the complexity of inotify is. Inotify has 2 path codes where complexity could be an issue: Adding a watch to a device This code has to check if the inode is already being watched by the device, this is O(1) since the maximum number of devices is limited to 8. Removing a watch from a device This code has to do a search of all watches on the device to find the watch descriptor that is being asked to remove. This involves a linear search, but should not really be an issue because it is limited to 8192 entries. If this does turn in to a concern, I would replace the list of watches on the device with a sorted binary tree, so that the search could be done very quickly. The calls to inotify from the VFS code has a complexity of O(1) so inotify does not affect the speed of VFS operations. --MEMORY USAGE-- The inotify data structures are light weight: inotify watch is 40 bytes inotify device is 68 bytes inotify event is 272 bytes So assuming a device has 8192 watches, the structures are only going to consume 320KB of memory. With a maximum number of 8 devices allowed to exist at a time, this is still only 2.5 MB Each device can also have 256 events queued at a time, which sums to 68KB per device. And only .5 MB if all devices are opened and have a full event queue. So approximately 3 MB of memory are used in the rare case of everything open and full. Each inotify watch pins the inode of a directory/file in memory, the size of an inode is different per file system but lets assume that it is 512 byes. So assuming the maximum number of global watches are active, this would pin down 32 MB of inodes in the inode cache. Again not a problem on a modern system. On smaller systems, the maximum watches / events could be lowered to provide a smaller foot print. Keep in mind that this is an absolute worst case memory analysis. In reality it will most likely cost approximately 5MB. --HOWTO USE-- Inotify is a character device that when opened offers 2 IOCTL's. (It actually has 4 but the other 2 are used for debugging) INOTIFY_WATCH: Which takes a path and event mask and returns a unique (to the instance of the driver) integer (wd [watch descriptor] from here on) that is a 1:1 mapping to the path passed. What happens is inotify gets the inode (and ref's the inode) for the path and adds a inotify_watch structure to the inodes list of watches. If this instance of the driver is already watching the path, the event mask will be updated and the original wd will be returned. INOTIFY_IGNORE: Which takes an integer (that you got from INOTIFY_WATCH) representing a wd that you are not interested in watching anymore. This will: send an IGNORE event to the device remove the inotify_watch structure from the device and from the inode and unref the inode. After you are watching 1 or more paths, you can read from the fd and get events. The events are struct inotify_event. If you are watching a directory and something happens to a file in the directory the event will contain the filename (just the filename not the full path). -- EVENTS -- IN_ACCESS - Sent when file is accessed. IN_MODIFY - Sent when file is modified. IN_ATTRIB - Sent when file is chmod'ed. IN_CLOSE_WRITE - Sent when file is closed and was opened for writing. IN_CLOSE_NOWRITE - Sent when file is closed but was not opened for writing. IN_CLOSE - either of the two above events. IN_OPEN - Sent when file is opened. IN_MOVED_FROM - Sent to the source folder of a move. IN_MOVED_TO - Sent to the destination folder of a move. IN_DELETE_SUBDIR - Sent when a sub directory is deleted. (When watching parent) IN_DELETE_FILE - Sent when a file is deleted. (When watching parent) IN_CREATE_SUBDIR - Sent when a sub directory is created. (When watching parent) IN_CREATE_FILE - Sent when a file is created. (When watching parent) IN_DELETE_SELF - Sent when file is deleted. IN_UNMOUNT - Sent when the filesystem is being unmounted. IN_Q_OVERFLOW - Sent when your event queue has over flowed. The MOVED_FROM/MOVED_TO events are always sent in pairs. MOVED_FROM/MOVED_TO is also sent when a file is renamed. The cookie field in the event pairs up MOVED_FROM/MOVED_TO events. These two events are not guaranteed to be successive in the event stream. You must rely on the cookie to pair them up. (Note, the cookie is not sent yet.) If you aren't watching the source and destination folders in a MOVE. You will only get MOVED_TO or MOVED_FROM. In this case, MOVED_TO is equivelent to a CREATE and MOVED_FROM is equivelent to a DELETE. --KERNEL CHANGES-- inotify char device driver. Adding calls to inotify_inode_queue_event and inotify_dentry_parent_queue_event from VFS operations. Dnotify has the same function calls. The complexity of the VFS operations is not affected because inotify_*_queue_event is O(1). Adding a call to inotify_super_block_umount from generic_shutdown_superblock inotify_super_block_umount consists of this: find all of the inodes that are on the super block being shut down, sends each watch on each inode the UNMOUNT and IGNORED event removes the watch structures from each instance of the device driver and each inode. unref's the inode. --=-uEh/5ByAyqC+VlGOK/tZ Content-Disposition: attachment; filename=inotify-0.13.1.diff Content-Transfer-Encoding: base64 Content-Type: text/x-patch; name=inotify-0.13.1.diff; charset=UTF-8 LS0tIGNsZWFuL2xpbnV4L2RyaXZlcnMvY2hhci9pbm90aWZ5LmMJMTk2OS0xMi0zMSAxOTowMDow MC4wMDAwMDAwMDAgLTA1MDANCisrKyBsaW51eC9kcml2ZXJzL2NoYXIvaW5vdGlmeS5jCTIwMDQt MTAtMDYgMTY6Mjc6NTIuMDAwMDAwMDAwIC0wNDAwDQpAQCAtMCwwICsxLDk4MSBAQA0KKy8qDQor ICogSW5vZGUgYmFzZWQgZGlyZWN0b3J5IG5vdGlmaWNhdGlvbnMgZm9yIExpbnV4Lg0KKyAqDQor ICogQ29weXJpZ2h0IChDKSAyMDA0IEpvaG4gTWNDdXRjaGFuDQorICoNCisgKiBUa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UJPSAibGVhc2UtYnJlYWstdGltZSIsDQogCQkuZGF0YQkJPSAmbGVhc2Vf YnJlYWtfdGltZSwNCm== --=-uEh/5ByAyqC+VlGOK/tZ-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/