From owner-freebsd-arch@FreeBSD.ORG Mon Jun 16 13:48:16 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9976BBEB for ; Mon, 16 Jun 2014 13:48:16 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D4E622FD for ; Mon, 16 Jun 2014 13:48:16 +0000 (UTC) Received: from Julian-MBP3.local (etroy.elischer.org [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s5GDm6JQ063859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 16 Jun 2014 06:48:08 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <539EF590.9050208@freebsd.org> Date: Mon, 16 Jun 2014 21:48:00 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Dheeraj Kandula , "freebsd-arch@freebsd.org" Subject: Re: Basic Question about Kernel Processes in FreeBSD. References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2014 13:48:16 -0000 On 6/16/14, 6:45 PM, Dheeraj Kandula wrote: > Hey All, > When I was reading through the FreeBSD kernel code came across the > function kproc_create. This function creates a kernel process. Isn't it? > > But at some places in the code, there is mention that the address space is > shared with proc0. read the man pages in section 9 man kproc_create and all the "see also" pointers. All kernel "processes" share the same address space.. that's why they are kernel processes :-) they do however have separate accounting and scheduling resources. there may be a number of kernel threads assigned to a simgle kernel process. We really only have kernel processes to help us 'group' the threads, since all kernel threads see the same address space. Origianlly we just had kernel threads (lots of them). Having kernel processes just allowed us to group them in 'top' for example. > > My Question: > Do all the kernel processes share the same address space. i.e. > even though they are multiple processes, they share the same kernel address > space. If so then why do we have kernel threads as threads are created in > the first place to share the address space of a process so that they are > light weight. > > Can someone shed some light on this. I am a bit confused about this. I > though that processes doesn't exist in kernel context and only user > processes existed. > > Dheeraj > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > >