Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/racct.h
Show All 36 Lines | |||||
#define _RACCT_H_ | #define _RACCT_H_ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/stdint.h> | #include <sys/stdint.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
struct buf; | |||||
struct proc; | struct proc; | ||||
struct rctl_rule_link; | struct rctl_rule_link; | ||||
struct ucred; | struct ucred; | ||||
/* | /* | ||||
* Resources. | * Resources. | ||||
*/ | */ | ||||
#define RACCT_UNDEFINED -1 | #define RACCT_UNDEFINED -1 | ||||
Show All 13 Lines | |||||
#define RACCT_MSGQSIZE 13 | #define RACCT_MSGQSIZE 13 | ||||
#define RACCT_NMSGQ 14 | #define RACCT_NMSGQ 14 | ||||
#define RACCT_NSEM 15 | #define RACCT_NSEM 15 | ||||
#define RACCT_NSEMOP 16 | #define RACCT_NSEMOP 16 | ||||
#define RACCT_NSHM 17 | #define RACCT_NSHM 17 | ||||
#define RACCT_SHMSIZE 18 | #define RACCT_SHMSIZE 18 | ||||
#define RACCT_WALLCLOCK 19 | #define RACCT_WALLCLOCK 19 | ||||
#define RACCT_PCTCPU 20 | #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. | * Resource properties. | ||||
*/ | */ | ||||
#define RACCT_IN_MILLIONS 0x01 | #define RACCT_IN_MILLIONS 0x01 | ||||
#define RACCT_RECLAIMABLE 0x02 | #define RACCT_RECLAIMABLE 0x02 | ||||
#define RACCT_INHERITABLE 0x04 | #define RACCT_INHERITABLE 0x04 | ||||
#define RACCT_DENIABLE 0x08 | #define RACCT_DENIABLE 0x08 | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | |||||
SYSCTL_DECL(_kern_racct); | SYSCTL_DECL(_kern_racct); | ||||
#ifdef RACCT | #ifdef RACCT | ||||
int racct_add(struct proc *p, int resource, uint64_t amount); | 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_cred(struct ucred *cred, int resource, uint64_t amount); | ||||
void racct_add_force(struct proc *p, 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); | 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_set_force(struct proc *p, int resource, uint64_t amount); | ||||
void racct_sub(struct proc *p, int resource, uint64_t amount); | void racct_sub(struct proc *p, int resource, uint64_t amount); | ||||
void racct_sub_cred(struct ucred *cred, int resource, uint64_t amount); | void racct_sub_cred(struct ucred *cred, int resource, uint64_t amount); | ||||
uint64_t racct_get_limit(struct proc *p, int resource); | uint64_t racct_get_limit(struct proc *p, int resource); | ||||
uint64_t racct_get_available(struct proc *p, int resource); | uint64_t racct_get_available(struct proc *p, int resource); | ||||
void racct_create(struct racct **racctp); | void racct_create(struct racct **racctp); | ||||
void racct_destroy(struct racct **racctp); | void racct_destroy(struct racct **racctp); | ||||
int racct_proc_fork(struct proc *parent, struct proc *child); | int racct_proc_fork(struct proc *parent, struct proc *child); | ||||
void racct_proc_fork_done(struct proc *child); | void racct_proc_fork_done(struct proc *child); | ||||
void racct_proc_exit(struct proc *p); | void racct_proc_exit(struct proc *p); | ||||
void racct_proc_ucred_changed(struct proc *p, struct ucred *oldcred, | void racct_proc_ucred_changed(struct proc *p, struct ucred *oldcred, | ||||
struct ucred *newcred); | struct ucred *newcred); | ||||
void racct_move(struct racct *dest, struct racct *src); | void racct_move(struct racct *dest, struct racct *src); | ||||
void racct_proc_throttle(struct proc *p, int timeout); | |||||
#else | #else | ||||
static inline int | static inline int | ||||
racct_add(struct proc *p, int resource, uint64_t amount) | racct_add(struct proc *p, int resource, uint64_t amount) | ||||
{ | { | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |