Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: b11cf32e07a2f7ff0d171b89497381a04c9d07e0
      
https://github.com/qemu/qemu/commit/b11cf32e07a2f7ff0d171b89497381a04c9d07e0
  Author: Chenyi Qiang <[email protected]>
  Date:   2022-12-28 (Wed, 28 Dec 2022)

  Changed paths:
    M hw/virtio/virtio-mem.c

  Log Message:
  -----------
  virtio-mem: Fix the bitmap index of the section offset

vmem->bitmap indexes the memory region of the virtio-mem backend at a
granularity of block_size. To calculate the index of target section offset,
the block_size should be divided instead of the bitmap_size.

Fixes: 2044969f0b ("virtio-mem: Implement RamDiscardManager interface")
Signed-off-by: Chenyi Qiang <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Cc: [email protected]
Signed-off-by: David Hildenbrand <[email protected]>


  Commit: 29f1b328e3b767cba2661920a8470738469b9e36
      
https://github.com/qemu/qemu/commit/29f1b328e3b767cba2661920a8470738469b9e36
  Author: Chenyi Qiang <[email protected]>
  Date:   2022-12-28 (Wed, 28 Dec 2022)

  Changed paths:
    M hw/virtio/virtio-mem.c

  Log Message:
  -----------
  virtio-mem: Fix the iterator variable in a vmem->rdl_list loop

It should be the variable rdl2 to revert the already-notified listeners.

Fixes: 2044969f0b ("virtio-mem: Implement RamDiscardManager interface")
Signed-off-by: Chenyi Qiang <[email protected]>
Message-Id: <[email protected]>
Cc: [email protected]
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>


  Commit: 82ba778e1329f6fb89a23d728c680656698d275a
      
https://github.com/qemu/qemu/commit/82ba778e1329f6fb89a23d728c680656698d275a
  Author: Philippe Mathieu-Daudé <[email protected]>
  Date:   2022-12-28 (Wed, 28 Dec 2022)

  Changed paths:
    M hw/virtio/virtio-mem.c

  Log Message:
  -----------
  virtio-mem: Fix typo in function name

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>


  Commit: 6bb613f0812d1364fc8fcf0846647446884d5148
      
https://github.com/qemu/qemu/commit/6bb613f0812d1364fc8fcf0846647446884d5148
  Author: Michal Privoznik <[email protected]>
  Date:   2022-12-28 (Wed, 28 Dec 2022)

  Changed paths:
    M backends/hostmem.c
    M meson.build

  Log Message:
  -----------
  hostmem: Honor multiple preferred nodes if possible

If a memory-backend is configured with mode
HOST_MEM_POLICY_PREFERRED then
host_memory_backend_memory_complete() calls mbind() as:

  mbind(..., MPOL_PREFERRED, nodemask, ...);

Here, 'nodemask' is a bitmap of host NUMA nodes and corresponds
to the .host-nodes attribute. Therefore, there can be multiple
nodes specified. However, the documentation to MPOL_PREFERRED
says:

  MPOL_PREFERRED
    This mode sets the preferred node for allocation. ...
    If nodemask specifies more than one node ID, the first node
    in the mask will be selected as the preferred node.

Therefore, only the first node is honored and the rest is
silently ignored. Well, with recent changes to the kernel and
numactl we can do better.

The Linux kernel added in v5.15 via commit cfcaa66f8032
("mm/hugetlb: add support for mempolicy MPOL_PREFERRED_MANY")
support for MPOL_PREFERRED_MANY, which accepts multiple preferred
NUMA nodes instead.

Then, numa_has_preferred_many() API was introduced to numactl
(v2.0.15~26) allowing applications to query kernel support.

Wiring this all together, we can pass MPOL_PREFERRED_MANY to the
mbind() call instead and stop ignoring multiple nodes, silently.

Signed-off-by: Michal Privoznik <[email protected]>
Message-Id: 
<a0b4adce1af5bd2344c2218eb4a04b3ff7bcfdb4.1671097918.git.mpriv...@redhat.com>
Reviewed-by: David Hildenbrand <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>


  Commit: f8af61fa14441e67300176a5e07671ea395426b3
      
https://github.com/qemu/qemu/commit/f8af61fa14441e67300176a5e07671ea395426b3
  Author: Peter Maydell <[email protected]>
  Date:   2023-01-05 (Thu, 05 Jan 2023)

  Changed paths:
    M backends/hostmem.c
    M hw/virtio/virtio-mem.c
    M meson.build

  Log Message:
  -----------
  Merge tag 'mem-2023-01-02' of https://github.com/davidhildenbrand/qemu into 
staging

Hi,

"Host Memory Backends" and "Memory devices" queue ("mem"):
- virtio-mem fixes
- Use new MPOL_PREFERRED_MANY mbind() policy for memory backends if
  possible

# gpg: Signature made Mon 02 Jan 2023 11:22:04 GMT
# gpg:                using RSA key 1BD9CAAD735C4C3A460DFCCA4DDE10F700FF835A
# gpg:                issuer "[email protected]"
# gpg: Good signature from "David Hildenbrand <[email protected]>" [marginal]
# gpg:                 aka "David Hildenbrand <[email protected]>" 
[full]
# gpg:                 aka "David Hildenbrand <[email protected]>" [unknown]
# Primary key fingerprint: 1BD9 CAAD 735C 4C3A 460D  FCCA 4DDE 10F7 00FF 835A

* tag 'mem-2023-01-02' of https://github.com/davidhildenbrand/qemu:
  hostmem: Honor multiple preferred nodes if possible
  virtio-mem: Fix typo in function name
  virtio-mem: Fix the iterator variable in a vmem->rdl_list loop
  virtio-mem: Fix the bitmap index of the section offset

Signed-off-by: Peter Maydell <[email protected]>


Compare: https://github.com/qemu/qemu/compare/cb9c6a8e5ad6...f8af61fa1444

Reply via email to