Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265395AbUI0BRv (ORCPT ); Sun, 26 Sep 2004 21:17:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265477AbUI0BRv (ORCPT ); Sun, 26 Sep 2004 21:17:51 -0400 Received: from sigma957.CIS.McMaster.CA ([130.113.64.83]:508 "EHLO sigma957.cis.mcmaster.ca") by vger.kernel.org with ESMTP id S265395AbUI0BQB (ORCPT ); Sun, 26 Sep 2004 21:16:01 -0400 Subject: [RFC][PATCH] inotify 0.10.0 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 Content-Type: multipart/mixed; boundary="=-UmF7KCp6Awa/sSHhxidn" Message-Id: <1096250524.18505.2.camel@vertex> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sun, 26 Sep 2004 22:02:04 -0400 X-PMX-Version-Mac: 4.7.0.111621, Antispam-Engine: 2.0.0.0, Antispam-Data: 2004.9.26.0 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: 66320 Lines: 985 --=-UmF7KCp6Awa/sSHhxidn Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, Announcing the release of inotify 0.10.0. Attached is a patch to 2.6.8.1. --New in this version-- -code cleanup (rml) -fix an OOPS when events where queued (me) -cleaned up the events (me) - remove IN_CREATE, IN_DELETED, IN_RENAME and IN_MOVE - added IN_CREATE_SUBDIR, IN_CREATE_FILE, IN_DELETE_SUBDIR, IN_DELETE_FILE, IN_DELETE_SELF, IN_MOVED_FROM and IN_MOVED_TO -added a cookie field to the event structure to pair MOVED_FROM/MOVED_TO -misc fixes (me) -added description of inotify events to the release notes (me) -updated inotify-utils to work with this version (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 watcher 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_watcher structure to the inodes list of watchers. 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_watcher 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 - Sent when file is closed 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 watcher on each inode the UNMOUNT and IGNORED event removes the watcher structures from each instance of the device driver and each inode. unref's the inode. --=-UmF7KCp6Awa/sSHhxidn Content-Disposition: attachment; filename=inotify-0.10.0.diff Content-Type: text/x-patch; name=inotify-0.10.0.diff; charset=UTF-8 Content-Transfer-Encoding: base64 LS0tIGNsZWFuL2xpbnV4L2RyaXZlcnMvY2hhci9pbm90aWZ5LmMJMTk2OS0xMi0zMSAxOTowMDow MC4wMDAwMDAwMDAgLTA1MDANCisrKyBsaW51eC9kcml2ZXJzL2NoYXIvaW5vdGlmeS5jCTIwMDQt MDktMjQgMTc6NDQ6MTQuMDAwMDAwMDAwIC0wNDAwDQpAQCAtMCwwICsxLDEwODIgQEANCisvKg0K KyAqIElub2RlIGJhc2VkIGRpcmVjdG9yeSBub3RpZmljYXRpb25zIGZvciBMaW51eC4NCisgKg0K KyAqIENvcHlyaWdodCAoQykgMjAwNCBKb2huIE1jQ3V0Y2hhbg0KKyAqDQorICogVGhpcyBwcm9n cmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0I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Ar PSBtZW0ubyByYW5kb20ubyB0dHlfaW8ubyBuX3R0eS5vIHR0eV9pb2N0bC5vIHB0eS5vIG1pc2Mu byBpbm90aWZ5Lm8NCiANCiBvYmotJChDT05GSUdfVlQpCQkrPSB2dF9pb2N0bC5vIHZjX3NjcmVl bi5vIGNvbnNvbGVtYXAubyBcDQogCQkJCSAgIGNvbnNvbGVtYXBfZGVmdGJsLm8gc2VsZWN0aW9u Lm8ga2V5Ym9hcmQubw0K --=-UmF7KCp6Awa/sSHhxidn Content-Disposition: attachment; filename=inotify-0.10.tar.gz Content-Type: application/x-compressed-tar; name=inotify-0.10.tar.gz Content-Transfer-Encoding: base64 H4sIAC9gVEEAA+0Za2/iRjBf8a9Ycc0J0gTshId0XE7iwLlDJdACuejaqyxjr2EVY1M/4NJT/ntn d/0GQ6/NQ1UZKYDnvbMzs7MOsWyPGPdnYkUSq0dPAyJAs16n31KzLia/QziSROm8LjaAIh2xn9IR qj+RPynwXU91EDryvOlOvn30cCHh938ESHL/r9U7bBATP7INGo9GrZa7/zW+/5LYbJ5LjSbsf02q XxyhZwni/3z/O53LmaYJnat++8P48uxWNU10NhPGo874MsgNxcOuV9FQ+Oh7xHQrmiBU7Ir2Rij8 UOp0ygg+mY4yOtPQD28FATS9QUkVgpB8epPRZ6d4K/am3t386MzOWNNMrFrgn7NAZwY6AZaTylS9 S3O9dPxfGlL1n9nhx7Kxp/4bYu086P/1ZqPWgPqv15u1Q/0/B7wilmb6OkZvXU8ndmX+TkihTDLN 4hxizTK4e7fq3S+xu4mG6HpprKFZnplG+RYBU5vCxNayrEwnNrHGtMaEYtV3narraFWTWP7XaoCP nlhiV+ZFENHhjLMwavf7ynV7/BMSvxoB0A7lIXuJLUXHK1QqC9+EAkUZeksQCoaOLhm1VKwCPdRa PEVDZdQdDvqfy5SNGKgErG+RWEYgX1hix7EdVCoy0S8p2S9JYdBeBA2FB1DiYM93LGb4gbulmbaL uV/cpcg7J7SKSg7oYIzUhXJ5ixMxdYs5h1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V8Sw4EKMFCVsDDeTXn+sfIzuyZuU 7xtPW/9oWmzlTm+tvzH2tP7tnNDac661co6V1p4Wz1AB1+aFvpV9/wAdXXiFLZ0YT9WGt9Y/f+H7 aDb21L8kXkjR+7/z5jmt/4tm81D/zwGH93+p93+xvsxZWOTD20IlFi9X1Zlpp0EnOYGHVd7LQlrK pa0vBuOLDZu6Eu2KtouiJ8HsHXpJR7MNhvMMQ05TNPhgnehWDFNINCAjOdmzm9ZLJ+YBngVS/X8k t7vX8qPb2Df/XYjNqP836/T//xc18fzQ/58D0m3uN23+OyIuXD5dsliaGEH7d1TnHhm2g+hUAK0/ nNcqqX/nBlIqk1KXS5NoqkdsSxAmNvJdjLw5cKyJN0cwVC1w9Q6a7L3tIwvD4OXR/93CRpgmmqkL YgnrOdHmSFMtNMVo5qjTKXAZjr0APZhrQNrKRS52VtipHLrVAQ5wgAN8L/wFqCcPFgAoAAA= --=-UmF7KCp6Awa/sSHhxidn-- - 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/