From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 21 20:04:07 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 92E34CA8 for ; Sun, 21 Sep 2014 20:04:07 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 028B31B1 for ; Sun, 21 Sep 2014 20:04:06 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8LK41hF046148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 21 Sep 2014 23:04:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8LK41hF046148 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8LK41XT046147; Sun, 21 Sep 2014 23:04:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 21 Sep 2014 23:04:01 +0300 From: Konstantin Belousov To: btw@mail.ustc.edu.cn Subject: Re: What's the difference between kmem_arena and kernel_arena? Message-ID: <20140921200401.GL2210@kib.kiev.ua> References: <1473289.768021411196850376.JavaMail.coremail@mailweb> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ibvzjYYg+QDzMCy1" Content-Disposition: inline In-Reply-To: <1473289.768021411196850376.JavaMail.coremail@mailweb> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home 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: Sun, 21 Sep 2014 20:04:07 -0000 --ibvzjYYg+QDzMCy1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 20, 2014 at 03:07:30PM +0800, btw@mail.ustc.edu.cn wrote: > Hi All, >=20 > 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(): >=20 > rv =3D kmem_back((vmem =3D=3D kmem_arena) ? kmem_object : kernel_= object, >=20 > I'm wondering what's the difference between them. Why both of them are ne= eded? > 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. --ibvzjYYg+QDzMCy1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUHy8wAAoJEJDCuSvBvK1Bt98P/234wuuVkI7vVi/ah/Zsa+lb 8DBhRZ+9gBOZ75NRXN+PUO3mpRJch3xl61+AVO0B7B5Uqr79bQOHEffZ4oTXRUjB t7+6Ib9xB6VoOLflq5cEvRHvgZtbdaRACiSI6fGvMFlqSJa8rSG9L4ygUAWFMPz1 1N00qTe2GxWJsHhedJF6GWe2DZDdZ9IRgGOiQqW+ptThcozM7D6Q2OReHyebdTei Ea2ZNLXRIVYPzQ9YhgOnkbWLGW2mNVbMTSByqdsEBgUS9PfPlgz0VHAvh0MBy/b9 E0YUBztXKLu3h+HuKx98aDe8lwAgVA7R9aVxLyAFEfaL1g1ToSYrNqLyKlWDa5CX jhlUak3dopusF7UzDFkjPgagdnrfQY1ae4sID5HziU6QqAbYVWVoGJqtN5EhMFQn qulrBAam11yCNpx+WPSb2EbAy9YZ4azmOMOa88zWHtNQ/LJ5GPu0DdpmKElHxQUX /lip40XrcX0224Dguy7+eRFqpgl9/0v3onI6xxP0TstMtNYbWhTeMcd1emiyS/lo 56QnXR+fe40/5KCDJjy1dgQOvBl2YidgbEshFdhm74ZuPAXJepMNe/KgQ1zCCB54 OkUxU20DgMJblE+of/6zlSA15BeORwd8g9x/4DsJ1MKInmtNCnoOuBrR+u0t9BpF qY4ud/lKdzYb3DFlmb7L =iwRC -----END PGP SIGNATURE----- --ibvzjYYg+QDzMCy1--