aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/clk.py
diff options
context:
space:
mode:
authorHuang Ying <[email protected]>2024-10-29 20:27:35 +0800
committerAndrew Morton <[email protected]>2024-11-06 13:36:37 -0800
commitd7ce9c73da54a096311edbf4688b78b179dd79bc (patch)
tree4b3b9a6e49833b690b33b93356f29ac5ca8b91fc /scripts/gdb/linux/clk.py
parent77e94b0496ef39b759f23b4ece8c434a4b5c2e47 (diff)
resource: avoid unnecessary resource tree walking in __region_intersects()
Currently, if __region_intersects() finds any overlapped but unmatched resource, it walks the descendant resource tree to check for overlapped and matched descendant resources using for_each_resource(). However, in current kernel, for_each_resource() iterates not only the descendant tree, but also subsequent sibling trees in certain scenarios. While this doesn't introduce bugs, it makes code hard to be understood and potentially inefficient. So, the patch revises next_resource() and for_each_resource() and makes for_each_resource() traverse the subtree under the specified subtree root only. Test shows that this avoids unnecessary resource tree walking in __region_intersects(). For the example resource tree as follows, X | A----D----E | B--C if 'A' is the overlapped but unmatched resource, original kernel iterates 'B', 'C', 'D', 'E' when it walks the descendant tree. While the patched kernel iterates only 'B', 'C'. Thanks David Hildenbrand for providing a good resource tree example. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: "Huang, Ying" <[email protected]> Acked-by: Dan Williams <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: Alistair Popple <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Baoquan He <[email protected]> Cc: Dave Jiang <[email protected]> Cc: Alison Schofield <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/clk.py')
0 files changed, 0 insertions, 0 deletions