Thread (1 message) read the whole thread 1 message, 1 author, 2020-03-13

Re: [v5, PATCH 4/5] cpufreq: mediatek: add opp notification for SVS support

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: 2020-03-13 09:10:45
Also in: linux-arm-kernel, linux-mediatek, linux-pm, lkml

On 13-03-20, 15:22, andrew-sh.cheng wrote:
I have something want to consult you.
For your previous comment, you suggest use read-write lock to replace
mutex lock.
Will it be more efficiently even when all are write lock?
(all lock region are "setting VProc voltage")
The data to be protected here isn't the VProc voltage but the list of
valid OPPs. My idea was if we can make the target() routine run a bit
faster as it really matters as it is called from scheduler hot path.

It won't be wrong to use the mutex the way you have used it right now,
but I think the read lock is much faster, though the read/write lock
is more beneficial in case where there are multiple readers and fewer
writers. The target() routine gets called multiple times here, not
in parallel, and the OPP change notifier won't be called so often.

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