[v1,1/1] dts: add admin privileges to hugepage mounting
Checks
Commit Message
From: Jeremy Spewock <jspewock@iol.unh.edu>
There were two different commands in the hugepage mounting process that
were not using super-user privileges; one for unmounting hugepages and
another for re-mounting them. This patch adds the flag that enables
enhanced permissions for both of these actions.
Bugzilla ID: 1439
Fixes: b8bdc4c58f57 ("dts: replace pexpect with fabric")
Cc: juraj.linkes@pantheon.tech
Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
dts/framework/testbed_model/linux_session.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
Reviewed-by: Nicholas Pratte <npratte@iol.unh.edu>
On Mon, Aug 12, 2024 at 11:04 AM <jspewock@iol.unh.edu> wrote:
>
> From: Jeremy Spewock <jspewock@iol.unh.edu>
>
> There were two different commands in the hugepage mounting process that
> were not using super-user privileges; one for unmounting hugepages and
> another for re-mounting them. This patch adds the flag that enables
> enhanced permissions for both of these actions.
>
> Bugzilla ID: 1439
> Fixes: b8bdc4c58f57 ("dts: replace pexpect with fabric")
> Cc: juraj.linkes@pantheon.tech
>
> Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
> ---
> dts/framework/testbed_model/linux_session.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
> index 99abc21353..544a665b83 100644
> --- a/dts/framework/testbed_model/linux_session.py
> +++ b/dts/framework/testbed_model/linux_session.py
> @@ -123,12 +123,12 @@ def _get_numa_nodes(self) -> list[int]:
> def _mount_huge_pages(self) -> None:
> self._logger.info("Re-mounting Hugepages.")
> hugapge_fs_cmd = "awk '/hugetlbfs/ { print $2 }' /proc/mounts"
> - self.send_command(f"umount $({hugapge_fs_cmd})")
> + self.send_command(f"umount $({hugapge_fs_cmd})", privileged=True)
> result = self.send_command(hugapge_fs_cmd)
> if result.stdout == "":
> remote_mount_path = "/mnt/huge"
> - self.send_command(f"mkdir -p {remote_mount_path}")
> - self.send_command(f"mount -t hugetlbfs nodev {remote_mount_path}")
> + self.send_command(f"mkdir -p {remote_mount_path}", privileged=True)
> + self.send_command(f"mount -t hugetlbfs nodev {remote_mount_path}", privileged=True)
>
> def _supports_numa(self) -> bool:
> # the system supports numa if self._numa_nodes is non-empty and there are more
> --
> 2.45.2
>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
On 12. 8. 2024 17:04, jspewock@iol.unh.edu wrote:
> From: Jeremy Spewock <jspewock@iol.unh.edu>
>
> There were two different commands in the hugepage mounting process that
> were not using super-user privileges; one for unmounting hugepages and
> another for re-mounting them. This patch adds the flag that enables
> enhanced permissions for both of these actions.
>
> Bugzilla ID: 1439
> Fixes: b8bdc4c58f57 ("dts: replace pexpect with fabric")
> Cc: juraj.linkes@pantheon.tech
>
> Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
Reviewed-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
@@ -123,12 +123,12 @@ def _get_numa_nodes(self) -> list[int]:
def _mount_huge_pages(self) -> None:
self._logger.info("Re-mounting Hugepages.")
hugapge_fs_cmd = "awk '/hugetlbfs/ { print $2 }' /proc/mounts"
- self.send_command(f"umount $({hugapge_fs_cmd})")
+ self.send_command(f"umount $({hugapge_fs_cmd})", privileged=True)
result = self.send_command(hugapge_fs_cmd)
if result.stdout == "":
remote_mount_path = "/mnt/huge"
- self.send_command(f"mkdir -p {remote_mount_path}")
- self.send_command(f"mount -t hugetlbfs nodev {remote_mount_path}")
+ self.send_command(f"mkdir -p {remote_mount_path}", privileged=True)
+ self.send_command(f"mount -t hugetlbfs nodev {remote_mount_path}", privileged=True)
def _supports_numa(self) -> bool:
# the system supports numa if self._numa_nodes is non-empty and there are more