From owner-freebsd-current@FreeBSD.ORG Fri Aug 14 19:56:59 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2622106568C; Fri, 14 Aug 2009 19:56:59 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by mx1.freebsd.org (Postfix) with ESMTP id 36CCF8FC5A; Fri, 14 Aug 2009 19:56:58 +0000 (UTC) Received: by bwz19 with SMTP id 19so1750242bwz.37 for ; Fri, 14 Aug 2009 12:56:58 -0700 (PDT) Received: by 10.103.37.34 with SMTP id p34mr710958muj.84.1250279817921; Fri, 14 Aug 2009 12:56:57 -0700 (PDT) Received: from ?192.168.1.150? (93-40-132-223.ip38.fastwebnet.it [93.40.132.223]) by mx.google.com with ESMTPS id n7sm8308619mue.58.2009.08.14.12.56.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 Aug 2009 12:56:56 -0700 (PDT) From: Andrew Thompson To: Julian Elischer In-Reply-To: <4A85A387.1050705@elischer.org> X-Mailer: iPod Mail (7A341) References: <20090813073002.GA66860@citylink.fud.org.nz> <4A84452B.4070306@elischer.org> <1280352d0908140845j2709fdcfme317fab916606209@mail.gmail.com> <20090814155357.GA67039@citylink.fud.org.nz> <4A85A387.1050705@elischer.org> Message-Id: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (iPod Mail 7A341) Date: Fri, 14 Aug 2009 21:55:48 +0200 X-Mailman-Approved-At: Fri, 14 Aug 2009 21:07:55 +0000 Cc: Kostik Belousov , "current@freebsd.org" , Andrew Thompson , Hans Petter Selasky Subject: Re: usb kthreads X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 19:57:00 -0000 On 14/08/2009, at 19:48, Julian Elischer wrote: > Andrew Thompson wrote: >> Julian Elischer wrote: >>> Andrew Thompson wrote: >>>> Hi, >>>> >>>> >>>> Here is an aesthetic patch to change the usb kernel processes to >>>> threads, >>>> this hides them from the usual 'ps' output. Please test and review. >>>> >>>> ?1290 ??? ?DL ? ? 0:00.00 [usbus0] >>>> ?[lots and lots more...] >>>> ?1309 ??? ?DL ? ? 0:00.00 [usbus4] >>>> >>> use kproc_kthread_add() >>> to create a seoarate usb process and make all the threads belong to >>> that process. >>> (kproc_kthread_add() will create a new process the first time >>> and add more threads to it the more it is run.) >> Patch updated with the various feedback. >> PID TT STAT TIME COMMAND >> 0 ?? DLs 0:00.38 [kernel] >> 1 ?? ILs 0:00.01 /sbin/init -- >> 2 ?? DL 0:09.66 [g_event] >> 3 ?? DL 0:00.20 [g_up] >> 4 ?? DL 0:00.20 [g_down] >> ... >> 18 ?? DL 0:00.06 [acpi_thermal] >> 19 ?? DL 0:00.04 [usb] >> % procstat -t 19 >> PID TID COMM TDNAME CPU PRI STATE >> WCHAN 19 100040 usb usbus0 0 20 >> sleep - 19 100041 usb usbus0 >> 0 16 sleep - 19 100042 usb >> usbus0 0 20 sleep - 19 100043 >> usb usbus0 0 20 sleep - > > the thread names have full printf capability.. > how about giving them different names :-) usbus%d-%d Next job, I'll try to get this change in first.