From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 22 03:19:11 2014 Return-Path: Delivered-To: freebsd-hackers@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 C5474B2E for ; Mon, 22 Sep 2014 03:19:11 +0000 (UTC) Received: from ustc.edu.cn (email6.ustc.edu.cn [IPv6:2001:da8:d800::8]) by mx1.freebsd.org (Postfix) with ESMTP id 8856DE88 for ; Mon, 22 Sep 2014 03:19:09 +0000 (UTC) Received: from btw ( [58.211.218.74] ) by ajax-webmail-mailweb (Coremail) ; Mon, 22 Sep 2014 11:19:05 +0800 (CST) Date: Mon, 22 Sep 2014 11:19:05 +0800 (CST) From: btw@mail.ustc.edu.cn To: "Konstantin Belousov" Message-ID: <5002061.890581411355945170.JavaMail.coremail@mailweb> In-Reply-To: <20140921200401.GL2210@kib.kiev.ua> References: <20140921200401.GL2210@kib.kiev.ua> <1473289.768021411196850376.JavaMail.coremail@mailweb> Subject: Re: Re: What's the difference between kmem_arena and kernel_arena? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Originating-IP: [58.211.218.74] X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT_U3b build 111111(15684.4153.3993) Copyright (c) 2002-2014 www.mailtech.cn ustc-xl X-CM-TRANSID: yia_0ZDLcQEplR9UAKJKBA--.26007W X-CM-SenderInfo: xewzqzxdloh3xvwfhvlgxou0/1tbiAQUPAUqSOCfPMQACsx X-Coremail-Antispam: 1U50xBIdaVrnn0S07vEb7Iv0xC_Cr1lV2xY67kC6x804xJvcS sGvfC2KfnxnUU== Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 03:19:11 -0000 I got it! Thank you so much! ;-) -twb > -----Original E-mail----- > From: "Konstantin Belousov" > Sent Time: 2014-9-22 4:04:01 > To: btw@mail.ustc.edu.cn > Cc: freebsd-hackers@freebsd.org > Subject: Re: What's the difference between kmem_arena and kernel_arena? > > On Sat, Sep 20, 2014 at 03:07:30PM +0800, btw@mail.ustc.edu.cn wrote: > > Hi All, > > > > There are two similar variables declared in vm/vm_kern.h, they are kernel_arena > > and kmem_arena. Both of them are used in kmem_malloc(): > > > > rv = kmem_back((vmem == kmem_arena) ? kmem_object : kernel_object, > > > > I'm wondering what's the difference between them. Why both of them are needed? > > I have done a lot of searching, but I still can not find an answer. > > Look at their usage. > > kmem_arena is used for the kernel malloc() and page-sized uma allocations. > kernel_arena is used by miscellaneous other kernel needs, e.g. for > kernel stacks of threads, as the backing for kva_alloc() etc.