diff options
-rw-r--r-- | usr/src/uts/common/fs/proc/prsubr.c | 7 | ||||
-rw-r--r-- | usr/src/uts/common/sys/thread.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/proc/prsubr.c b/usr/src/uts/common/fs/proc/prsubr.c index 8cda5f57b3..76a645f931 100644 --- a/usr/src/uts/common/fs/proc/prsubr.c +++ b/usr/src/uts/common/fs/proc/prsubr.c @@ -21,7 +21,7 @@ /* * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright 2017, Joyent, Inc. * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ @@ -162,6 +162,11 @@ prchoose(proc_t *p) continue; } + /* If this is a process kernel thread, ignore it. */ + if ((t->t_proc_flag & TP_KTHREAD) != 0) { + continue; + } + thread_lock(t); /* make sure thread is in good state */ switch (t->t_state) { default: diff --git a/usr/src/uts/common/sys/thread.h b/usr/src/uts/common/sys/thread.h index af68c16389..c742264b3c 100644 --- a/usr/src/uts/common/sys/thread.h +++ b/usr/src/uts/common/sys/thread.h @@ -405,6 +405,7 @@ typedef struct _kthread { #define TP_CHANGEBIND 0x1000 /* thread has a new cpu/cpupart binding */ #define TP_ZTHREAD 0x2000 /* this is a kernel thread for a zone */ #define TP_WATCHSTOP 0x4000 /* thread is stopping via holdwatch() */ +#define TP_KTHREAD 0x8000 /* in-kernel worker thread for a process */ /* * Thread scheduler flag (t_schedflag) definitions. |