Thread (9 messages) 9 messages, 3 authors, 2018-01-26

Re: [PATCH] of: use hash based search in of_find_node_by_phandle

From: Rob Herring <robh+dt@kernel.org>
Date: 2018-01-26 15:21:25
Also in: linux-arm-msm, lkml

On Fri, Jan 26, 2018 at 1:22 AM, Chintan Pandya [off-list ref] wrote:
On 1/25/2018 8:20 PM, Rob Herring wrote:
quoted
On Thu, Jan 25, 2018 at 4:14 AM, Chintan Pandya [off-list ref]
wrote:
quoted
[...]
quoted
I'd guess that there's really only a few phandle lookups that occur
over and over.
On my system, there are ~6.7k calls of this API during boot.
And after boot it will be near 0 yet we carry the memory usage forever.
quoted
The clock controller, interrupt controller, etc. What
if you just had a simple array of previously found nodes for a cache
and of_find_node_by_phandle can check that array first. Probably 8-16
entries would be enough.
I clearly see repeat calling with same phandle. But I have few hundreds of
nodes.
I see hashing as generic optimization which applies equally good to all
sized DT.
Using ~4KB more size to save 400 ms is a good trade-off, I believe.
But if you can use 200 bytes and save 350 ms, that would be a better
trade off IMO. But we don't know because we have no data.

Rob
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help