Mark
Mark

Reputation: 6474

isolate cpu cores (physical or logical?)

Am I right thinking that a kernel parameter 'isolcpus' accepts physical core ID? So if I have 4 physical cores, and hyper-threading enabled, which gives me total 8 cores, then I'm only allowed to specify cpu cores 1..3 in isolcpus parameter (core0 goes for OS)?

Thanks.

Upvotes: 4

Views: 4268

Answers (2)

Red Hat guru Daniel Macpherson said in a Red Hat community discussion:

So you might need to restrict the kernel from accessing the CPUs you have pinned to the instance. For example, let's say I have an 8 core CPU with dual hyper-threading, which results in 16 vcpus. I want to use core 0 for my OpenStack services and cores 1-7 for instances. I'd need to tell the kernel to leave those cores alone. This means I'd need to tell the kernel to leave alone vcpus 1-7 and 9-15:

$ sudo grubby --update-kernel=ALL --args="isolcpus=1,2,3,4,5,6,7,9,10,11,12,13,14,15"
$ sudo grub2-install /dev/sda
$ sudo reboot

According to that, you specify logical CPU cores for the isolcpus kernel parameter.

Upvotes: 3

Remus Rusanu
Remus Rusanu

Reputation: 294287

Is open source.

Documentation/kernel-parameters.txt

isolcpus=   [KNL,SMP] Isolate CPUs from the general scheduler.
        Format:
        <cpu number>,...,<cpu number>
        or
        <cpu number>-<cpu number>
        (must be a positive range in ascending order)
        or a mixture
        <cpu number>,...,<cpu number>-<cpu number>

        This option can be used to specify one or more CPUs
        to isolate from the general SMP balancing and scheduling
        algorithms. You can move a process onto or off an
        "isolated" CPU via the CPU affinity syscalls or cpuset.
        <cpu number> begins at 0 and the maximum value is
        "number of CPUs in system - 1".

        This option is the preferred way to isolate CPUs. The
        alternative -- manually setting the CPU mask of all
        tasks in the system -- can cause problems and
        suboptimal load balancer performance.

If that isn't enough, just search the source for isolcplus and look at how is used.

Upvotes: -3

Related Questions