You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/arm_linux_page_size/_index.md
+25-29Lines changed: 25 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
-
title: Increasing Linux Kernel Page Size on Arm
2
+
title: Explore Performance Gains by Increasing the Linux Kernel Page Size on Arm
3
3
4
4
draft: true
5
5
cascade:
6
6
draft: true
7
7
8
8
minutes_to_complete: 30
9
9
10
-
who_is_this_for: This Learning Path is for developers who want to modify the Linux kernel page size on Arm-based systems to improve performance for memory-intensive workloads.
10
+
who_is_this_for: This is an introductory topic for developers who want to modify the Linux kernel page size on Arm-based systems to improve performance for memory-intensive workloads.
11
11
12
12
learning_objectives:
13
13
- Verify the current page size on your system.
@@ -16,20 +16,12 @@ learning_objectives:
16
16
- Revert to the default 4K page size kernel (optional).
17
17
18
18
prerequisites:
19
-
- Arm-based Linux system
20
-
- Ubuntu [20.04 LTS or newer](https://releases.ubuntu.com/20.04/)
21
-
- Debian [11 “Bullseye” or newer](https://www.debian.org/releases/bullseye/)
22
-
- CentOS [9 or newer](https://www.centos.org/download/)
19
+
- An Arm-based Linux system running Ubuntu, Debian, or CentOS.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/arm_linux_page_size/centos.md
+21-17Lines changed: 21 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,22 @@
1
1
---
2
-
title: Centos Page Size Modification
2
+
title: Change page size on CentOS
3
3
weight: 5
4
4
### FIXED, DO NOT MODIFY
5
5
layout: learningpathall
6
6
---
7
7
8
-
### Verify current page size
9
-
Verify you’re on a 4 KB pagesize kernel by entering the following commands:
8
+
Follow the steps below to install a 64K page size kernel on [CentOS 9 or newer](https://www.centos.org/download/).
9
+
10
+
## Verify the current page size
11
+
12
+
Verify you’re using a 4 KB pagesize kernel by entering the following commands:
10
13
11
14
```bash
12
15
getconf PAGESIZE
13
16
uname -r
14
17
```
15
-
The output should be similar to below -- the full kernel name may vary, but the first line should always be **4096**:
18
+
19
+
The output should be similar to below. The kernel flavor (the string after the version number) may vary, but the first line should always be 4096.
16
20
17
21
```output
18
22
4096
@@ -21,15 +25,15 @@ The output should be similar to below -- the full kernel name may vary, but the
21
25
22
26
The 4096 indicates the current page size is 4KB. If you see a value that is different, you are already using a page size other than 4096 (4K). On Arm systems, the valid options are 4K, 16K, and 64K.
23
27
24
-
###Install the kernel-64k package:
28
+
## Install the 64k kernel package:
25
29
26
-
Enter the below `dnf`command to install the 64k kernel:
30
+
Enter the command below to install the 64k kernel:
27
31
28
-
```bash
29
-
sudo dnf -y install kernel-64k
30
-
```
32
+
```bash
33
+
sudo dnf -y install kernel-64k
34
+
```
31
35
32
-
You should see a page or so of similar output ending with:
36
+
You should see a page of output ending with:
33
37
34
38
```output
35
39
...
@@ -40,32 +44,31 @@ Installed:
40
44
Complete!
41
45
```
42
46
43
-
### Set the kernel-64k as the default kernel and reboot
44
-
45
-
Enter the following to set the newly installed 64K kernel as default and reboot:
47
+
Enter the following to configure the 64K kernel as default and reboot:
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/arm_linux_page_size/debian.md
+27-12Lines changed: 27 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,30 @@
1
1
---
2
-
title: Debian Page Size Modification
2
+
title: Change page size on Debian
3
3
weight: 4
4
4
### FIXED, DO NOT MODIFY
5
5
layout: learningpathall
6
6
---
7
7
8
-
Debian does not provide a 64K kernel via apt, so you will need to compile it from source. There are two ways to do this: 1) download the source from the kernel.org website, or 2) use the Debian source package. This guide will use the Debian source package.
8
+
Follow the steps below to install a 64K page size kernel on [Debian 11 “Bullseye” or newer](https://www.debian.org/releases/bullseye/).
9
9
10
-
### Verify current page size
11
-
Verify you’re on a 4 KB pagesize kernel by entering the following commands:
10
+
Debian does not provide a 64K kernel package, so you will need to compile it from source.
11
+
12
+
There are two ways to do this:
13
+
- Download the source from kernel.org.
14
+
- Use the Debian source package.
15
+
16
+
The instructions below use the Debian source package.
17
+
18
+
## Verify the current page size
19
+
20
+
Verify you’re using a 4 KB pagesize kernel by entering the following commands:
12
21
13
22
```bash
14
23
getconf PAGESIZE
15
24
uname -r
16
25
```
17
-
The output should be similar to below -- the full kernel name may vary, but the first line should always be **4096**:
26
+
27
+
The output should be similar to below. The kernel flavor (the string after the version number) may vary, but the first line should always be 4096.
18
28
19
29
```output
20
30
4096
@@ -23,20 +33,20 @@ The output should be similar to below -- the full kernel name may vary, but the
23
33
24
34
The 4096 indicates the current page size is 4KB. If you see a value that is different, you are already using a page size other than 4096 (4K). On Arm systems, the valid options are 4K, 16K, and 64K.
25
35
26
-
###Install from Debian Source Package
36
+
## Install the Debian kernel source package
27
37
28
-
To install a 64K page size kernel via package manager, follow these steps:
38
+
Follow the steps below to install a 64K kernel using the Debian kernel source package.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/arm_linux_page_size/overview.md
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,32 @@ weight: 2
5
5
layout: learningpathall
6
6
---
7
7
8
-
## How the CPU Locates Your Data
8
+
## How does the CPU locate data in memory?
9
9
10
10
When your program asks for a memory address, the CPU doesn’t directly reach into RAM or swap space for it; that would be slow, unsafe, and inefficient.
11
11
12
-
Instead, it goes through the **virtual memory** system, where it asks for a specific chunk of memory called a **page**. Pages map virtual memory location to physical memory locations in RAM or swap space.
12
+
Instead, it goes through the virtual memory system, where it asks for a specific chunk of memory called a page. Pages map virtual memory locations to physical memory locations in RAM or swap space.
13
13
14
-
## What’s a Memory “Page”?
14
+
## What’s a memory page?
15
15
16
-
Think of your computer’s memory like a big sheet of graph paper. Each **page** is one square on that sheet. The **page table** is the legend that tells the computer which square (virtual address) maps to which spot in real RAM. On x86, 4K is the only pagesize option, but Arm-based systems allow you to set 4K, 16K, or 64K page sizes to fine tune performance of your applications. This tutorial only covers switching between 4K and 64K page sizes.
16
+
Think of your computer’s memory like a big sheet of graph paper. Each page is one square on that sheet. The page table is the legend that identifies which square (virtual address) maps to which spot in physical RAM. On x86, 4K is the only page size option, but Arm-based systems allow you to use 4K, 16K, or 64K page sizes to fine tune the performance of your applications.
17
17
18
+
This Learning Path explains how to switch between 4K and 64K pages on different Linux distributions.
18
19
19
-
## When to Choose Which
20
+
## How should I select the memory page size?
20
21
21
-
-**4 KB pages** are the safe, default choice. They let you use memory in small slices and keep waste low. Since they are smaller, you need more of them when handling larger memory footprint applications. This creates more overhead for the CPU to manage, but may be worth it for the flexibility. They are great for applications that need to access small bits of data frequently, like web servers or databases with lots of small transactions.
22
+
Points to consider when thinking about page size:
22
23
23
-
-**64 KB pages**shine when you work with big, continuous data—like video frames or large database caches—because they cut down on management overhead. They can waste more memory if you don’t use the whole page, but they can also speed up access times for large data sets.
24
+
-**4K pages**are the safe, default choice. They let you use memory in small slices and keep waste low. Since they are smaller, you need more of them when handling larger memory footprint applications. This creates more overhead for the operating system to manage, but it may be worth it for the flexibility. They are great for applications that need to access small bits of data frequently, like web servers or databases with lots of small transactions.
24
25
25
-
When rightsizing your page size, its important to **try both**under real-world benchmarking conditions, as it will depend on the data size and retrieval patterns of the data you are working with. In addition, the page size may need to be adjusted over time as the application, usage patterns, and data size changes. Althoug this tutorial only covers switching between 4K and 64K page sizes, you can see from the below table that in some cases, you may find a sweet spot in between 4K and 64K at a 16K page size:
26
+
-**64K pages**shine when you work with large, continuous data such as video frames or large database caches because they cut down on management overhead. They will use more memory if you don’t use the whole page, but they can also speed up access times for large data sets.
26
27
28
+
When selecting your page size, it's important to try both options under real-world conditions, as it will depend on the data size and retrieval patterns of the data you are working with.
29
+
30
+
In addition, the page size may need to be reviewed over time as the application, memory usage patterns, and data sizes may change.
|**Waste**| At most 4 KB unused per page | Up to 64 KB unused if not fully used |
34
41
35
-
##### Summary of page size differences
42
+
This Learning Path covers switching between 4K and 64K page sizes because these are supported by most Arm Linux distributions. In some cases, you may find that 16K page size is a sweet spot for your application, but Linux kernel, hardware, and software support is limited. One example of 16k page size is [Asahi Linux](https://asahilinux.org/).
36
43
37
44
## Experiment to see which works best for your workload
45
+
46
+
The best way to determine the impact of page size on application performance is to experiment with both options.
47
+
38
48
{{% notice Do not test on Production%}}
39
49
Modifying the Linux kernel page size can lead to system instability or failure. Perform testing in a non-production environment before applying to production systems.
40
50
{{% /notice %}}
41
51
42
-
This learning path will guide you how to change (and revert back) the page size, so you can begin experimenting to see which fits best. The steps to install the 64K page size kernel are different for each OS, so be sure to select the correct one.
43
-
52
+
Select the Arm Linux distribution you are using to find out how to install the 64K page size kernel.
0 commit comments