为什么Linux(x86)的页面大小为4 KB,如何计算? [英] Why is the page size of Linux (x86) 4 KB, how is that calculated?

查看:114
本文介绍了为什么Linux(x86)的页面大小为4 KB,如何计算?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

x86架构上Linux内核的默认内存页面大小为4 KB,我想知道它是如何计算的,为什么?

The default memory page size of the Linux kernel on x86 architecture was 4 KB, I wonder how was that calculated, and why ?

推荐答案

默认页面大小由CPU的MMU(内存管理单元)支持的大小固定.在32位保护模式下,x86支持两种页面:

The default page size is fixed by what the MMU (memory management unit) of the CPU supports. In 32-bit protected mode x86 supports two kinds of pages:

  • 正常,4 KiB
  • 巨大的,4 MiB

并非所有x86处理器都支持大页面.一个人需要有一个具有页面大小扩展(PSE)功能的CPU.这不包括奔腾之前的处理器.实际上,当前所有的x86 CPU都可以实现它.

Not all x86 processors support large pages. One needs to have a CPU with Page Size Extension (PSE) capabilities. This excludes pre-Pentium processors. Virtually all current-generation x86 CPUs implements it.

4 KiB在其他体系结构中也是广泛流行的页面粒度.有人可能会说,这种大小是由于将32位虚拟地址划分为页面目录/表中的两个10位索引,其余12位给出了4 KiB页面大小.

4 KiB is widely popuplar page granularity in other architectures too. One could argue that this size comes from the division of a 32-bit virutal address into two 10-bit indexes in page directories/tables and the remaining 12 bits give the 4 KiB page size.

这篇关于为什么Linux(x86)的页面大小为4 KB,如何计算?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆