Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265795AbUIOQAY (ORCPT ); Wed, 15 Sep 2004 12:00:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266611AbUIOPw5 (ORCPT ); Wed, 15 Sep 2004 11:52:57 -0400 Received: from sigma957.CIS.McMaster.CA ([130.113.64.83]:55758 "EHLO sigma957.cis.mcmaster.ca") by vger.kernel.org with ESMTP id S266534AbUIOPr2 (ORCPT ); Wed, 15 Sep 2004 11:47:28 -0400 Subject: [RFC][PATCH] inotify 0.9 From: John McCutchan To: linux-kernel@vger.kernel.org, nautilus-list@gnome.org, gamin-list@gnome.org, xml@ximian.com, viro@parcelfarce.linux.theplanet.co.uk, akpm@osdl.org, iggy@gentoo.org Content-Type: multipart/mixed; boundary="=-btTdkVmP474O7nbVHJk3" Message-Id: <1095263565.19906.19.camel@vertex> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 15 Sep 2004 11:52:45 -0400 X-PMX-Version-Mac: 4.7.0.111621, Antispam-Engine: 2.0.0.0, Antispam-Data: 2004.9.14.6 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: 54821 Lines: 792 --=-btTdkVmP474O7nbVHJk3 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, I am releasing a new version of inotify. Attached is a patch for 2.6.8.1. I am interested in getting inotify included in the mm tree. Inotify is designed as a replacement for dnotify. The key difference's are that inotify does not require the file to be opened to watch it, when you are watching something with inotify it can go away (if path is unmounted) and you will be sent an event telling you it is gone and events are delivered over a fd not by using signals. New in this version: Driver now supports reading more than one event at a time Bump maximum number of watches per device from 64 to 8192 Bump maximum number of queued events per device from 64 to 256 --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. 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. 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 [watcher 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). Aside from the inotify character device driver. The changes to the kernel are very minor. The first change is adding calls to inotify_inode_queue_event and inotify_dentry_parent_queue_event from the various vfs functions. This is identical to dnotify. The second change is more serious, it adds a call to inotify_super_block_umount inside generic_shutdown_superblock. What inotify_super_block_umount does is: 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. I have tested this code on my system for over three weeks now and have not had problems. I would appreciate design review, code review and testing. John --=-btTdkVmP474O7nbVHJk3 Content-Disposition: attachment; filename=inotify-0.9.patch Content-Transfer-Encoding: base64 Content-Type: text/x-patch; name=inotify-0.9.patch; charset=UTF-8 ZGlmZiAtdXJOIGxpbnV4LTIuNi44LjEvZHJpdmVycy9jaGFyL2lub3RpZnkuYyAuLi9saW51eC9k cml2ZXJzL2NoYXIvaW5vdGlmeS5jDQotLS0gbGludXgtMi42LjguMS9kcml2ZXJzL2NoYXIvaW5v dGlmeS5jCTE5NjktMTItMzEgMTk6MDA6MDAuMDAwMDAwMDAwIC0wNTAwDQorKysgLi4vbGludXgv ZHJpdmVycy9jaGFyL2lub3RpZnkuYwkyMDA0LTA5LTE1IDExOjIyOjU5LjAwMDAwMDAwMCAtMDQw MA0KQEAgLTAsMCArMSw5NzUgQEANCisvKg0KKyAqIElub2RlIGJhc2VkIGRpcmVjdG9yeSBub3Rp ZmljYXRpb25zIGZvciBMaW51eC4NCisgKg0KKyAqIENvcHlyaWdodCAoQykgMjAwNCBKb2huIE1j Q3V0Y2hhbg0KKyAqDQorICogVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4g cmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQNCisgKiB1bmRlciB0aGUgdGVybXMgb2Yg dGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieSB0aGUNCisgKiBG cmVlIFNvZnR3YXJ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ZSBJTk9USUZZX0RFQlVHX0FMTCAgICAweGZmZmZmZmZmDQorDQorLyogS2VybmVs IEFQSSAqLw0KKy8qIEFkZHMgZXZlbnRzIHRvIGFsbCB3YXRjaGVycyBvbiBpbm9kZSB0aGF0IGFy ZSBpbnRlcmVzdGVkIGluIG1hc2sgKi8NCit2b2lkIGlub3RpZnlfaW5vZGVfcXVldWVfZXZlbnQg KHN0cnVjdCBpbm9kZSAqaW5vZGUsIHVuc2lnbmVkIGxvbmcgbWFzaywgY29uc3QgY2hhciAqZmls ZW5hbWUpOw0KKy8qIFNhbWUgYXMgYWJvdmUgYnV0IHVzZXMgZGVudHJ5J3MgaW5vZGUgKi8NCit2 b2lkIGlub3RpZnlfZGVudHJ5X3BhcmVudF9xdWV1ZV9ldmVudCAoc3RydWN0IGRlbnRyeSAqZGVu dHJ5LCB1bnNpZ25lZCBsb25nIG1hc2ssIGNvbnN0IGNoYXIgKmZpbGVuYW1lKTsNCisvKiBUaGlz IHdpbGwgcmVtb3ZlIGFsbCB3YXRjaGVycyBmcm9tIGFsbCBpbm9kZXMgb24gdGhlIHN1cGVyYmxv Y2sgKi8NCit2b2lkIGlub3RpZnlfc3VwZXJfYmxvY2tfdW1vdW50IChzdHJ1Y3Qgc3VwZXJfYmxv Y2sgKnNiKTsNCisNCisjZW5kaWYNCisNCn== --=-btTdkVmP474O7nbVHJk3-- - 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/