qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] b11cf3: virtio-mem: Fix the bitmap index of t


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] b11cf3: virtio-mem: Fix the bitmap index of the section of...
Date: Thu, 05 Jan 2023 06:05:57 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: b11cf32e07a2f7ff0d171b89497381a04c9d07e0
      
https://github.com/qemu/qemu/commit/b11cf32e07a2f7ff0d171b89497381a04c9d07e0
  Author: Chenyi Qiang <chenyi.qiang@intel.com>
  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 <chenyi.qiang@intel.com>
Message-Id: <20221216062231.11181-1-chenyi.qiang@intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: 29f1b328e3b767cba2661920a8470738469b9e36
      
https://github.com/qemu/qemu/commit/29f1b328e3b767cba2661920a8470738469b9e36
  Author: Chenyi Qiang <chenyi.qiang@intel.com>
  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 <chenyi.qiang@intel.com>
Message-Id: <20221228090312.17276-1-chenyi.qiang@intel.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: 82ba778e1329f6fb89a23d728c680656698d275a
      
https://github.com/qemu/qemu/commit/82ba778e1329f6fb89a23d728c680656698d275a
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  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é <philmd@linaro.org>
Message-Id: <20221228130956.80515-1-philmd@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: 6bb613f0812d1364fc8fcf0846647446884d5148
      
https://github.com/qemu/qemu/commit/6bb613f0812d1364fc8fcf0846647446884d5148
  Author: Michal Privoznik <mprivozn@redhat.com>
  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 <mprivozn@redhat.com>
Message-Id: 
<a0b4adce1af5bd2344c2218eb4a04b3ff7bcfdb4.1671097918.git.mprivozn@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>


  Commit: f8af61fa14441e67300176a5e07671ea395426b3
      
https://github.com/qemu/qemu/commit/f8af61fa14441e67300176a5e07671ea395426b3
  Author: Peter Maydell <peter.maydell@linaro.org>
  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 "david@redhat.com"
# gpg: Good signature from "David Hildenbrand <david@redhat.com>" [marginal]
# gpg:                 aka "David Hildenbrand <davidhildenbrand@gmail.com>" 
[full]
# gpg:                 aka "David Hildenbrand <hildenbr@in.tum.de>" [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 <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/3bd6c1f332e2...f8af61fa1444



reply via email to

[Prev in Thread] Current Thread [Next in Thread]