Skip to main content
kernel docs have moved
Source Link
Tobu
  • 6.8k
  • 2
  • 28
  • 19

As Patrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off except cpu0:

for x in /sys/devices/system/cpu/cpu[1-9]*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameterkernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

As Patrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off except cpu0:

for x in /sys/devices/system/cpu/cpu[1-9]*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

As Patrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off except cpu0:

for x in /sys/devices/system/cpu/cpu[1-9]*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

as TaborKelly notes, some systems can switch off cpu0, e.g. arm big.LITTLE
Source Link
Gilles 'SO- stop being evil'
  • 865.4k
  • 205
  • 1.8k
  • 2.3k

As Patrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off (exceptexcept cpu0 which can't be switched off):

for x in /sys/devices/system/cpu/cpu*cpu[1-9]*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

As Patrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off (except cpu0 which can't be switched off):

for x in /sys/devices/system/cpu/cpu*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

As Patrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off except cpu0:

for x in /sys/devices/system/cpu/cpu[1-9]*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

As Patrick has indicated in a commentPatrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off (except cpu0 which can't be switched off):

for x in /sys/devices/system/cpu/cpu*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

As Patrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off (except cpu0 which can't be switched off):

for x in /sys/devices/system/cpu/cpu*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

As Patrick has indicated in a comment, you got the path under /sys wrong.

echo 0 > /sys/devices/system/cpu/cpu3/online

If you want to switch all CPUs off (except cpu0 which can't be switched off):

for x in /sys/devices/system/cpu/cpu*/online; do
  echo 0 >"$x"
done

Typing maxcpus=1 at a shell prompt has no effect. More precisely, it sets the variable maxcpus to the value 1 in that shell, which doesn't have any other effect. You can set the number of CPUs at boot time by passing maxcpus as a kernel parameter. For that, you have to change your bootloader configuration (e.g. to change the kernel command line in U-Boot).

missing backtick
Source Link
phemmer
  • 73.9k
  • 21
  • 199
  • 231
Loading
Source Link
Gilles 'SO- stop being evil'
  • 865.4k
  • 205
  • 1.8k
  • 2.3k
Loading