diff options
author | Yi Liu <yi.l.liu@intel.com> | 2025-03-21 21:01:39 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2025-03-25 16:18:31 +0300 |
commit | 7fe6b987166b901efc5c6fce5fe853c9ebb835be (patch) | |
tree | 534d7fe14e5d1a11e8daea77c1e42f6504e596ec /tools/perf/scripts/python/parallel-perf.py | |
parent | d57a1fb3425513ec0b02acb9a9f81e5da99b4b85 (diff) | |
download | linux-7fe6b987166b901efc5c6fce5fe853c9ebb835be.tar.xz |
ida: Add ida_find_first_range()
There is no helpers for user to check if a given ID is allocated or not,
neither a helper to loop all the allocated IDs in an IDA and do something
for cleanup. With the two needs, a helper to get the lowest allocated ID
of a range and two variants based on it.
Caller can check if a given ID is allocated or not by:
bool ida_exists(struct ida *ida, unsigned int id)
Caller can iterate all allocated IDs by:
int id;
while ((id = ida_find_first(&pasid_ida)) >= 0) {
//anything to do with the allocated ID
ida_free(pasid_ida, pasid);
}
Link: https://patch.msgid.link/r/20250321180143.8468-2-yi.l.liu@intel.com
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions