Re: [PATCH] memory/samsung: reduce unnecessary mutex lock area

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Krzysztof,

I am sorry, I was a bit busy recently.

On 5/12/20 7:50 AM, Krzysztof Kozlowski wrote:
On Fri, May 08, 2020 at 06:13:38AM -0700, Bernard Zhao wrote:
Maybe dmc->df->lock is unnecessary to protect function
exynos5_dmc_perf_events_check(dmc). If we have to protect,
dmc->lock is more better and more effective.
Also, it seems not needed to protect "if (ret) & dev_warn"
branch.

Signed-off-by: Bernard Zhao <bernard@xxxxxxxx>
---
  drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

I checked the concurrent accesses and it looks correct.

Lukasz, any review from your side?

The lock from devfreq lock protects from a scenario when
concurrent access from devfreq framework uses internal dmc fields 'load' and 'total' (which are set to 'busy_time', 'total_time').
The .get_dev_status can be called at any time (even due to thermal
devfreq cooling action) and reads above fields.
That's why the calculation of the new values inside dmc is protected.

This patch should not be taken IMO. Maybe we can release lock before the
if statement, just to speed-up.

Regards,
Lukasz



Best regards,
Krzysztof




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux for Synopsys ARC Processors]    
  • [Linux on Unisoc (RDA Micro) SoCs]     [Linux Actions SoC]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  •   Powered by Linux