24d5a1ce6b
get_hugepage_dir() was implemented in such a way that a --huge-dir option had to exactly match the mountpoint, but there's no reason for this restriction: DPDK might not be the only user of hugepages, and shouldn't assume it owns an entire mountpoint. For example, if I have /dev/hugepages/myapp, and /dev/hugepages/dpdk, I should be able to specify: --huge-dir=/dev/hugepages/dpdk/ and have DPDK only use that sub-directory. Fix the implementation to allow a sub-directory within a suitable hugetlbfs mountpoint to be specified, preferring the closest match. Signed-off-by: John Levon <john.levon@nutanix.com> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Reviewed-by: David Marchand <david.marchand@redhat.com>