From owner-freebsd-current@FreeBSD.ORG Tue Oct 23 00:58:59 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BF9116A419 for ; Tue, 23 Oct 2007 00:58:59 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outN.internet-mail-service.net (outN.internet-mail-service.net [216.240.47.237]) by mx1.freebsd.org (Postfix) with ESMTP id DFEDC13C49D for ; Tue, 23 Oct 2007 00:58:58 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Mon, 22 Oct 2007 17:58:40 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (nat.ironport.com [63.251.108.100]) by idiom.com (Postfix) with ESMTP id 7203412679F; Mon, 22 Oct 2007 17:58:40 -0700 (PDT) Message-ID: <471D4758.2040209@elischer.org> Date: Mon, 22 Oct 2007 17:59:04 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Ivan Voras References: <471BDA2E.9040801@elischer.org> <471D34D8.8020009@elischer.org> <9bbcef730710221747w4d338e78mb9dbf5e2eb37908@mail.gmail.com> In-Reply-To: <9bbcef730710221747w4d338e78mb9dbf5e2eb37908@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: kthreads->kproc and back to kthread.. next patch 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: Tue, 23 Oct 2007 00:58:59 -0000 Ivan Voras wrote: > On 23/10/2007, Julian Elischer wrote: > >> If you wanted to limit CPU usage for a particular group of threads it >> may be worth grouping them into a process and then you could have >> some control over them with 'nice'. > > Kernel processes can be niced? Nice :) So, for example, in theory I > could renice a geli thread that I don't want to eat much of my CPU > from the userland? maybe bu from memory NICE doesn't actually affect real-time threads :-) so it'd require the process to voluntarily take itself out of that class. It was just a random example type thought.. no-one actually has a use for that yet. > >> The AIO threads need to be processes because each of them needs >> a different address space that can be hacked to cover the address space of the >> process they are working for. > > Ok, this is why we used kprocs for them... > >> The Idle threads couldbe in their own process so you can easily see how much cpu idle.. > >> There are many other reasons you may want to group kernel threads. >> for example a single process with all teh interrupt threads in it might >> be useful for accounting for interupts in some ways. > > So, mostly cosmetics :) emphasis on MOSTLY in my original patch 2 years ago I changes nearly all the users of kthread_create to use the new one and only a few things went on using kproc_create(). AIO was one, and there were a couple of others that I didn't trust, so I left them. > > (don't get me wrong, I have nothing against kthreads<->kprocs :) ) Alan Cox is here next to me and we are discussing whether all the threads that are in the kernel should be put under PID 0 and have it called "kernel" instead of "swapper". It's swapper thread would be called "swapper" however.