[v3,1/5] usertools: add option to select hugetlbfs directory
Checks
Commit Message
dpdk-hugepages.py had /dev/hugepages hardcoded as the mount point.
It may be desirable to setup hugepage directory at another path,
for example, when using hugepages of multiple sizes in different
directories or when granting different permissions to mount points.
Add --directory/-d option to the script.
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
---
usertools/dpdk-hugepages.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Comments
On Fri, Jun 24, 2022 at 11:48:13AM +0300, Dmitry Kozlyuk wrote:
> dpdk-hugepages.py had /dev/hugepages hardcoded as the mount point.
> It may be desirable to setup hugepage directory at another path,
> for example, when using hugepages of multiple sizes in different
> directories or when granting different permissions to mount points.
> Add --directory/-d option to the script.
>
> Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
@@ -228,6 +228,12 @@ def main():
'-u',
action='store_true',
help='unmount the system huge page directory')
+ parser.add_argument(
+ '--directory',
+ '-d',
+ metavar='DIR',
+ default=HUGE_MOUNT,
+ help='mount point')
parser.add_argument(
'--node', '-n', help='select numa node to reserve pages on')
parser.add_argument(
@@ -262,7 +268,7 @@ def main():
if args.clear:
clear_pages()
if args.unmount:
- umount_huge(HUGE_MOUNT)
+ umount_huge(args.directory)
if args.reserve:
reserve_kb = get_memsize(args.reserve)
@@ -273,7 +279,7 @@ def main():
reserve_pages(
int(reserve_kb / pagesize_kb), pagesize_kb, node=args.node)
if args.mount:
- mount_huge(pagesize_kb, HUGE_MOUNT)
+ mount_huge(pagesize_kb, args.directory)
if args.show:
show_pages()
print()