Skip to content

Instantly share code, notes, and snippets.

@wojtuss
wojtuss / device_dax_setup_commands.txt
Created May 23, 2017 10:41
device dax setup commands
Assuming your linux kernel supports Device DAX properly, the following describes a full procedure of how to set up 2 Device DAXes of 1G and 2G sizes on a machine with 32G RAM.
1. Configure grub.
Add the following line to /etc/default/grub:
GRUB_CMDLINE_LINUX="memmap=1G!31G memmap=2G!29G"
(meaning: take 1G after 31G of your RAM and 2G after 29G of RAM, which makes the last 3G of your RAM devoted to Device DAXex)
2. Update grub.
$ sudo update-grub2
@wojtuss
wojtuss / pmempool
Last active February 14, 2017 08:27
pmempool bash auto-complete
# A script for pmempool command auto-completion in bash.
# Put it into /etc/bash_completion.d directory and load it by running
# . /etc/bash_completion.d/pmempool
_pmempool()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
PMEMPOOLSET
20M /0/partfile1
50M /0/partfile2
PMEMPOOLSET
20M /0/partfile1
20M /0/partfile2
25M /0/partfile3
REPLICA
40M /1/partfile1
20M /1/partfile2
REPLICA
50M /2/partfile1
20M /2/partfile2
PMEMPOOLSET
20M /0/partfile1
20M /0/partfile2
25M /0/partfile3
REPLICA
40M /1/partfile1
20M /1/partfile2