Skip to content

Commit

Permalink
core::memory: define a huge page size in a platform-dependent way
Browse files Browse the repository at this point in the history
Set a seastar::memory::huge_page_size to the platform-specific value.

Signed-off-by: Vlad Zolotarov <[email protected]>
  • Loading branch information
vladzcloudius committed Nov 13, 2017
1 parent 02294f6 commit 0262c38
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/memory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ namespace memory {

static constexpr size_t page_size = SEASTAR_INTERNAL_ALLOCATOR_PAGE_SIZE;
static constexpr size_t page_bits = log2ceil(page_size);
static constexpr size_t huge_page_size = 1 << 21; // 2M
static constexpr size_t huge_page_size =
#if defined(__x86_64__) || defined(__i386__) || defined(__s390x__) || defined(__zarch__)
1 << 21; // 2M
#elif defined(__PPC__)
1 << 24; // 16M
#else
#error "Huge page size is not defined for this architecture"
#endif

void configure(std::vector<resource::memory> m, bool mbind,
std::experimental::optional<std::string> hugetlbfs_path = {});
Expand Down

0 comments on commit 0262c38

Please sign in to comment.