Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ion: Cache the result from ion_cma_has_kernel_mapping()
The result from ion_cma_has_kernel_mapping() will always be the same, since it's just reading a property from the device tree. The repeated device tree lookup adds up though, so it's helpful to cache the result. This fixes the following irqsoff tracer report where IRQs are disabled for over a millisecond, which happens quite often: # tracer: irqsoff # # irqsoff latency trace v1.1.5 on 4.14.212-Sultan # -------------------------------------------------------------------- # latency: 1173 us, #4/4, CPU#2 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8) # ----------------- # | task: HwBinder:682_1-696 (uid:1000 nice:0 policy:2 rt_prio:1) # ----------------- # => started at: of_phandle_iterator_next # => ended at: of_phandle_iterator_next # # # _------=> CPU# # / _-----=> irqs-off # | / _----=> need-resched # || / _---=> hardirq/softirq # ||| / _--=> preempt-depth # |||| / delay # cmd pid ||||| time | caller # \ / ||||| \ | / <...>-696 2d... 0us#: of_find_node_by_phandle <-of_phandle_iterator_next <...>-696 2d..1 1172us : of_find_node_by_phandle <-of_phandle_iterator_next <...>-696 2d..1 1174us : trace_hardirqs_on <-of_phandle_iterator_next <...>-696 2d..1 1177us : <stack trace> => of_parse_phandle => ion_cma_allocate => ion_secure_cma_allocate => ion_alloc_dmabuf => ion_ioctl => vfs_ioctl => do_vfs_ioctl => SyS_ioctl => el0_svc_naked Signed-off-by: Sultan Alsawaf <[email protected]> Signed-off-by: Zlatan Radovanovic <[email protected]> Signed-off-by: onettboots <[email protected]>
- Loading branch information