Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Aug 2009 21:55:48 +0200
From:      Andrew Thompson <andy@fud.org.nz>
To:        Julian Elischer <julian@elischer.org>
Cc:        Kostik Belousov <kostikbel@gmail.com>, "current@freebsd.org" <current@freebsd.org>, Andrew Thompson <thompsa@FreeBSD.org>, Hans Petter Selasky <hselasky@c2i.net>
Subject:   Re: usb kthreads
Message-ID:  <F336B260-C2F8-4F27-BAF0-59C0FB4C83CA@fud.org.nz>
In-Reply-To: <4A85A387.1050705@elischer.org>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14/08/2009, at 19:48, Julian Elischer <julian@elischer.org> 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. 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F336B260-C2F8-4F27-BAF0-59C0FB4C83CA>