]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
blk: bring MAP_HUGETLB-based buffer pool to KernelDevice.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 4 Nov 2021 20:50:17 +0000 (20:50 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 12 Jan 2022 20:35:50 +0000 (20:35 +0000)
commit64aae2b9554a467050fa22540d5556813287e3c1
treee353fcaf70765d8ddb7347b636f867615611d779
parent67ce52f5f9612bde8180203bdcbb6d9e733e5108
blk: bring MAP_HUGETLB-based buffer pool to KernelDevice.

The idea here is to bring a pool of `mmap`-allocated,
constantly-sized buffers which would take precedence
over the 2 MB-aligned, THP-based mechanism. On first
attempt to acquire a 4 MB buffer, KernelDevice mmaps
`bdev_read_preallocated_huge_buffer_num` (default 128)
memory regions using the MAP_HUGETLB option. If this
fails, the entire process is aborted. Buffers, after
their life-times going over, are recycled with lock-
free queue shared across entire process.

Remember about allocating the appropriate number of
huge pages in the system! For instance:

```
echo 256 | sudo tee /proc/sys/vm/nr_hugepages
```

This commit bases on / cherry-picks with changes
897a4932bee5cba3641c18619cccd0ee945bfcf8.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/blk/kernel/KernelDevice.cc
src/blk/kernel/KernelDevice.h
src/common/options/global.yaml.in