Skip to content

Latest commit

 

History

History

driver

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

dma-driver

Build Kernel Module/Driver

  1. Install prerequisites, e.g. on Ubuntu install the following packages:
$ sudo apt install build-essential linux-headers-generic
  1. Build kernel module
$ cd driver
$ make

Setup Hugepages

  1. Create a group for users of hugepages, and retrieve its GID (in this example, 1001) then add yourself to the group.
$ sudo groupadd hugetlbfs

$ sudo getent group hugetlbfs

$ sudo adduser dasidler hugetlbfs
  1. Edit /etc/sysctl.conf and add this text to specify the number of pages you want to reserve (see page-size)
# Allocate 8192*2MiB for HugePageTables
vm.nr_hugepages = 8192

# Members of group hugetlbfs(1001) can allocate "huge" shared memory segments
vm.hugetlb_shm_group = 1001
  1. Create a mount point for the file system
$ mkdir /media/huge
  1. Add this line in /etc/fstab (The mode 1770 allows anyone in the group to create files but not unlink or rename each other's files.)
# hugetlbfs
hugetlbfs /media/huge hugetlbfs mode=1770,gid=1001 0 0
  1. Reboot

  2. Add the following line to /etc/security/limits.conf to configure the amount of memory a user can lock, so an application can't crash your operating system by locking all the memory.

@hugetlbfs	hard	memlock		1048576