From: Lukasz Luba <lukasz.luba@arm.com>
To: Krzysztof Kozlowski <krzk@kernel.org>, Bernard Zhao <bernard@vivo.com>
Cc: Kukjin Kim <kgene@kernel.org>,
linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, opensource.kernel@vivo.com
Subject: Re: [PATCH] memory/samsung: reduce unnecessary mutex lock area
Date: Tue, 12 May 2020 09:47:19 +0100 [thread overview]
Message-ID: <e762ce12-eff0-d3a5-f083-2b592921de59@arm.com> (raw)
In-Reply-To: <20200512065023.GA10741@kozik-lap>
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@vivo.com>
>> ---
>> 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
>
next prev parent reply other threads:[~2020-05-12 8:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 13:13 Bernard Zhao
2020-05-12 6:50 ` Krzysztof Kozlowski
2020-05-12 8:47 ` Lukasz Luba [this message]
2020-05-12 9:05 ` Krzysztof Kozlowski
2020-05-12 9:19 ` Bernard
2020-05-12 9:23 ` Lukasz Luba
2020-05-08 18:27 Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e762ce12-eff0-d3a5-f083-2b592921de59@arm.com \
--to=lukasz.luba@arm.com \
--cc=bernard@vivo.com \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=opensource.kernel@vivo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®