From owner-freebsd-hackers Mon Jul 17 13:52:30 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id 1DA0D37BFBB for ; Mon, 17 Jul 2000 13:52:25 -0700 (PDT) (envelope-from zzhang@cs.binghamton.edu) Received: from sol.cs.binghamton.edu (sol.cs.binghamton.edu [128.226.123.100]) by bingnet2.cc.binghamton.edu (8.9.3/8.9.3) with ESMTP id QAA24624 for ; Mon, 17 Jul 2000 16:52:21 -0400 (EDT) Date: Mon, 17 Jul 2000 16:50:02 -0400 (EDT) From: Zhihui Zhang To: freebsd-hackers@freebsd.org Subject: KLD, kernel threads, zone allocator Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I am writing a KLD that gives me kernel fault each time I run 'ps' command after 'make unload'. The KLD has a system call to create several kernel threads by calling kthread_create(). During unload, I set flags to each threads so that they will call exit1() upon wakeup (sleep on a timeout). Before the last thread calls exit1(), it wakeup the kld unload process so that make 'unload' can finish. Is there anything wrong or better solutions? I also use vm_zone to allocate some data structes within the KLD. When unloading, I can use zfree() to free them except the zone header that I can not free(some_zone, M_ZONE). This is because M_ZONE is defined as *static* in vm_zone.c I wonder if this will cause memory leak after several loading and unloading the KLD. Finally, I want to know how to save the panic screen without hand writing it down. Any info on debugging under db> after fault? Any help is appreciated. -Zhihui To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message