2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-24 07:44:08 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-09 13:04:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-01-11 12:17:46 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
[PATCH] inotify
inotify is intended to correct the deficiencies of dnotify, particularly
its inability to scale and its terrible user interface:
* dnotify requires the opening of one fd per each directory
that you intend to watch. This quickly results in too many
open files and pins removable media, preventing unmount.
* 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.
* dnotify's interface to user-space is awful. Signals?
inotify provides a more usable, simple, powerful solution to file change
notification:
* inotify's interface is a system call that returns a fd, not SIGIO.
You get a single fd, which is select()-able.
* inotify has an event that says "the filesystem that the item
you were watching is on was unmounted."
* inotify can watch directories or files.
Inotify is currently used by Beagle (a desktop search infrastructure),
Gamin (a FAM replacement), and other projects.
See Documentation/filesystems/inotify.txt.
Signed-off-by: Robert Love <rml@novell.com>
Cc: John McCutchan <ttb@tentacle.dhs.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-12 17:06:03 -04:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
fs: scale files_lock
fs: scale files_lock
Improve scalability of files_lock by adding per-cpu, per-sb files lists,
protected with an lglock. The lglock provides fast access to the per-cpu lists
to add and remove files. It also provides a snapshot of all the per-cpu lists
(although this is very slow).
One difficulty with this approach is that a file can be removed from the list
by another CPU. We must track which per-cpu list the file is on with a new
variale in the file struct (packed into a hole on 64-bit archs). Scalability
could suffer if files are frequently removed from different cpu's list.
However loads with frequent removal of files imply short interval between
adding and removing the files, and the scheduler attempts to avoid moving
processes too far away. Also, even in the case of cross-CPU removal, the
hardware has much more opportunity to parallelise cacheline transfers with N
cachelines than with 1.
A worst-case test of 1 CPU allocating files subsequently being freed by N CPUs
degenerates to contending on a single lock, which is no worse than before. When
more than one CPU are allocating files, even if they are always freed by
different CPUs, there will be more parallelism than the single-lock case.
Testing results:
On a 2 socket, 8 core opteron, I measure the number of times the lock is taken
to remove the file, the number of times it is removed by the same CPU that
added it, and the number of times it is removed by the same node that added it.
Booting: locks= 25049 cpu-hits= 23174 (92.5%) node-hits= 23945 (95.6%)
kbuild -j16 locks=2281913 cpu-hits=2208126 (96.8%) node-hits=2252674 (98.7%)
dbench 64 locks=4306582 cpu-hits=4287247 (99.6%) node-hits=4299527 (99.8%)
So a file is removed from the same CPU it was added by over 90% of the time.
It remains within the same node 95% of the time.
Tim Chen ran some numbers for a 64 thread Nehalem system performing a compile.
throughput
2.6.34-rc2 24.5
+patch 24.9
us sys idle IO wait (in %)
2.6.34-rc2 51.25 28.25 17.25 3.25
+patch 53.75 18.5 19 8.75
So significantly less CPU time spent in kernel code, higher idle time and
slightly higher throughput.
Single threaded performance difference was within the noise of microbenchmarks.
That is not to say penalty does not exist, the code is larger and more memory
accesses required so it will be slightly slower.
Cc: linux-kernel@vger.kernel.org
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-18 04:37:38 +10:00
|
|
|
|
2012-06-24 09:56:45 +04:00
|
|
|
|
|
|
|
|
|
2009-12-16 04:53:03 -05:00
|
|
|
|
2015-08-06 15:46:20 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2011-07-26 16:09:06 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-12-04 15:47:36 -05:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-10 09:35:45 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-20 23:05:59 +04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-11-14 10:39:25 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-26 14:22:44 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-26 14:22:44 -07:00
|
|
|
|
2005-09-09 13:04:13 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2005-09-09 13:04:13 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-06 14:38:05 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-26 14:22:44 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
2014-06-06 14:38:05 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-09 13:04:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-02-14 20:41:04 -05:00
|
|
|
|
|
|
|
|
|
2008-02-15 14:37:26 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-14 10:39:18 +11:00
|
|
|
|
2010-10-26 14:22:44 -07:00
|
|
|
|
2013-02-14 20:41:04 -05:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 23:25:44 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
|
|
|
|
|
2005-06-23 00:09:50 -07:00
|
|
|
|
2007-10-16 23:26:19 -07:00
|
|
|
|
2013-02-14 20:41:04 -05:00
|
|
|
|
|
|
|
|
|
2005-06-23 00:09:50 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2011-02-04 18:13:24 +00:00
|
|
|
|
2013-02-14 20:41:04 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-07-26 00:39:17 -04:00
|
|
|
|
2005-06-23 00:09:50 -07:00
|
|
|
|
2009-02-06 13:52:43 -07:00
|
|
|
|
2014-03-03 09:36:58 -08:00
|
|
|
|
2006-03-23 03:01:03 -08:00
|
|
|
|
2005-06-23 00:09:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2010-10-26 14:22:44 -07:00
|
|
|
|
2006-03-07 21:55:35 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-02-14 20:41:04 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 23:31:13 -07:00
|
|
|
|
|
|
|
|
|
2014-10-12 14:29:29 -05:00
|
|
|
|
|
|
|
|
|
2007-10-16 23:31:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-08-09 00:52:35 +04:00
|
|
|
|
|
|
|
|
|
2007-10-16 23:31:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-14 20:41:04 -05:00
|
|
|
|
2012-09-12 20:11:55 -07:00
|
|
|
|
2007-10-16 23:31:13 -07:00
|
|
|
|
2009-08-09 00:52:35 +04:00
|
|
|
|
2013-03-01 19:48:30 -05:00
|
|
|
|
2009-08-09 00:52:35 +04:00
|
|
|
|
2014-02-11 18:37:41 -05:00
|
|
|
|
2015-04-04 01:14:53 -04:00
|
|
|
|
2014-02-11 17:49:24 -05:00
|
|
|
|
2014-02-11 18:37:41 -05:00
|
|
|
|
2015-04-04 01:14:53 -04:00
|
|
|
|
2014-02-11 17:49:24 -05:00
|
|
|
|
2007-10-16 23:31:13 -07:00
|
|
|
|
|
|
|
|
|
2010-11-02 10:13:07 -04:00
|
|
|
|
|
|
|
|
|
2009-08-08 23:56:29 +04:00
|
|
|
|
2007-10-16 23:31:13 -07:00
|
|
|
|
2009-12-16 12:43:11 -08:00
|
|
|
|
2007-10-16 23:31:13 -07:00
|
|
|
|
2010-05-26 15:13:55 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-05-26 15:13:55 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-12-08 02:36:35 -08:00
|
|
|
|
|
|
|
|
|
2013-06-13 23:37:49 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
[PATCH] inotify
inotify is intended to correct the deficiencies of dnotify, particularly
its inability to scale and its terrible user interface:
* dnotify requires the opening of one fd per each directory
that you intend to watch. This quickly results in too many
open files and pins removable media, preventing unmount.
* 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.
* dnotify's interface to user-space is awful. Signals?
inotify provides a more usable, simple, powerful solution to file change
notification:
* inotify's interface is a system call that returns a fd, not SIGIO.
You get a single fd, which is select()-able.
* inotify has an event that says "the filesystem that the item
you were watching is on was unmounted."
* inotify can watch directories or files.
Inotify is currently used by Beagle (a desktop search infrastructure),
Gamin (a FAM replacement), and other projects.
See Documentation/filesystems/inotify.txt.
Signed-off-by: Robert Love <rml@novell.com>
Cc: John McCutchan <ttb@tentacle.dhs.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-12 17:06:03 -04:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-03 12:13:08 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-10-31 23:28:30 +00:00
|
|
|
|
2013-09-22 16:27:52 -04:00
|
|
|
|
2008-10-31 23:28:30 +00:00
|
|
|
|
|
|
|
|
|
2011-03-16 22:48:43 -04:00
|
|
|
|
2013-09-22 16:27:52 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-03-16 18:17:54 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-03-16 18:17:54 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-10-02 02:17:15 -07:00
|
|
|
|
2010-11-02 10:13:07 -04:00
|
|
|
|
|
|
|
|
|
2014-03-14 12:02:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-08 02:36:35 -08:00
|
|
|
|
|
|
|
|
|
2013-03-01 19:48:30 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-08 14:24:16 -07:00
|
|
|
|
2012-06-24 09:56:45 +04:00
|
|
|
|
|
|
|
|
|
2013-07-08 14:24:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-24 09:56:45 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-20 08:44:39 -04:00
|
|
|
|
2012-06-24 09:56:45 +04:00
|
|
|
|
2010-05-26 15:13:55 -04:00
|
|
|
|
|
|
|
|
|
2012-06-24 09:56:45 +04:00
|
|
|
|
|
|
|
|
|
2013-06-14 21:09:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-08 14:24:15 -07:00
|
|
|
|
|
|
|
|
|
2013-09-11 14:24:34 -07:00
|
|
|
|
2013-07-08 14:24:15 -07:00
|
|
|
|
|
|
|
|
|
2012-06-24 09:56:45 +04:00
|
|
|
|
2013-07-08 14:24:16 -07:00
|
|
|
|
|
|
|
|
|
2013-10-20 08:44:39 -04:00
|
|
|
|
2012-06-24 09:56:45 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-26 15:13:55 -04:00
|
|
|
|
2012-06-24 09:56:45 +04:00
|
|
|
|
2010-05-26 15:13:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-07-26 00:39:17 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-06 15:46:20 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-12-10 09:35:45 -08:00
|
|
|
|
|
|
|
|
|
2015-08-06 15:46:20 -07:00
|
|
|
|
|
|
|
|
|
2008-12-10 09:35:45 -08:00
|
|
|
|
2015-08-06 15:46:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-10-26 14:22:44 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|