[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] device-tree: optimize dt_device_for_passthrough()
On 12/02/2025 10:16, Grygorii Strashko wrote: Also, I agree with Michal, if this is a concern for dt_device_device_for_passthrough(). Then it would be a concern for a few others calls using dt_find_property(). Are you going to modify all of them?I follow the rule one patch one functional change. Regarding further optimization - I think only generic properties can be optimized and personally I see now only "xen,passthrough" and may be "status".Ok. 20 microseconds. it's probably more like a measurement error margin. Please advice if i should continue or drop?See above. Regardless that, would you be able to provide a bit more information of your end goal?Are you intending to be able to boot Xen/ dom0/dom0less guest in less than N milliseconds?How far are you from that target? Are those numbers done on the latest Xen? It's more like result of code studying from my side as Xen newbie. I've considered it as kinda "obvious" change - calc some value once is Thi i better then do the same calculations many times. To clarify, there are a lot of call to the function. But you also have a DT with 700 nodes. So effectively, you will call it ~4 times per node. But really, the issue is not the number of calls. The issue is that the property lookup function is expensive because there are many string comparisons. > Ok, it's not obvious. I'll drop it.It is a trade-off between speed, memory usage and maintenability. With your approach, we would need to look up for all the properties we care in advance and cache the result. For bool property, the memory usage increase is not "bad". However, it would require more memory if the property value is a string, multiple cells... What I would find more interesting is whether we can optimize the function doing the property lookup. This would benefits everyone rather than just a select few and depending on the result (speed, memory usage) I would definitely consider to include in Xen. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |