Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jul 2024 22:02:37 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= <des@freebsd.org>
Cc:        Miroslav Lachman <000.fbsd@quip.cz>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: filemon
Message-ID:  <CANCZdfqzm=Rg3Ams%2B-TGWgm42oTsD0vx-TeYH9jcm7KuPVQJCg@mail.gmail.com>
In-Reply-To: <86jzh26793.fsf@ltc.des.dev>
References:  <ZqT6_a_0F8DCUsBm@int21h> <CAFDf7UKxhSu%2BqMGV1KahrSX9ho8vFut4avxNVX4D8QGa6%2B%2BTjQ@mail.gmail.com> <20240727170122.675f6bfe@ernst.home> <865xsn6ya9.fsf@ltc.des.dev> <a5471d18-7f88-4e24-8518-2c7a67ddd7f1@quip.cz> <CANCZdfoZ0Gy%2Bzq8YfmBYCgJPsWyxm-7bk0W0vTrzpwRts6vRgw@mail.gmail.com> <f36ffaf3-dbd2-4f9b-a27d-923fb4fcb3fb@quip.cz> <86jzh26793.fsf@ltc.des.dev>

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

[-- Attachment #1 --]
On Tue, Jul 30, 2024, 12:54 PM Dag-Erling Smørgrav <des@freebsd.org> wrote:

> Miroslav Lachman <000.fbsd@quip.cz> writes:
> > I'm a bit confused. If I understand it right, you say loader.conf
> > causes less memory fragmentation, but DES said "it still increases low
> > memory fragmentation". So what is true? And is this something to watch
> > out for, or is memory fragmentation not such a big deal?
>
> I used the wrong term.  The loader loads the kernel and modules into a
> particular region of memory, while modules loaded after boot can go
> anywhere.  Furthermore, modules loaded by the loader cannot be unloaded.
> So loading modules pre-boot does not increase fragmentation, but it uses
> up memory from a much more limited pool than loading them later.
>

Yea. The lower memory addresses used to matter a lot. Now, we don't have
floppies or devices that care <256MB. Some can only do DMA to < 4GB. So
unless you have a huge RAM dusk compiled in, you're not going to
meaningfully depleate the under 4GB.  And we don't treat that memory as
special for allocation so the modules loaded after boot could also wind up
there....

So it used to matter a lot. Now it's marginally relevant at best.

Warner

DES
> --
> Dag-Erling Smørgrav - des@FreeBSD.org
>

[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 30, 2024, 12:54 PM Dag-Erling Smørgrav &lt;<a href="mailto:des@freebsd.org">des@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Miroslav Lachman &lt;<a href="mailto:000.fbsd@quip.cz" target="_blank" rel="noreferrer">000.fbsd@quip.cz</a>&gt; writes:<br>
&gt; I&#39;m a bit confused. If I understand it right, you say loader.conf<br>
&gt; causes less memory fragmentation, but DES said &quot;it still increases low<br>
&gt; memory fragmentation&quot;. So what is true? And is this something to watch<br>
&gt; out for, or is memory fragmentation not such a big deal?<br>
<br>
I used the wrong term.  The loader loads the kernel and modules into a<br>
particular region of memory, while modules loaded after boot can go<br>
anywhere.  Furthermore, modules loaded by the loader cannot be unloaded.<br>
So loading modules pre-boot does not increase fragmentation, but it uses<br>
up memory from a much more limited pool than loading them later.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yea. The lower memory addresses used to matter a lot. Now, we don&#39;t have floppies or devices that care &lt;256MB. Some can only do DMA to &lt; 4GB. So unless you have a huge RAM dusk compiled in, you&#39;re not going to meaningfully depleate the under 4GB.  And we don&#39;t treat that memory as special for allocation so the modules loaded after boot could also wind up there....</div><div dir="auto"><br></div><div dir="auto">So it used to matter a lot. Now it&#39;s marginally relevant at best.</div><div dir="auto"><br></div><div dir="auto">Warner</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
DES<br>
-- <br>
Dag-Erling Smørgrav - des@FreeBSD.org<br>
</blockquote></div></div></div>
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqzm=Rg3Ams%2B-TGWgm42oTsD0vx-TeYH9jcm7KuPVQJCg>