Source-Changes-HG archive

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

[src/trunk]: src/sys/kern When clearing out the scheduler queues during syste...



details:   https://anonhg.NetBSD.org/src/rev/f5820a508dbf
branches:  trunk
changeset: 340948:f5820a508dbf
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Oct 13 00:25:51 2015 +0000

description:
When clearing out the scheduler queues during system shutdown, we move
all processes to the SSTOP state.  Make sure we update each process's
p_waited and the parents' p_nstopchild counters to maintain consistent
values.  Should not make any real difference this late in the shutdown
process, but we should still be consistent just in case.

Fixes PR kern/50318

Pullups will be requested for:

       NetBSD-7, -6, -6-0, -6-1, -5, -5-0, -5-1, and -5-2

diffstat:

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

diffs (33 lines):

diff -r 28abd9edeb38 -r f5820a508dbf sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Tue Oct 13 00:24:35 2015 +0000
+++ b/sys/kern/kern_synch.c     Tue Oct 13 00:25:51 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.308 2014/02/28 10:16:51 skrll Exp $   */
+/*     $NetBSD: kern_synch.c,v 1.309 2015/10/13 00:25:51 pgoyette 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.308 2014/02/28 10:16:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.309 2015/10/13 00:25:51 pgoyette Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -985,7 +985,13 @@
                        continue;
                }
 
-               p->p_stat = SSTOP;
+               if (p->p_stat != SSTOP) {
+                       if (p->p_stat != SZOMB && p->p_stat != SDEAD) {
+                               p->p_pptr->p_nstopchild++;
+                               p->p_waited = 0;
+                       }
+                       p->p_stat = SSTOP;
+               }
 
                LIST_FOREACH(l, &p->p_lwps, l_sibling) {
                        if (l == curlwp)



Home | Main Index | Thread Index | Old Index