summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ufs
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2016-04-07 04:23:25 +0000
committertrasz <trasz@FreeBSD.org>2016-04-07 04:23:25 +0000
commit825d80e01c65efad6bfe7302038a657bbc08e06a (patch)
tree38459686f8eedbb80701f99097b1b51ee3363aa8 /sys/ufs/ufs
parentcc1aaf5a1a88524a7d9ff817b98dcfb66049f5f8 (diff)
downloadFreeBSD-src-825d80e01c65efad6bfe7302038a657bbc08e06a.zip
FreeBSD-src-825d80e01c65efad6bfe7302038a657bbc08e06a.tar.gz
Add four new RCTL resources - readbps, readiops, writebps and writeiops,
for limiting disk (actually filesystem) IO. Note that in some cases these limits are not quite precise. It's ok, as long as it's within some reasonable bounds. Testing - and review of the code, in particular the VFS and VM parts - is very welcome. MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5080
Diffstat (limited to 'sys/ufs/ufs')
-rw-r--r--sys/ufs/ufs/ufs_bmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 9819ef5..768298f 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/mount.h>
+#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/stat.h>
@@ -223,6 +224,13 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
vfs_busy_pages(bp, 0);
bp->b_iooffset = dbtob(bp->b_blkno);
bstrategy(bp);
+#ifdef RACCT
+ if (racct_enable) {
+ PROC_LOCK(curproc);
+ racct_add_buf(curproc, bp, 0);
+ PROC_UNLOCK(curproc);
+ }
+#endif /* RACCT */
curthread->td_ru.ru_inblock++;
error = bufwait(bp);
if (error) {
OpenPOWER on IntegriCloud