Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Sep 2014 23:04:01 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        btw@mail.ustc.edu.cn
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: What's the difference between kmem_arena and kernel_arena?
Message-ID:  <20140921200401.GL2210@kib.kiev.ua>
In-Reply-To: <1473289.768021411196850376.JavaMail.coremail@mailweb>
References:  <1473289.768021411196850376.JavaMail.coremail@mailweb>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140921200401.GL2210>