aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/racct.h
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2016-04-07 04:23:25 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2016-04-07 04:23:25 +0000
commitae34b6ff96e7c0689c3da91f09fb57b34f06252c (patch)
tree38459686f8eedbb80701f99097b1b51ee3363aa8 /sys/sys/racct.h
parent6ed02c7b474bc73b4a644041ed4297b41752f31e (diff)
downloadsrc-ae34b6ff96e7c0689c3da91f09fb57b34f06252c.tar.gz
src-ae34b6ff96e7c0689c3da91f09fb57b34f06252c.zip
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
Notes
Notes: svn path=/head/; revision=297633
Diffstat (limited to 'sys/sys/racct.h')
-rw-r--r--sys/sys/racct.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/sys/racct.h b/sys/sys/racct.h
index 8d1f2fa2cec2..5330c637bf36 100644
--- a/sys/sys/racct.h
+++ b/sys/sys/racct.h
@@ -42,6 +42,7 @@
#include <sys/stdint.h>
#include <sys/sysctl.h>
+struct buf;
struct proc;
struct rctl_rule_link;
struct ucred;
@@ -71,7 +72,11 @@ struct ucred;
#define RACCT_SHMSIZE 18
#define RACCT_WALLCLOCK 19
#define RACCT_PCTCPU 20
-#define RACCT_MAX RACCT_PCTCPU
+#define RACCT_READBPS 21
+#define RACCT_WRITEBPS 22
+#define RACCT_READIOPS 23
+#define RACCT_WRITEIOPS 24
+#define RACCT_MAX RACCT_WRITEIOPS
/*
* Resource properties.
@@ -153,6 +158,7 @@ SYSCTL_DECL(_kern_racct);
int racct_add(struct proc *p, int resource, uint64_t amount);
void racct_add_cred(struct ucred *cred, int resource, uint64_t amount);
void racct_add_force(struct proc *p, int resource, uint64_t amount);
+void racct_add_buf(struct proc *p, const struct buf *bufp, int is_write);
int racct_set(struct proc *p, int resource, uint64_t amount);
void racct_set_force(struct proc *p, int resource, uint64_t amount);
void racct_sub(struct proc *p, int resource, uint64_t amount);
@@ -170,6 +176,7 @@ void racct_proc_exit(struct proc *p);
void racct_proc_ucred_changed(struct proc *p, struct ucred *oldcred,
struct ucred *newcred);
void racct_move(struct racct *dest, struct racct *src);
+void racct_proc_throttle(struct proc *p, int timeout);
#else