diff options
| author | Ming Lei <ming.lei@redhat.com> | 2026-03-31 23:31:55 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-04-07 07:40:19 -0600 |
| commit | 8a34e88769f617dc980edb5a0079e347bd1b9a89 (patch) | |
| tree | 601231c64a8915fd4d9e91aae150e3c453fc414a /tools/perf/scripts/python | |
| parent | 08677040a91199175149d1fd465c02e3b3fc768a (diff) | |
ublk: eliminate permanent pages[] array from struct ublk_buf
The pages[] array (kvmalloc'd, 8 bytes per page = 2MB for a 1GB buffer)
was stored permanently in struct ublk_buf but only needed during
pin_user_pages_fast() and maple tree construction. Since the maple tree
already stores PFN ranges via ublk_buf_range, struct page pointers can
be recovered via pfn_to_page() during unregistration.
Make pages[] a temporary allocation in ublk_ctrl_reg_buf(), freed
immediately after the maple tree is built. Rewrite __ublk_ctrl_unreg_buf()
to iterate the maple tree for matching buf_index entries, recovering
struct page pointers via pfn_to_page() and unpinning in batches of 32.
Simplify ublk_buf_erase_ranges() to iterate the maple tree by buf_index
instead of walking the now-removed pages[] array.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://patch.msgid.link/20260331153207.3635125-5-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
