summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2017-02-22 22:21:33 +0000
committerPatrick Mooney <pmooney@pfmooney.com>2020-05-14 01:57:00 +0000
commit4c819f48a094cdf29d044bcea57733ebac5f688f (patch)
tree678186474eb4917a170338fc189835910d4a3ebf
parent4c46c814833d7980b7ebf54590a97d7f91472bd5 (diff)
downloadillumos-joyent-4c819f48a094cdf29d044bcea57733ebac5f688f.tar.gz
12675 want kthread worker interface
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Bryan Cantrill <bryan@joyent.com> Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
-rw-r--r--usr/src/uts/common/fs/proc/prsubr.c7
-rw-r--r--usr/src/uts/common/sys/thread.h1
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.