diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2025-02-19 01:22:03 +0300 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2025-02-27 21:55:54 +0300 |
commit | eb996eec783c1e7e1e9c62e0336f8b86a08cf541 (patch) | |
tree | b93a3e222126a1702ce830204bbbdaeee57b99d0 /tools/perf/scripts/python/gecko.py | |
parent | 7a701e90fc8e3d7a7d07246b14c59a2da258539a (diff) | |
download | linux-eb996eec783c1e7e1e9c62e0336f8b86a08cf541.tar.xz |
vfio/type1: Use vfio_batch for vaddr_get_pfns()
Passing the vfio_batch to vaddr_get_pfns() allows for greater
distinction between page backed pfns and pfnmaps. In the case of page
backed pfns, vfio_batch.size is set to a positive value matching the
number of pages filled in vfio_batch.pages. For a pfnmap,
vfio_batch.size remains zero as vfio_batch.pages are not used. In both
cases the return value continues to indicate the number of pfns and the
provided pfn arg is set to the initial pfn value.
This allows us to shortcut the pfnmap case, which is detected by the
zero vfio_batch.size. pfnmaps do not contribute to locked memory
accounting, therefore we can update counters and continue directly,
which also enables a future where vaddr_get_pfns() can return a value
greater than one for consecutive pfnmaps.
NB. Now that we're not guessing whether the initial pfn is page backed
or pfnmap, we no longer need to special case the put_pfn() and batch
size reset. It's safe for vfio_batch_unpin() to handle this case.
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Tested-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Link: https://lore.kernel.org/r/20250218222209.1382449-4-alex.williamson@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions