From owner-freebsd-bugs Sun Dec 23 13:42:47 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C227F37B416 for ; Sun, 23 Dec 2001 13:41:20 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBNLfK754270; Sun, 23 Dec 2001 13:41:20 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9D07B37B416 for ; Sun, 23 Dec 2001 13:38:06 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBNLc6m53871; Sun, 23 Dec 2001 13:38:06 -0800 (PST) (envelope-from nobody) Message-Id: <200112232138.fBNLc6m53871@freefall.freebsd.org> Date: Sun, 23 Dec 2001 13:38:06 -0800 (PST) From: Anders Nor Berle To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/33124: kthread_create doesnt mark kthreads as kthreads. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 33124 >Category: kern >Synopsis: kthread_create doesnt mark kthreads as kthreads. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 23 13:40:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Anders Nor Berle >Release: RELENG_4_4 >Organization: Amphibic Online >Environment: FreeBSD goliath.amphibic.net 4.4-RELEASE-p2 FreeBSD 4.4-RELEASE-p2 #1: Sun Dec 23 21:46:44 CET 2001 debolaz@goliath.amphibic.net:/usr/src/sys/compile/GOLIATH i386 >Description: When kthread_create spawns a kernel thread, it doesnt mark it with the flag P_KTHREADP which at least according to its description, should be used to mark kernel threads. >How-To-Repeat: Spawn a kthread and check for P_KTHREADP in p->p_flag. >Fix: This is submitted through the web interface and probably wont apply correctly, but it shows how to fix it. diff --recursive --show-c-function --unified src.old/sys/kern/kern_kthread.c src/sys/kern/kern_kthread.c --- src.old/sys/kern/kern_kthread.c Fri Jun 15 11:37:55 2001 +++ src/sys/kern/kern_kthread.c Sun Dec 23 21:12:51 2001 @@ -83,7 +83,7 @@ kthread_create(void (*func)(void *), voi *newpp = p2; /* this is a non-swapped system process */ - p2->p_flag |= P_INMEM | P_SYSTEM; + p2->p_flag |= P_INMEM | P_SYSTEM | P_KTHREADP; p2->p_procsig->ps_flag |= PS_NOCLDWAIT; PHOLD(p2); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message