Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2007 19:39:43 +0100
From:      "Michael Schuh" <michael.schuh@gmail.com>
To:        freebsd-stable@freebsd.org, michael.schuh@gmail.com
Subject:   Re: another error with md malloc based fs
Message-ID:  <1dbad3150703231139t62a24bc1w616080b97f6b573c@mail.gmail.com>
In-Reply-To: <200703231626.l2NGQukl004840@lurza.secnetix.de>
References:  <1dbad3150703221655w62284ed7o8a5c7440aca45891@mail.gmail.com> <200703231626.l2NGQukl004840@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Oliver,
Hi @list,

yes that's exatly what i have in my mind,
after the explainings from Chuck.

thanks very much

cheers

michael


2007/3/23, Oliver Fromme <olli@lurza.secnetix.de>:
>
> Michael Schuh wrote:
> > Chuck Swiger wrote:
> > > Michael Schuh wrote:
> > > > i can't understand how malloc can eat all available
> > > > memory, i have 2Gigs of it ;-)
> > > > so it seems to me i know what i doing, if
> > > > i have 1,6 Gigs free Memory, and i say ok get me 750Megs from
> > > > my 1,6 Gigs of free Memory, what was faulty on that????
> > >
> > > The two choices involve a swap-based RAMdisk, which can use all of
> > > the available physical RAM it needs to, since this memory is
> > > swappable, or a kernel-memory-based RAMdisk, which uses wired-down
> > > memory from within the kernel.
> >
> > Ok, so that is it harder to understand for me in the first time,
> > if i understand it now right the swap or file based memory backend
> > is also in the ram, but it get another way managed from kernels vm.
> > the malloc based ramdisk get's not reallly managed by the kvm,
> > but it underlays under the paging and swapping, and also
> > ba the "thread-killer" there shot's thread down it it get's to much
> > work for the system....
> >
> > i hope i understand this right, it is important for me...
>
> Let me try to explain it with a little different words.
> The following is a bit simplified, but it should give
> you an idea about the advantages and disadvantages of
> each md disk type.
>
> First of all, _both_ "malloc" and "swap"-backed md disks
> are RAM disks.  You don't have to worry that a swap-backed
> md disk will be created on your swap partiton.  It's not.
> It will reside in RAM, just like a "malloc" md disk.
>
> However, the difference is that a malloc md disk uses
> memory from the KVM area (kernel virtual memory), which
> is hardwired into the RAM.  It cannot be paged, and it
> is taken from the kernel's own memory pool, which is
> usually much smaller than your total available RAM.
> It's taken from the same pool of RAM that's used for
> network buffers, driver data and similar things.
>
> On the other hand, "swap-backed" md disks use regular
> memory, so to speak, just like a normal user process.
> That also means that they are pageable, which means
> that they can be paged to swap if necessary (if the
> systems runs low on RAM).  That's what "swap-backed"
> means.  Because of that, they don't have a size limit
> (well, they shouldn't be bigger than your RAM + swap,
> of course).  If there is enough RAM, then they will
> stay completely in RAM and will _not_ touch your swap
> at all.
>
> For typical RAM disks, such as for /tmp, you should use
> a swap-backed md disk (it should be the default).  The
> "malloc" type should be used only for rather small,
> special uses.
>
> I hope it's now a little clearer.
>
> Best regards
>    Oliver
>
> --
> Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
> Handelsregister: Registergericht Muenchen, HRA 74606,  Gesch=E4ftsfuehrun=
g:
> secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M=FC=
n-
> chen, HRB 125758,  Gesch=E4ftsf=FChrer: Maik Bachmann, Olaf Erb, Ralf Geb=
hart
>
> FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd
>
> "[...]  one observation we can make here is that Python makes
> an excellent pseudocoding language, with the wonderful attribute
> that it can actually be executed."  --  Bruce Eckel
>



--=20
=3D=3D=3D michael-schuh.net =3D=3D=3D
Michael Schuh
Preu=DFenstr. 13
66111 Saarbr=FCcken
phone: 0681/8319664
mobil:   0177/9738644
@: michael.schuh@gmail.com

=3D=3D=3D Ust-ID: DE251072318 =3D=3D=3D



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