《linux多核cpu控制启动核数》由会员分享,可在线阅读,更多相关《linux多核cpu控制启动核数(2页珍藏版)》请在金锄头文库上搜索。
1、Linux多核CPU控制启动核数 修改/boot/grub/grub.conf,在kernel行最后加入 maxcpus=n (n为需要启动的核数)例如原来的grub.conf文件如下:# grub.conf generated by anaconda# Note that you do not have to rerun grub after making changes to this file# NOTICE: You have a /boot partition. This means that# all kernel and initrd paths are relative to
2、/boot/, eg.# root (hd0,0)# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00# initrd /initrd-version.img#boot=/dev/sdadefault=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle Red Hat Enterprise Linux Server (2.6.18-164.el5)root (hd0,0)kernel /vmlinuz-2.6.18-164.el5 ro root=/dev
3、/VolGroup00/LogVol00 rhgb quietinitrd /initrd-2.6.18-164.el5.img修改为:# grub.conf generated by anaconda# Note that you do not have to rerun grub after making changes to this file# NOTICE: You have a /boot partition. This means that# all kernel and initrd paths are relative to /boot/, eg.# root (hd0,0)
4、# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00# initrd /initrd-version.img#boot=/dev/sdadefault=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle Red Hat Enterprise Linux Server (2.6.18-164.el5)root (hd0,0)kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet maxcpus=4initrd /initrd-2.6.18-164.el5.img则reboot后启动的核数为4