diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c index 5ba6773fcb93..081b312df576 100644 --- a/sys/kern/kern_racct.c +++ b/sys/kern/kern_racct.c @@ -267,9 +267,6 @@ racct_add_locked(struct proc *p, int resource, uint64_t amount) int error; #endif - if (p->p_flag & P_SYSTEM) - return (0); - SDT_PROBE(racct, kernel, rusage, add, p, resource, amount, 0, 0); /* @@ -344,9 +341,6 @@ void racct_add_force(struct proc *p, int resource, uint64_t amount) { - if (p->p_flag & P_SYSTEM) - return; - SDT_PROBE(racct, kernel, rusage, add_force, p, resource, amount, 0, 0); /* @@ -368,9 +362,6 @@ racct_set_locked(struct proc *p, int resource, uint64_t amount) int error; #endif - if (p->p_flag & P_SYSTEM) - return (0); - SDT_PROBE(racct, kernel, rusage, set, p, resource, amount, 0, 0); /* @@ -426,9 +417,6 @@ racct_set_force(struct proc *p, int resource, uint64_t amount) { int64_t diff; - if (p->p_flag & P_SYSTEM) - return; - SDT_PROBE(racct, kernel, rusage, set, p, resource, amount, 0, 0); /* @@ -487,9 +475,6 @@ void racct_sub(struct proc *p, int resource, uint64_t amount) { - if (p->p_flag & P_SYSTEM) - return; - SDT_PROBE(racct, kernel, rusage, sub, p, resource, amount, 0, 0); /* @@ -556,12 +541,6 @@ racct_proc_fork(struct proc *parent, struct proc *child) */ racct_create(&child->p_racct); - /* - * No resource accounting for kernel processes. - */ - if (child->p_flag & P_SYSTEM) - return (0); - PROC_LOCK(parent); PROC_LOCK(child); mtx_lock(&racct_lock); @@ -723,8 +702,6 @@ racctd(void) FOREACH_PROC_IN_SYSTEM(p) { if (p->p_state != PRS_NORMAL) continue; - if (p->p_flag & P_SYSTEM) - continue; microuptime(&wallclock); timevalsub(&wallclock, &p->p_stats->p_start); diff --git a/sys/kern/kern_rctl.c b/sys/kern/kern_rctl.c index 883fa307fabc..1d0a440da7a2 100644 --- a/sys/kern/kern_rctl.c +++ b/sys/kern/kern_rctl.c @@ -994,11 +994,6 @@ rctl_rule_add(struct rctl_rule *rule) case RCTL_SUBJECT_TYPE_PROCESS: p = rule->rr_subject.rs_proc; KASSERT(p != NULL, ("rctl_rule_add: NULL proc")); - /* - * No resource limits for system processes. - */ - if (p->p_flag & P_SYSTEM) - return (EPERM); rctl_racct_add_rule(p->p_racct, rule); /* @@ -1036,8 +1031,6 @@ rctl_rule_add(struct rctl_rule *rule) */ sx_assert(&allproc_lock, SA_LOCKED); FOREACH_PROC_IN_SYSTEM(p) { - if (p->p_flag & P_SYSTEM) - continue; cred = p->p_ucred; switch (rule->rr_subject_type) { case RCTL_SUBJECT_TYPE_USER: @@ -1284,10 +1277,6 @@ sys_rctl_get_racct(struct thread *td, struct rctl_get_racct_args *uap) error = EINVAL; goto out; } - if (p->p_flag & P_SYSTEM) { - error = EINVAL; - goto out; - } outputsbuf = rctl_racct_to_sbuf(p->p_racct, 0); break; case RCTL_SUBJECT_TYPE_USER: @@ -1719,20 +1708,7 @@ rctl_proc_fork(struct proc *parent, struct proc *child) LIST_INIT(&child->p_racct->r_rule_links); - /* - * No limits for kernel processes. - */ - if (child->p_flag & P_SYSTEM) - return (0); - - /* - * Nothing to inherit from P_SYSTEM parents. - */ - if (parent->p_racct == NULL) { - KASSERT(parent->p_flag & P_SYSTEM, - ("non-system process without racct; p = %p", parent)); - return (0); - } + KASSERT(parent->p_racct != NULL, ("process without racct; p = %p", parent)); rw_wlock(&rctl_lock);