Skip to content

Commit

Permalink
executors: globally allow THP sysfs entries
Browse files Browse the repository at this point in the history
Since both Java and Go ask for them, seems reasonable to give everyone access.
  • Loading branch information
Xyene committed Jun 2, 2024
1 parent 9672196 commit 662d903
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 0 additions & 6 deletions dmoj/executors/GO.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import re
from typing import Dict, List

from dmoj.cptbox.filesystem_policies import ExactFile
from dmoj.error import CompileError
from dmoj.executors.base_executor import VersionFlags
from dmoj.executors.compiled_executor import CompiledExecutor
Expand All @@ -24,11 +23,6 @@ class Executor(CompiledExecutor):
command = 'go'
syscalls = ['mincore', 'pselect6', 'mlock', 'setrlimit']
compiler_syscalls = ['copy_file_range', 'setrlimit']
fs = [
# Go will start without THP information, but has some tuning for when
# it is available -- so let's allow it to tell.
ExactFile('/sys/kernel/mm/transparent_hugepage/hpage_pmd_size'),
]
test_name = 'echo'
test_program = """\
package main
Expand Down
3 changes: 3 additions & 0 deletions dmoj/executors/base_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
ExactDir('/sys/devices/system/cpu'),
ExactFile('/sys/devices/system/cpu/online'),
ExactFile('/etc/selinux/config'),
ExactFile('/sys/kernel/mm/transparent_hugepage/enabled'),
ExactFile('/sys/kernel/mm/transparent_hugepage/hpage_pmd_size'),
ExactFile('/sys/kernel/mm/transparent_hugepage/shmem_enabled'),
]

if sys.platform.startswith('freebsd'):
Expand Down

0 comments on commit 662d903

Please sign in to comment.