Linuxカーネルはmemmap
パラメータ*)を使用して、さまざまなユースケースに合わせてメモリ領域を手動で指定します。
Q:違いは何ですか?予約済み記憶(memmap=nn[KMG]$ss[KMG]
)と保護されるメモリ(memmap=nn[KMG]!ss[KMG]
)?
つまり、カーネルはこれをどのように処理し、いつ使用されますか?
に関しては、予約されたメモリが保護されたメモリとしてリストされていると/proc/iomem
思います。そうですか?Reserved
RAM buffer
*) テキストでいっぱいではなく、リンク可能な良い参照ページが見つからなかったため、リンクを添付しました。カーネル文書:
memmap=exactmap [KNL,X86] Enable setting of an exact
E820 memory map, as specified by the user.
Such memmap=exactmap lines can be constructed based on
BIOS output or other requirements. See the memmap=nn@ss
option description.
memmap=nn[KMG]@ss[KMG]
[KNL] Force usage of a specific region of memory.
Region of memory to be used is from ss to ss+nn.
If @ss[KMG] is omitted, it is equivalent to mem=nn[KMG],
which limits max address to nn[KMG].
Multiple different regions can be specified,
comma delimited.
Example:
memmap=100M@2G,100M#3G,1G!1024G
memmap=nn[KMG]#ss[KMG]
[KNL,ACPI] Mark specific memory as ACPI data.
Region of memory to be marked is from ss to ss+nn.
memmap=nn[KMG]$ss[KMG]
[KNL,ACPI] Mark specific memory as reserved.
Region of memory to be reserved is from ss to ss+nn.
Example: Exclude memory from 0x18690000-0x1869ffff
memmap=64K$0x18690000
or
memmap=0x10000$0x18690000
Some bootloaders may need an escape character before '$',
like Grub2, otherwise '$' and the following number
will be eaten.
memmap=nn[KMG]!ss[KMG]
[KNL,X86] Mark specific memory as protected.
Region of memory to be used, from ss to ss+nn.
The memory region may be marked as e820 type 12 (0xc)
and is NVDIMM or ADR memory.
memmap=<size>%<offset>-<oldtype>+<newtype>
[KNL,ACPI] Convert memory within the specified region
from <oldtype> to <newtype>. If "-<oldtype>" is left
out, the whole region will be marked as <newtype>,
even if previously unavailable. If "+<newtype>" is left
out, matching memory will be removed. Types are
specified as e820 types, e.g., 1 = RAM, 2 = reserved,
3 = ACPI, 12 = PRAM.
ベストアンサー1
予約済みメモリは、何らかの理由でカーネルが通常のメモリとして使用できない、または使用しないでください。
保護済みメモリ(時々とも呼ばれる)継続的な記憶)は、再起動や停電時にも内容を保持することが保証されているメモリです。不揮発性DIMM(NVDIMM)または他の理由で。
e820 タイプ 12 は、ACPI 6.0 以前の一部のシステムで NVDIMM を表すために使用されているため、解釈することは困難です。保護/永久メモリただし、ACPI 6.0ではこれをタイプ7として定義し、タイプ12を「OEM予約」としてオーバーライドします。
カーネルのコメントアーチ/x86/include/asm/e820/types.h一部の以前のシステムでは、タイプ6を使用して保護/永続メモリを示していました。つまり、初期のNVDIMMサポートは、ACPI 6.0が新しい定義を提供するまで、ベンダーごとに混乱していました(そして、「この混乱に触れないでください」という意味で以前の定義を上書きしました)。 )。
Linuxは、設定されていない限り、e820タイプ12メモリの永続性機能を明らかに無視しますCONFIG_X86_PMEM_LEGACY=y
。