[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC 2/8] numa: call ->ram_block_removed() in ram_block_notifer_remo
From: |
David Hildenbrand |
Subject: |
Re: [RFC 2/8] numa: call ->ram_block_removed() in ram_block_notifer_remove() |
Date: |
Wed, 30 Mar 2022 10:42:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 |
On 23.03.22 12:17, Stefan Hajnoczi wrote:
> When a RAMBlockNotifier is added, ->ram_block_added() is called with all
> existing RAMBlocks. There is no equivalent ->ram_block_removed() call
> when a RAMBlockNotifier is removed.
>
> The util/vfio-helpers.c code (the sole user of RAMBlockNotifier) is fine
> with this asymmetry because it does not rely on RAMBlockNotifier for
> cleanup. It walks its internal list of DMA mappings and unmaps them by
> itself.
>
> Future users of RAMBlockNotifier may not have an internal data structure
> that records added RAMBlocks so they will need ->ram_block_removed()
> callbacks.
>
> This patch makes ram_block_notifier_remove() symmetric with respect to
> callbacks. Now util/vfio-helpers.c needs to unmap remaining DMA mappings
> after ram_block_notifier_remove() has been called. This is necessary
> since users like block/nvme.c may create additional DMA mappings that do
> not originate from the RAMBlockNotifier.
>
> Cc: David Hildenbrand <david@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
- [RFC 0/8] blkio: add libblkio BlockDriver, Stefan Hajnoczi, 2022/03/23
- [RFC 2/8] numa: call ->ram_block_removed() in ram_block_notifer_remove(), Stefan Hajnoczi, 2022/03/23
- Re: [RFC 2/8] numa: call ->ram_block_removed() in ram_block_notifer_remove(),
David Hildenbrand <=
- [RFC 5/8] block: add BlockRAMRegistrar, Stefan Hajnoczi, 2022/03/23
- [RFC 1/8] blkio: add io_uring block driver using libblkio, Stefan Hajnoczi, 2022/03/23
- [RFC 6/8] stubs: add memory_region_from_host() and memory_region_get_fd(), Stefan Hajnoczi, 2022/03/23
- [RFC 3/8] block: pass size to bdrv_unregister_buf(), Stefan Hajnoczi, 2022/03/23
- [RFC 7/8] blkio: implement BDRV_REQ_REGISTERED_BUF optimization, Stefan Hajnoczi, 2022/03/23
- [RFC 8/8] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint, Stefan Hajnoczi, 2022/03/23
- [RFC 4/8] block: add BDRV_REQ_REGISTERED_BUF request flag, Stefan Hajnoczi, 2022/03/23
- Re: [RFC 0/8] blkio: add libblkio BlockDriver, Stefano Garzarella, 2022/03/29