Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/kern Pull up following revision(s) (requested by chri...



details:   https://anonhg.NetBSD.org/src/rev/e78448b50f97
branches:  netbsd-6
changeset: 774471:e78448b50f97
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Aug 19 17:36:41 2012 +0000

description:
Pull up following revision(s) (requested by christos in ticket #513):
        sys/kern/kern_synch.c: revision 1.303
PR/46811: Tetsua Isaki: Don't handle cpu limits when runtime is negative.

diffstat:

 sys/kern/kern_synch.c |  22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diffs (50 lines):

diff -r 69ed3ddb9e32 -r e78448b50f97 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Sat Aug 18 22:15:05 2012 +0000
+++ b/sys/kern/kern_synch.c     Sun Aug 19 17:36:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.297 2012/01/28 12:22:33 rmind Exp $   */
+/*     $NetBSD: kern_synch.c,v 1.297.2.1 2012/08/19 17:36:41 riz Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.297 2012/01/28 12:22:33 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.297.2.1 2012/08/19 17:36:41 riz Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -1204,6 +1204,16 @@
                /* Calculating p_pctcpu only for ps(1) */
                p->p_pctcpu = (p->p_pctcpu * ccpu) >> FSHIFT;
 
+               if (__predict_false(runtm < 0)) {
+                       if (!backwards) {
+                               backwards = true;
+                               printf("WARNING: negative runtime; "
+                                   "monotonic clock has gone backwards\n");
+                       }
+                       mutex_exit(p->p_lock);
+                       continue;
+               }
+
                /*
                 * Check if the process exceeds its CPU resource allocation.
                 * If over the hard limit, kill it with SIGKILL.
@@ -1227,13 +1237,7 @@
                        }
                }
                mutex_exit(p->p_lock);
-               if (__predict_false(runtm < 0)) {
-                       if (!backwards) {
-                               backwards = true;
-                               printf("WARNING: negative runtime; "
-                                   "monotonic clock has gone backwards\n");
-                       }
-               } else if (__predict_false(sig)) {
+               if (__predict_false(sig)) {
                        KASSERT((p->p_flag & PK_SYSTEM) == 0);
                        psignal(p, sig);
                }



Home | Main Index | Thread Index | Old Index