Date: Fri, 13 May 2005 14:09:36 -0400 From: Suleiman Souhlal <ssouhlal@FreeBSD.org> To: freebsd-arch@FreeBSD.org Subject: [PATCH] Allow watching of vnodes that reside on non-UFS filesystems with kqueue Message-ID: <A92C0100-DDBD-45E5-B268-6FEF6B192180@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
--Apple-Mail-2-261623109 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hello, The patch at http://people.freebsd.org/~ssouhlal/testing/kqueue- hooks-20050509.diff makes EVFILT_VNODE kqueue filters work on any filesystem, and not just UFS, like it currently does. It does this by moving all the knote activations into VOP hooks. This behavior can be overridden, for (remote) filesystems where change notifications might come in a different way. According to a benchmark that I ran, this does not degrade performance (probably because the knote() function doesn't get called unless someone is watching the particular vnode, resulting in one less mutex acquisition) when no one is watching a vnode. You can find the benchmark results attached to this mail. rwatson assured me that this patch does not conflict with OpenBSM/ audit, and that he thinks that it's a good idea because "it simplifies filesystems and centralizes more common functionalities neatly in VFS as vnode properties". jmg ok'd the kqueue changes in an earlier version of this patch (although not much as changed). jeff is "inclined to support this diff". Any comments/objections before I commit this to HEAD? Bye, --Apple-Mail-2-261623109 Content-Transfer-Encoding: 7bit Content-Type: text/plain; x-unix-mode=0644; name="kqueue-hooks-bench.txt" Content-Disposition: attachment; filename=kqueue-hooks-bench.txt WITHOUT PATCH: %bonnie -------Sequential Output-------- ---Sequential Input-- --Random-- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks--- Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU 100 32391 90.1 26732 25.1 35221 38.8 37788 99.7 252279 100.0 20044.2 141.0 4.578u 3.855s 0:18.31 45.9% 1+17k 5+2145io 0pf+0w 2583c/6246w %bonnie -------Sequential Output-------- ---Sequential Input-- --Random-- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks--- Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU 100 27349 76.9 29570 27.7 33273 36.1 38038 100.0 252489 100.0 19479.0 153.7 4.181u 4.288s 0:18.69 45.2% 1+18k 0+2123io 0pf+0w 2269c/8465w %bonnie . -------Sequential Output-------- ---Sequential Input-- --Random-- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks--- Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU 100 30758 85.0 27033 25.3 38829 40.8 37869 99.7 251386 100.0 19110.4 156.1 4.395u 4.005s 0:18.18 46.1% 1+19k 1+1975io 0pf+0w 2274c/8849w nyuu# foreach i ( 1 2 3 ) Foreach? make -j 3 buildworld NO_IPFILTER=1 > /dev/null foreach? end 8083.315u 1007.560s 1:22:00.50 184.7% 391+244k 27712+3447io 1412pf+0w 824029c/711750w 8097.046u 1004.605s 1:21:18.68 186.5% 391+246k 10537+3534io 1191pf+0w 831965c/695294w 8098.296u 1024.747s 1:22:37.83 184.0% 390+244k 12473+3442io 439pf+0w 951639c/698819w WITH PATCH: %bonnie -------Sequential Output-------- ---Sequential Input-- --Random-- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks--- Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU 100 34134 94.3 23748 22.3 37425 41.7 37570 99.6 246146 99.6 20500.4 158.7 4.407u 4.075s 0:18.49 45.8% 1+17k 2+2142io 0pf+0w 2560c/8476w %bonnie -------Sequential Output-------- ---Sequential Input-- --Random-- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks--- Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU 100 30574 85.3 30099 28.1 34008 37.9 37588 99.6 247798 99.6 20564.0 158.6 3.928u 4.571s 0:18.20 46.6% 1+19k 0+2112io 0pf+0w 2514c/8501w %bonnie -------Sequential Output-------- ---Sequential Input-- --Random-- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks--- Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU 100 34741 95.9 26694 24.9 37612 41.1 37028 99.6 247715 99.9 18901.3 152.2 4.306u 4.187s 0:18.00 47.1% 1+17k 0+2145io 0pf+0w 2565c/8312w nyuu# foreach i ( 1 2 3 ) foreach? make -j 3 buildworld NO_IPFILTER=1 > /dev/null foreach? end 8117.377u 1007.894s 1:22:32.11 184.2% 392+244k 29839+3465io 1641pf+0w 837875c/721285w 8104.076u 1026.791s 1:21:31.15 186.6% 391+244k 10513+3468io 1188pf+0w 826879c/703385w 8104.517u 1016.058s 1:21:32.08 186.4% 392+244k 9949+3453io 435pf+0w 825781c/700621w --Apple-Mail-2-261623109 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed -- Suleiman Souhlal | ssouhlal@vt.edu The FreeBSD Project | ssouhlal@FreeBSD.org --Apple-Mail-2-261623109--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A92C0100-DDBD-45E5-B268-6FEF6B192180>