From owner-freebsd-current@FreeBSD.ORG Thu Aug 13 10:32:45 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 F14831065676 for ; Thu, 13 Aug 2009 10:32:45 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-vw0-f180.google.com (mail-vw0-f180.google.com [209.85.212.180]) by mx1.freebsd.org (Postfix) with ESMTP id B39918FC59 for ; Thu, 13 Aug 2009 10:32:45 +0000 (UTC) Received: by vws10 with SMTP id 10so590599vws.7 for ; Thu, 13 Aug 2009 03:32:45 -0700 (PDT) MIME-Version: 1.0 Sender: andy@fud.org.nz Received: by 10.220.74.85 with SMTP id t21mr946758vcj.115.1250159564922; Thu, 13 Aug 2009 03:32:44 -0700 (PDT) In-Reply-To: <20090813101044.GV1884@deviant.kiev.zoral.com.ua> References: <20090813073002.GA66860@citylink.fud.org.nz> <20090813082318.GP1884@deviant.kiev.zoral.com.ua> <1280352d0908130209m21ae1d48ud2881e84b5e18a78@mail.gmail.com> <20090813101044.GV1884@deviant.kiev.zoral.com.ua> Date: Thu, 13 Aug 2009 11:32:44 +0100 X-Google-Sender-Auth: 566e9c44eb3f167e Message-ID: <1280352d0908130332j1487ad09t79fe0e33433021ef@mail.gmail.com> From: Andrew Thompson To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: current@freebsd.org, 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: Thu, 13 Aug 2009 10:32:46 -0000 2009/8/13 Kostik Belousov : > On Thu, Aug 13, 2009 at 10:09:37AM +0100, Andrew Thompson wrote: >> 2009/8/13 Kostik Belousov >> > >> > On Thu, Aug 13, 2009 at 12:30:02AM -0700, Andrew Thompson wrote: >> > > Hi, >> > > >> > > >> > > Here is an aesthetic patch to change the usb kernel processes to thr= eads, >> > > this hides them from the usual 'ps' output. Please test and review. >> > > >> > > =A01290 =A0?? =A0DL =A0 =A0 0:00.00 [usbus0] >> > > =A0[lots and lots more...] >> > > =A01309 =A0?? =A0DL =A0 =A0 0:00.00 [usbus4] >> > > >> > > After the patch they can be seen as kernel threads. >> > > >> > > =A0 PID =A0 =A0TID COMM =A0 =A0 =A0 =A0 =A0 =A0 TDNAME =A0 =A0 =A0 = =A0 =A0 CPU =A0PRI STATE =A0 WCHAN >> > > =A0 =A0 0 100000 kernel =A0 =A0 =A0 =A0 =A0 swapper =A0 =A0 =A0 =A0 = =A0 =A00 =A0 68 sleep =A0 sched >> > > =A0 =A0 0 100009 kernel =A0 =A0 =A0 =A0 =A0 firmware taskq =A0 =A0 0= =A0 92 sleep =A0 - >> > > =A0 =A0 0 100020 kernel =A0 =A0 =A0 =A0 =A0 kqueue taskq =A0 =A0 =A0= 0 =A0 92 sleep =A0 - >> > > =A0 =A0 0 100021 kernel =A0 =A0 =A0 =A0 =A0 acpi_task_0 =A0 =A0 =A0 = =A00 =A0 92 sleep =A0 - >> > > =A0 =A0 0 100022 kernel =A0 =A0 =A0 =A0 =A0 acpi_task_1 =A0 =A0 =A0 = =A00 =A0 92 sleep =A0 - >> > > =A0 =A0 0 100023 kernel =A0 =A0 =A0 =A0 =A0 acpi_task_2 =A0 =A0 =A0 = =A00 =A0 92 sleep =A0 - >> > > =A0 =A0 0 100027 kernel =A0 =A0 =A0 =A0 =A0 thread taskq =A0 =A0 =A0= 0 =A0 92 sleep =A0 - >> > > =A0 =A0 0 100031 kernel =A0 =A0 =A0 =A0 =A0 bwi0 taskq =A0 =A0 =A0 = =A0 0 =A0 16 sleep =A0 - >> > > =A0 =A0 0 100032 kernel =A0 =A0 =A0 =A0 =A0 bwi0 taskq =A0 =A0 =A0 = =A0 0 =A0 16 sleep =A0 - >> > > =A0 =A0 0 100106 kernel =A0 =A0 =A0 =A0 =A0 usbus0 =A0 =A0 =A0 =A0 = =A0 =A0 0 =A0 20 sleep =A0 wmsg >> > > =A0 =A0 0 100107 kernel =A0 =A0 =A0 =A0 =A0 usbus0 =A0 =A0 =A0 =A0 = =A0 =A0 0 =A0 16 sleep =A0 wmsg >> > > =A0 =A0 0 100108 kernel =A0 =A0 =A0 =A0 =A0 usbus0 =A0 =A0 =A0 =A0 = =A0 =A0 0 =A0 20 sleep =A0 wmsg >> > > =A0 =A0 0 100109 kernel =A0 =A0 =A0 =A0 =A0 usbus0 =A0 =A0 =A0 =A0 = =A0 =A0 0 =A0 20 sleep =A0 wmsg >> > > =A0 =A0 [ ... ] >> > > =A0 =A0 0 100127 kernel =A0 =A0 =A0 =A0 =A0 usbus4 =A0 =A0 =A0 =A0 = =A0 =A0 0 =A0 20 sleep =A0 wmsg >> > > >> > Can you use this opportunity to change "wmsg" wait channel name >> > to something having "usb" in the name ? >> >> When the thread is idle this should be `-` ? > > Taskqueue loop uses "-" as a name for the wait channel used when no work = is > scheduled, see subr_taskqueue.c:404. > Since the usb thread also uses a taskqueue-like system I will make it the s= ame. Andrew