Skip to content

Number of virtual cores equals number of virtual sockets instead of using hardware topology for QEMU version 2 and up #16

Description

@martijnkruiten

In QEMU version 2 and higher each core on the VM is assigned to its own virtual socket instead of using the hardware topology:

cmdline += ['-smp', 'threads=1,cores=1,sockets=%d' %
(num_cores)]

On older QEMU versions the sockets are specified instead:

cmdline += ['-smp', '%d,sockets=%d' %
(num_cores, len(cores_on_numa))]

Is there a reason to avoid this on version 2 and higher, or has this just not been tested? I wrote a small patch that mimics the version 1 behaviour for version 2 and up, and I don't see ill effects. The intra and inter socket communication behaves as expected. I was thinking of enabling this only when autobind_cpumem equals True, and possibly with a check if the topology is symmetrical. Just checking if you already have some experience with this. It boils down to something like this:

cmdline += ['-smp', 'threads=1,cores=%d,sockets=%d' %
            (num_cores/len(cores_on_numa), len(cores_on_numa))]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions