Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.package
Commits
f58b80be
Commit
f58b80be
authored
Jun 21, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/ors: disable hyperthreading
parent
ec586de2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
playbook/roles/ors/files/configure-grub
playbook/roles/ors/files/configure-grub
+4
-1
playbook/sha256sum
playbook/sha256sum
+1
-1
No files found.
playbook/roles/ors/files/configure-grub
View file @
f58b80be
#!/bin/bash
CONF
=
"/etc/default/grub"
BAK
=
"/tmp/default.grub"
N_CORE
=
"
$((
$(
lscpu |
sed
-n
's/^Core.*: *\([0-9]*\)/\1/gp'
)
*
$(
lscpu |
sed
-n
's/^Socket.*: *\([0-9]*\)/\1/gp'
)
))
"
cp
$CONF
$BAK
;
if
!
grep
-q
idle
=
halt /proc/cmdline
;
then
if
!
(
grep
-q
idle
=
halt /proc/cmdline
&&
grep
-q
"maxcpus=
$N_CORE
"
/proc/cmdline
)
;
then
sed
-i
's/^\(GRUB_CMDLINE_LINUX_DEFAULT.*\)idle=[a-z]* *\(.*\)/\1\2/g'
$CONF
;
sed
-i
's/^\(GRUB_CMDLINE_LINUX_DEFAULT.*\)"/\1 idle=halt"/g'
$CONF
;
sed
-i
's/^\(GRUB_CMDLINE_LINUX_DEFAULT.*\)maxcpus=[0-9]* *\(.*\)/\1\2/g'
$CONF
;
sed
-i
's/^\(GRUB_CMDLINE_LINUX_DEFAULT.*\)"/\1 maxcpus='
"
$N_CORE
"
'"/g'
$CONF
;
if
!
update-grub
;
then
cp
$BAK
$CONF
;
update-grub
;
...
...
playbook/sha256sum
View file @
f58b80be
2f6f68fd28b5bae04559ee19b2ecf926b4dbe929d13200a214d1287ec2cd3d32
-
fc085ff3a6ec4b99b7baff843ace3c10d82bbdd70297ad86a45a31f24fa3fc2b
-
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment