Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Enable 16 KB toggle
Stay organized with collections
Save and categorize content based on your preferences.
16 KB toggle lets you to try a 16 KB kernel. This toggle switches
between a 4 KB kernel and 16 KB kernel and can be found inside the
"Developer option" menu in the settings app. The 16 KB toggle can be used
to check application compatibility with the 16 KB kernel, but it might not
reflect performance of actual 16 KB device due to the use of subpage blocks
(when using EXT4 for /data
and /metadata
partitions) in 16 KB mode.
Steps for configuring toggle
Make sure the device has set up the variables to be page-agnostic (to work
with both 4 KB and 16 KB page size kernels).
You may want to install the 16k kernel directly to make sure the device works in
16 KB mode directly before continuing to add the developer option.
See the virtual device example target config.
PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO := true
PRODUCT_MAX_PAGE_SIZE_SUPPORTED := 16384
Setup product variable to display developer option in settings
PRODUCT_16K_DEVELOPER_OPTION := true
Set kernel path using BOARD_KERNEL_PATH_16K
.
This kernel should be built with CONFIG_ARM64_16K_PAGES=y.
BOARD_KERNEL_PATH_16K := kernel/prebuilts/mainline/$(TARGET_KERNEL_ARCH)/16k/kernel-mainline.
Set modules config path variable BOARD_KERNEL_MODULES_16K
. This variable
points to kernel modules which support 16KB. Setting these parameters creates
two OTAs on the system partition : boot_ota_16k.zip
(to switch to 16 KB
kernel) and boot_ota_4k.zip
(to switch to 4 KB kernel). Enable incremental
OTAs by setting BOARD_16K_OTA_USE_INCREMENTAL := true
for smaller size boot
OTAs.
BOARD_KERNEL_MODULES_16K += $(wildcard kernel/prebuilts/mainline/$(TARGET_KERNEL_ARCH)/16k/*.ko)
BOARD_KERNEL_MODULES_16K += $(wildcard kernel/prebuilts/common-modules/virtual-device/mainline/$(TARGET_KERNEL_ARCH)/16k/*.ko)
Set BOARD_16K_OTA_MOVE_VENDOR := true
to move OTAs to the vendor partition.
Only set this to move OTAs from system to vendor partition.
Verification
After successfully configuring the toggle, follow these steps:
- Check if Boot with 16 KB page size toggle is visible in settings app.
- Check if
/system/boot_otas
or /vendor/boot_otas
contains two OTA zip
files : boot_ota_16k.zip
and boot_ota_4k.zip
.
Use 16 KB toggle
- Go to Settings > System > Software updates and apply any updates which
are available.
- Enable developer options. For instructions, see Configure on-device developer options.
- If the device is detected as OEM locked, a dialog displays asking you to OEM
unlock the phone. For instructions, see Lock and unlock the bootloader.
- Click Boot with 16 KB page size. If
/data
and /metadata
aren't
ext4, a dialog displays asking you to wipe the device. Click
Erase all data to wipe the device. The device is wiped and you must
enable developer options again.
- Click Boot with 16 KB page size. A dialog displays asking you to
switch to 16 KB, and on confirming, boot OTAs are applied. You can then
toggle back and forth between 4 KB and 16 KB mode without clearing
the data partition to test app behavior.
Check 16 KB Mode
Follow steps at getting page size
to verify page size.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-26 UTC."],[],[],null,["# Enable 16 KB toggle\n\n16 KB toggle lets you to try a 16 KB kernel. This toggle switches\nbetween a 4 KB kernel and 16 KB kernel and can be found inside the\n\"Developer option\" menu in the settings app. The 16 KB toggle can be used\nto check application compatibility with the 16 KB kernel, but it might not\nreflect performance of actual 16 KB device due to the use of subpage blocks\n(when using EXT4 for `/data` and `/metadata` partitions) in 16 KB mode.\n\nSteps for configuring toggle\n----------------------------\n\n1. Make sure the device has set up the variables to be page-agnostic (to work\n with both 4 KB and 16 KB page size kernels).\n You may want to install the 16k kernel directly to make sure the device works in\n 16 KB mode directly before continuing to add the developer option.\n See the virtual device example [target config](https://cs.android.com/android/platform/superproject/+/android-latest-release:device/google/cuttlefish/vsoc_arm64_pgagnostic/phone/aosp_cf.mk;l=68).\n\n PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO := true\n PRODUCT_MAX_PAGE_SIZE_SUPPORTED := 16384\n\n2. Setup product variable to display developer option in settings\n `PRODUCT_16K_DEVELOPER_OPTION := true`\n\n3. Set kernel path using `BOARD_KERNEL_PATH_16K`.\n This kernel should be built with `CONFIG_ARM64_16K_PAGES=y.`\n\n BOARD_KERNEL_PATH_16K := kernel/prebuilts/mainline/$(TARGET_KERNEL_ARCH)/16k/kernel-mainline.\n\n4. Set modules config path variable `BOARD_KERNEL_MODULES_16K`. This variable\n points to kernel modules which support 16KB. Setting these parameters creates\n two OTAs on the system partition : `boot_ota_16k.zip`(to switch to 16 KB\n kernel) and `boot_ota_4k.zip`(to switch to 4 KB kernel). Enable incremental\n OTAs by setting `BOARD_16K_OTA_USE_INCREMENTAL := true` for smaller size boot\n OTAs.\n\n BOARD_KERNEL_MODULES_16K += $(wildcard kernel/prebuilts/mainline/$(TARGET_KERNEL_ARCH)/16k/*.ko)\n BOARD_KERNEL_MODULES_16K += $(wildcard kernel/prebuilts/common-modules/virtual-device/mainline/$(TARGET_KERNEL_ARCH)/16k/*.ko)\n\n5. Set `BOARD_16K_OTA_MOVE_VENDOR := true` to move OTAs to the vendor partition.\n Only set this to move OTAs from system to vendor partition.\n\n### Verification\n\nAfter successfully configuring the toggle, follow these steps:\n\n1. Check if **Boot with 16 KB page size** toggle is visible in settings app.\n2. Check if `/system/boot_otas` or `/vendor/boot_otas` contains two OTA zip files : `boot_ota_16k.zip` and `boot_ota_4k.zip`.\n\nUse 16 KB toggle\n----------------\n\n1. Go to **Settings \\\u003e System \\\u003e Software updates** and apply any updates which are available.\n2. Enable developer options. For instructions, see [Configure on-device developer options](https://developer.android.com/studio/debug/dev-options).\n3. If the device is detected as OEM locked, a dialog displays asking you to OEM unlock the phone. For instructions, see [Lock and unlock the bootloader](/docs/core/architecture/bootloader/locking_unlocking).\n4. Click **Boot with 16 KB page size** . If `/data` and `/metadata`aren't ext4, a dialog displays asking you to wipe the device. Click **Erase all data** to wipe the device. The device is wiped and you must enable developer options again.\n5. Click **Boot with 16 KB page size**. A dialog displays asking you to switch to 16 KB, and on confirming, boot OTAs are applied. You can then toggle back and forth between 4 KB and 16 KB mode without clearing the data partition to test app behavior.\n\nCheck 16 KB Mode\n----------------\n\nFollow steps at [getting page size](/docs/core/architecture/16kb-page-size/getting-page-size)\nto verify page size."]]