Configure grub.cfg for two CPU cores

From ESS-WIKI
Revision as of 10:35, 17 January 2024 by Winston.huang (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Intel Yocto Linux

  • modify grub.cfg for two cpu cores ...
GRUBCFG=/boot/efi/EFI/BOOT/grub.cfg
# backup original grub.cfg if not backup before
[[ ! -f $GRUBCFG.bak ]] && cp -a $GRUBCFG{,.bak} 

# display current setting
grep --color -E '(isolcpus|rcu_nocbs)=\S*' $GRUBCFG

# change isolcpus=* rcu_nocbs=* to change isolcpus=1-2 rcu_nocbs=1-2
sed -i "s/isolcpus=\S*/isolcpus=1-2/; s/rcu_nocbs=\S*/rcu_nocbs=1-2/" $GRUBCFG

# verification
grep --color -E '(isolcpus|rcu_nocbs)=\S*' $GRUBCFG

# if the grub.cfg is correct, reboot machine
reboot
  • recover to the original grub.cfg ...
GRUBCFG=/boot/efi/EFI/BOOT/grub.cfg

# display current setting
grep --color -E '(isolcpus|rcu_nocbs)=\S*' $GRUBCFG

# recover
[[ -f $GRUBCFG.bak ]] && cp -a $GRUBCFG.bak $GRUBCFG

# verification
grep --color -E '(isolcpus|rcu_nocbs)=\S*' $GRUBCFG

# if the grub.cfg is recovered, reboot machine
reboot

Ubuntu with Kernel Overlay