From owner-freebsd-arch@FreeBSD.ORG Mon Jun 16 10:45:49 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 3F58782D for ; Mon, 16 Jun 2014 10:45:49 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D09B621E5 for ; Mon, 16 Jun 2014 10:45:48 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id k14so5299394wgh.18 for ; Mon, 16 Jun 2014 03:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=kkY5vjl01e4BQi7M/0RXAuChb4S3uuq2fXZ59dgUPYc=; b=nQ3jLIwsarE0d+7h36bwL5gQXmMo8ZxYl5gC7YXtMEc6sbMeTJiJVLDfXDD4KL+zLZ 6F5NEspsTo/FAsNj6rN5VahadRCZBCdFPw57DpUuy0cTZqFNPWHUXvAPvLLhY7pqc2sf Tm0WsTUwKasKZ1+qxQfqiIewPwpTgiZUfUwqi9uQfG80N1FXVf5FaE9qI1L9SyS9X877 /houhzPd4v50pTFYhj0OA+P8fpIG3ID96glagNyhqgj1ZLVwB2Q4QEYUCWmDu9mFzq8L w+mDCvE25HzO1NNB5o4cRlRyYNhq37tlswXFOGamua0WPRBbJVQyb6TxUBRuxzN8B13K +HVA== MIME-Version: 1.0 X-Received: by 10.180.206.132 with SMTP id lo4mr26325719wic.46.1402915547086; Mon, 16 Jun 2014 03:45:47 -0700 (PDT) Received: by 10.194.221.168 with HTTP; Mon, 16 Jun 2014 03:45:47 -0700 (PDT) Date: Mon, 16 Jun 2014 16:15:47 +0530 Message-ID: Subject: Basic Question about Kernel Processes in FreeBSD. From: Dheeraj Kandula To: "freebsd-arch@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 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 10:45:49 -0000 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. 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