1. 08 6月, 2017 4 次提交
  2. 06 6月, 2017 8 次提交
  3. 25 5月, 2017 3 次提交
    • D
      hw/ppc/spapr.c: recover pending LMB unplug info in spapr_lmb_release · 16ee9980
      Daniel Henrique Barboza 提交于
      When a LMB hot unplug starts, the current DRC LMB status is stored at
      spapr->pending_dimm_unplugs QTAILQ. This queue isn't migrated, thus
      if a migration occurs in the middle of a LMB unplug the
      spapr_lmb_release callback will lost track of the LMB unplug progress.
      
      This patch implements a new recover function spapr_recover_pending_dimm_state
      that is used inside spapr_lmb_release to recover this DRC LMB release
      status that is lost during the migration.
      Signed-off-by: NDaniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
      [dwg: Minor stylistic changes, simplify error handling]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      16ee9980
    • D
      hw/ppc: removing drc->detach_cb and drc->detach_cb_opaque · 31834723
      Daniel Henrique Barboza 提交于
      The pointer drc->detach_cb is being used as a way of informing
      the detach() function inside spapr_drc.c which cb to execute. This
      information can also be retrieved simply by checking drc->type and
      choosing the right callback based on it. In this context, detach_cb
      is redundant information that must be managed.
      
      After the previous spapr_lmb_release change, no detach_cb_opaques
      are being used by any of the three callbacks functions. This is
      yet another information that is now unused and, on top of that, can't
      be migrated either.
      
      This patch makes the following changes:
      
      - removal of detach_cb_opaque. the 'opaque' argument was removed from
      the callbacks and from the detach() function of sPAPRConnectorClass. The
      attribute detach_cb_opaque of sPAPRConnector was removed.
      
      - removal of detach_cb from the detach() call. The function pointer
      detach_cb of sPAPRConnector was removed. detach() now uses a
      switch(drc->type) to execute the apropriate callback. To achieve this,
      spapr_core_release, spapr_lmb_release and spapr_phb_remove_pci_device_cb
      callbacks were made public to be visible inside detach().
      Signed-off-by: NDaniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      31834723
    • D
      hw/ppc/spapr.c: adding pending_dimm_unplugs to sPAPRMachineState · 0cffce56
      David Gibson 提交于
      The LMB DRC release callback, spapr_lmb_release(), uses an opaque
      parameter, a sPAPRDIMMState struct that stores the current LMBs that
      are allocated to a DIMM (nr_lmbs). After each call to this callback,
      the nr_lmbs is decremented by one and, when it reaches zero, the callback
      proceeds with the qdev calls to hot unplug the LMB.
      
      Using drc->detach_cb_opaque is problematic because it can't be migrated in
      the future DRC migration work. This patch makes the following changes to
      eliminate the usage of this opaque callback inside spapr_lmb_release:
      
      - sPAPRDIMMState was moved from spapr.c and added to spapr.h. A new
      attribute called 'addr' was added to it. This is used as an unique
      identifier to associate a sPAPRDIMMState to a PCDIMM element.
      
      - sPAPRMachineState now hosts a new QTAILQ called 'pending_dimm_unplugs'.
      This queue of sPAPRDIMMState elements will store the DIMM state of DIMMs
      that are currently going under an unplug process.
      
      - spapr_lmb_release() will now retrieve the nr_lmbs value by getting the
      correspondent sPAPRDIMMState. A helper function called spapr_dimm_get_address
      was created to fetch the address of a PCDIMM device inside spapr_lmb_release.
      When nr_lmbs reaches zero and the callback proceeds with the qdev hot unplug
      calls, the sPAPRDIMMState struct is removed from spapr->pending_dimm_unplugs.
      
      After these changes, the opaque argument for spapr_lmb_release is now
      unused and is passed as NULL inside spapr_del_lmbs. This and the other
      opaque arguments can now be safely removed from the code.
      
      As an additional cleanup made by this patch, the spapr_del_lmbs function
      was merged with spapr_memory_unplug_request. The former was being called
      only by the latter and both were small enough to fit one single function.
      Signed-off-by: NDaniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
      [dwg: Minor stylistic cleanups]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      0cffce56
  4. 24 5月, 2017 7 次提交
  5. 12 5月, 2017 4 次提交
    • I
      spapr: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu() · 722387e7
      Igor Mammedov 提交于
      it's safe to remove thread node_id != core node_id error
      branch as machine_set_cpu_numa_node() also does mismatch
      check and is called even before any CPU is created.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <1494415802-227633-10-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      722387e7
    • I
      spapr: add node-id property to sPAPR core · 0b8497f0
      Igor Mammedov 提交于
      it will allow switching from cpu_index to core based numa
      mapping in follow up patches.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <1494415802-227633-3-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      0b8497f0
    • I
      numa: move source of default CPUs to NUMA node mapping into boards · ea089eeb
      Igor Mammedov 提交于
      Originally CPU threads were by default assigned in
      round-robin fashion. However it was causing issues in
      guest since CPU threads from the same socket/core could
      be placed on different NUMA nodes.
      Commit fb43b73b (pc: fix default VCPU to NUMA node mapping)
      fixed it by grouping threads within a socket on the same node
      introducing cpu_index_to_socket_id() callback and commit
      20bb648d (spapr: Fix default NUMA node allocation for threads)
      reused callback to fix similar issues for SPAPR machine
      even though socket doesn't make much sense there.
      
      As result QEMU ended up having 3 default distribution rules
      used by 3 targets /virt-arm, spapr, pc/.
      
      In effort of moving NUMA mapping for CPUs into possible_cpus,
      generalize default mapping in numa.c by making boards decide
      on default mapping and let them explicitly tell generic
      numa code to which node a CPU thread belongs to by replacing
      cpu_index_to_socket_id() with @cpu_index_to_instance_props()
      which provides default node_id assigned by board to specified
      cpu_index.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1494415802-227633-2-git-send-email-imammedo@redhat.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      ea089eeb
    • L
      numa: equally distribute memory on nodes · 3bfe5716
      Laurent Vivier 提交于
      When there are more nodes than available memory to put the minimum
      allowed memory by node, all the memory is put on the last node.
      
      This is because we put (ram_size / nb_numa_nodes) &
      ~((1 << mc->numa_mem_align_shift) - 1); on each node, and in this
      case the value is 0. This is particularly true with pseries,
      as the memory must be aligned to 256MB.
      
      To avoid this problem, this patch uses an error diffusion algorithm [1]
      to distribute equally the memory on nodes.
      
      We introduce numa_auto_assign_ram() function in MachineClass
      to keep compatibility between machine type versions.
      The legacy function is used with pseries-2.9, pc-q35-2.9 and
      pc-i440fx-2.9 (and previous), the new one with all others.
      
      Example:
      
      qemu-system-ppc64 -S -nographic  -nodefaults -monitor stdio -m 1G -smp 8 \
                        -numa node -numa node -numa node \
                        -numa node -numa node -numa node
      
      Before:
      
      (qemu) info numa
      6 nodes
      node 0 cpus: 0 6
      node 0 size: 0 MB
      node 1 cpus: 1 7
      node 1 size: 0 MB
      node 2 cpus: 2
      node 2 size: 0 MB
      node 3 cpus: 3
      node 3 size: 0 MB
      node 4 cpus: 4
      node 4 size: 0 MB
      node 5 cpus: 5
      node 5 size: 1024 MB
      
      After:
      (qemu) info numa
      6 nodes
      node 0 cpus: 0 6
      node 0 size: 0 MB
      node 1 cpus: 1 7
      node 1 size: 256 MB
      node 2 cpus: 2
      node 2 size: 0 MB
      node 3 cpus: 3
      node 3 size: 256 MB
      node 4 cpus: 4
      node 4 size: 256 MB
      node 5 cpus: 5
      node 5 size: 256 MB
      
      [1] https://en.wikipedia.org/wiki/Error_diffusionSigned-off-by: NLaurent Vivier <lvivier@redhat.com>
      Message-Id: <20170502162955.1610-2-lvivier@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      [ehabkost: s/ram_size/size/ at numa_default_auto_assign_ram()]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      3bfe5716
  6. 11 5月, 2017 2 次提交
  7. 26 4月, 2017 11 次提交
  8. 03 4月, 2017 1 次提交
    • D
      pseries: Enforce homogeneous threads-per-core · 8149e299
      David Gibson 提交于
      For reasons that may be useful in future, CPU core objects, as used on the
      pseries machine type have their own nr-threads property, potentially
      allowing cores with different numbers of threads in the same system.
      
      If the user/management uses the values specified in query-hotpluggable-cpus
      as they're expected to do, this will never matter in pratice.  But that's
      not actually enforced - it's possible to manually specify a core with
      a different number of threads from that in -smp.  That will confuse the
      platform - most immediately, this can be used to create a CPU thread with
      index above max_cpus which leads to an assertion failure in
      spapr_cpu_core_realize().
      
      For now, enforce that all cores must have the same, standard, number of
      threads.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      8149e299