1. 20 3月, 2015 8 次提交
    • E
      numa: Print warning if no node is assigned to a CPU · 549fc54b
      Eduardo Habkost 提交于
      We need all possible CPUs (including hotplug ones) to be present in the
      SRAT when QEMU starts. QEMU already does that correctly today, the only
      problem is that when a CPU is omitted from the NUMA configuration, it is
      silently assigned to node 0.
      
      Check if all CPUs up to max_cpus are present in the NUMA configuration
      and warn about missing CPUs.
      
      Make it just a warning, to allow management software to be updated if
      necessary. In the future we may make it a fatal error instead.
      
      Command-line examples:
      
      * Correct, no warning:
      
        $ qemu-system-x86_64 -smp 2,maxcpus=4
        $ qemu-system-x86_64 -smp 2,maxcpus=4 -numa node,cpus=0-3
      
      * Incomplete, with warnings:
      
        $ qemu-system-x86_64 -smp 2,maxcpus=4 -numa node,cpus=0
        qemu-system-x86_64: warning: CPU(s) not present in any NUMA nodes: 1 2 3
        qemu-system-x86_64: warning: All CPU(s) up to maxcpus should be described in NUMA config
      
        $ qemu-system-x86_64 -smp 2,maxcpus=4 -numa node,cpus=0-2
        qemu-system-x86_64: warning: CPU(s) not present in any NUMA nodes: 3
        qemu-system-x86_64: warning: All CPU(s) up to maxcpus should be described in NUMA config
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      ---
      v1 -> v2: (no changes)
      
      v2 -> v3:
       * Use enumerate_cpus() and error_report() for error message
       * Simplify logic using bitmap_full()
      
      v3 -> v4:
       * Clarify error message, mention that all CPUs up to
         maxcpus need to be described in NUMA config
      
      v4 -> v5:
       * Commit log update, to make problem description clearer
      549fc54b
    • I
      pc: fix default VCPU to NUMA node mapping · fb43b73b
      Igor Mammedov 提交于
      Since commit
         dd0247e0 pc: acpi: mark all possible CPUs as enabled in SRAT
      Linux kernel actually tries to use CPU to Node mapping from
      QEMU provided SRAT table instead of discarding it, and that
      in some cases breaks build_sched_domains() which expects
      sane mapping where cores/threads belonging to the same socket
      are on the same NUMA node.
      
      With current default round-robin mapping of VCPUs to nodes
      guest ends-up with cores/threads belonging to the same socket
      being on different NUMA nodes.
      
      For example with following CLI:
      
         qemu-system-x86_64 -m 4G \
               -cpu Opteron_G3,vendor=AuthenticAMD \
               -smp 5,sockets=1,cores=4,threads=1,maxcpus=8 \
               -numa node,nodeid=0 -numa node,nodeid=1
      
      2.6.32 based kernels will hang on boot due to incorrectly built
      sched_group-s list in update_sd_lb_stats()
      
      Replacing default mapping with a manual, where VCPUs belonging to
      the same socket are on the same NUMA node, fixes the issue for
      guests which can't handle nonsense topology i.e. changing CLI to:
        -numa node,nodeid=0,cpus=0-3 -numa node,nodeid=1,cpus=4-7
      
      So instead of simply scattering VCPUs around nodes, provide
      callback to map the same socket VCPUs to the same NUMA node,
      which is what guests would expect from a sane hardware/BIOS.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      fb43b73b
    • I
      numa: introduce machine callback for VCPU to node mapping · 57924bcd
      Igor Mammedov 提交于
      Current default round-robin way of distributing VCPUs among
      NUMA nodes might be wrong in case on multi-core/threads
      CPUs. Making guests confused wrt topology where cores from
      the same socket are on different nodes.
      
      Allow a machine to override default mapping by providing
       MachineClass::cpu_index_to_socket_id()
      callback which would allow it group VCPUs from a socket
      on the same NUMA node.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      57924bcd
    • E
      numa: Reject configuration if CPU appears on multiple nodes · 3ef71975
      Eduardo Habkost 提交于
      Each CPU can appear in only one NUMA node on the NUMA config. Reject
      configuration if a CPU appears in multiple nodes.
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      3ef71975
    • E
      numa: Reject CPU indexes > max_cpus · 8979c945
      Eduardo Habkost 提交于
      CPU index is always less than max_cpus, as documented at sysemu.h:
      
      > The following shall be true for all CPUs:
      >   cpu->cpu_index < max_cpus <= MAX_CPUMASK_BITS
      
      Reject configuration which uses invalid CPU indexes.
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      8979c945
    • E
      numa: Fix off-by-one error at MAX_CPUMASK_BITS check · ed26b922
      Eduardo Habkost 提交于
      Fix the CPU index check to ensure we don't go beyond the size of the
      node_cpu bitmap.
      
      CPU index is always less than MAX_CPUMASK_BITS, as documented at
      sysemu.h:
      
      > The following shall be true for all CPUs:
      >   cpu->cpu_index < max_cpus <= MAX_CPUMASK_BITS
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      ed26b922
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 3e5f6234
      Peter Maydell 提交于
      Block patches for 2.3.0-rc1
      
      # gpg: Signature made Thu Mar 19 15:03:26 2015 GMT using RSA key ID C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
      
      * remotes/kevin/tags/for-upstream:
        block: Fix blockdev-backup not to use funky error class
        raw-posix: Deprecate aio=threads fallback without O_DIRECT
        raw-posix: Deprecate host floppy passthrough
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      3e5f6234
    • P
      Merge remote-tracking branch 'remotes/amit/tags/vser-for-2.3-3' into staging · 33a8d5b7
      Peter Maydell 提交于
      virtio-serial api: guest_writable callback for users
      
      # gpg: Signature made Thu Mar 19 12:06:55 2015 GMT using RSA key ID 854083B6
      # gpg: Good signature from "Amit Shah <amit@amitshah.net>"
      # gpg:                 aka "Amit Shah <amit@kernel.org>"
      # gpg:                 aka "Amit Shah <amitshah@gmx.net>"
      
      * remotes/amit/tags/vser-for-2.3-3:
        virtio: serial: expose a 'guest_writable' callback for users
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      33a8d5b7
  2. 19 3月, 2015 32 次提交