FreeBSD Bugzilla – Attachment 151701 Details for
Bug 189870
[kernel] [patch] Bad CPU resource limit assumption in kern_racct.c
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for kern_racct.c that permits CPU limiting beyond 100%
kern_racct.c.patch (text/plain), 1.40 KB, created by
dustinwenz
on 2015-01-15 19:39:40 UTC
(
hide
)
Description:
Patch for kern_racct.c that permits CPU limiting beyond 100%
Filename:
MIME Type:
Creator:
dustinwenz
Created:
2015-01-15 19:39:40 UTC
Size:
1.40 KB
patch
obsolete
>--- /tmp/kern_racct.c 2015-01-07 15:47:00.315778120 -0600 >+++ /usr/src//sys/kern/kern_racct.c 2015-01-07 15:26:57.155841074 -0600 >@@ -26,11 +26,11 @@ > * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * >- * $FreeBSD$ >+ * $FreeBSD: releng/10.0/sys/kern/kern_racct.c 248298 2013-03-14 23:20:18Z trasz $ > */ > > #include <sys/cdefs.h> >-__FBSDID("$FreeBSD$"); >+__FBSDID("$FreeBSD: releng/10.0/sys/kern/kern_racct.c 248298 2013-03-14 23:20:18Z trasz $"); > > #include "opt_kdtrace.h" > #include "opt_sched.h" >@@ -498,16 +498,17 @@ > > /* > * There are some cases where the racct %cpu resource would grow >- * beyond 100%. >+ * beyond 100% per core. > * For example in racct_proc_exit() we add the process %cpu usage > * to the ucred racct containers. If too many processes terminated > * in a short time span, the ucred %cpu resource could grow too much. > * Also, the 4BSD scheduler sometimes returns for a thread more than >- * 100% cpu usage. So we set a boundary here to 100%. >+ * 100% cpu usage. >+ * So we set a sane boundary here to 100% * the maxumum number of CPUs. > */ > if ((resource == RACCT_PCTCPU) && >- (racct->r_resources[RACCT_PCTCPU] > 100 * 1000000)) >- racct->r_resources[RACCT_PCTCPU] = 100 * 1000000; >+ (racct->r_resources[RACCT_PCTCPU] > 100 * 1000000 * (int64_t)MAXCPU)) >+ racct->r_resources[RACCT_PCTCPU] = 100 * 1000000 * (int64_t)MAXCPU; > } > > static int
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 189870
: 151701