Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: Mikhail Krylov <sqarert@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: Determining the reason for reserved RAM
Date: Tue, 3 Jan 2023 21:51:08 +0300	[thread overview]
Message-ID: <Y7R5HAvVyoQr05NC@sqrt.uni.cx> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1177 bytes --]

Hello,

I was doing some research figuring out what kernel reserves memory for,
and found myself in a sort of dead-end.

I found out that /proc/kpageflags bit 32 is set for reserved physical
pages in include/linux/kernel-page-flags.c, wrote a simple decoder of
that file, and on an old 32-bit x86 machine (it's the simplest there,
since it has less memory and fewest amount of memory holes) those are
reserved:

0x00000000-0x0000ffff - I assume those addresses are used for interrupt
vectors and whatnot
0x0009b000-0x000fffff - Video RAM/ROM for VGA/EGA/CGA and whatnot
0x01c00000-0x01c1ffff - no idea, it also has KPF_UNCACHED flag as well
0x1d000000-0x1dd73fff - Kernel code, rodata, rwdata, bss
0x35b4a000-0x36b55fff - no idea.

I also found out that region #5 is getting bigger or smaller depending
on the machine's memory size. On this 1.5G machine it's a bit more than
16M. On a 32G machine it's more than 500M size, feels a bit wasteful
IMO. So my question is, could you tell me where to look for what those
regions are and why those regions exist?  I've checked /proc/iomem and
it doesn't say it is reserved or anything, just "System RAM".

Thanks in advance, Mikhail.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply	other threads:[~2023-01-04 17:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 18:51 Mikhail Krylov [this message]
2023-01-08  9:49 ` Determining the reason for reserved RAM Mikhail Krylov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7R5HAvVyoQr05NC@sqrt.uni.cx \
    --to=sqarert@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).