From owner-svn-src-head@freebsd.org Fri Apr 1 17:28:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA3C7AE612D; Fri, 1 Apr 2016 17:28:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB19D1E0D; Fri, 1 Apr 2016 17:28:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u31HStcw032308; Fri, 1 Apr 2016 17:28:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u31HStG5032307; Fri, 1 Apr 2016 17:28:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201604011728.u31HStG5032307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Apr 2016 17:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297492 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 17:28:57 -0000 Author: trasz Date: Fri Apr 1 17:28:55 2016 New Revision: 297492 URL: https://svnweb.freebsd.org/changeset/base/297492 Log: Call rctl_enforce() in all cases the resource usage goes up, even when called from racct_*_force() functions. It makes the "log" and "devctl" actions work in those cases. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 1 17:21:55 2016 (r297491) +++ head/sys/kern/kern_racct.c Fri Apr 1 17:28:55 2016 (r297492) @@ -548,12 +548,10 @@ racct_add_locked(struct proc *p, int res PROC_LOCK_ASSERT(p, MA_OWNED); #ifdef RCTL - if (!force) { - error = rctl_enforce(p, resource, amount); - if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount); - return (error); - } + error = rctl_enforce(p, resource, amount); + if (error && !force && RACCT_IS_DENIABLE(resource)) { + SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount); + return (error); } #endif racct_adjust_resource(p->p_racct, resource, amount); @@ -670,9 +668,9 @@ racct_set_locked(struct proc *p, int res resource)); #endif #ifdef RCTL - if (!force && diff_proc > 0) { + if (diff_proc > 0) { error = rctl_enforce(p, resource, diff_proc); - if (error && RACCT_IS_DENIABLE(resource)) { + if (error && !force && RACCT_IS_DENIABLE(resource)) { SDT_PROBE3(racct, , rusage, set__failure, p, resource, amount); return (error);