Skip to content

Commit

Permalink
riscv_mmu: Always use THP by default
Browse files Browse the repository at this point in the history
- Previous logic was based on a wrong assumption that transparent hugepages aren't swappable, yet they actually are
- With the advent of THP_SWAP, swapping performance should be on par
  • Loading branch information
LekKit committed Jul 14, 2024
1 parent aa1b9fb commit df750cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/riscv_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bool riscv_init_ram(rvvm_ram_t* mem, phys_addr_t begin, phys_addr_t size)

uint32_t flags = VMA_RDWR;
if (!rvvm_has_arg("no_ksm")) flags |= VMA_KSM;
if (!rvvm_has_arg("no_thp") && (size > (256 << 20))) flags |= VMA_THP;
if (!rvvm_has_arg("no_thp")) flags |= VMA_THP;
mem->data = vma_alloc(NULL, size, flags);
if (mem->data) {
mem->begin = begin;
Expand Down

0 comments on commit df750cc

Please sign in to comment.