All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] memory/samsung: reduce unnecessary mutex lock area
@ 2020-05-12 11:40 Markus Elfring
  2020-05-12 11:56   ` Lukasz Luba
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Elfring @ 2020-05-12 11:40 UTC (permalink / raw)
  To: Bernard Zhao, linux-arm-kernel, linux-pm, linux-samsung-soc
  Cc: linux-kernel, opensource.kernel, Krzysztof Kozlowski, Kukjin Kim,
	Lukasz Luba

> Maybe dmc->df->lock seems not needed to protect "if (ret)
> & dev_warn" branch. Maybe this change speed up the code a bit.

I suggest to improve also this commit message.

* Please reduce uncertainty.

* An imperative wording is probably preferred, isn't it?
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=152036d1379ffd6985262743dcf6b0f9c75f83a4#n151

* Will it be more appropriate to refer to the transformation “Reduce the lock scope”?

* Would you like to add the tag “Fixes” to the change description?

Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] memory/samsung: reduce unnecessary mutex lock area
  2020-05-12 11:40 [PATCH v2] memory/samsung: reduce unnecessary mutex lock area Markus Elfring
@ 2020-05-12 11:56   ` Lukasz Luba
  0 siblings, 0 replies; 11+ messages in thread
From: Lukasz Luba @ 2020-05-12 11:56 UTC (permalink / raw)
  To: Markus Elfring, Bernard Zhao, linux-arm-kernel, linux-pm,
	linux-samsung-soc
  Cc: linux-kernel, opensource.kernel, Krzysztof Kozlowski, Kukjin Kim



On 5/12/20 12:40 PM, Markus Elfring wrote:
>> Maybe dmc->df->lock seems not needed to protect "if (ret)
>> & dev_warn" branch. Maybe this change speed up the code a bit.
> 
> I suggest to improve also this commit message.
> 
> * Please reduce uncertainty.
> 
> * An imperative wording is probably preferred, isn't it?
>    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=152036d1379ffd6985262743dcf6b0f9c75f83a4#n151
> 
> * Will it be more appropriate to refer to the transformation “Reduce the lock scope”?
> 
> * Would you like to add the tag “Fixes” to the change description?
> 
> Regards,
> Markus
> 

Thank you Markus for providing to Bernard helpful suggestions.

@Bernard please read the link above and send v3

Something like: 'memory/samsung: reduce protected code area in IRQ
handler' for the subject header would be better.
Then in the message explain (without 'maybe') that it will speed-up a
bit this IRQ processing and there is no need to protect return value or
printing.

Regards,
Lukasz

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] memory/samsung: reduce unnecessary mutex lock area
@ 2020-05-12 11:56   ` Lukasz Luba
  0 siblings, 0 replies; 11+ messages in thread
From: Lukasz Luba @ 2020-05-12 11:56 UTC (permalink / raw)
  To: Markus Elfring, Bernard Zhao, linux-arm-kernel, linux-pm,
	linux-samsung-soc
  Cc: opensource.kernel, Kukjin Kim, linux-kernel, Krzysztof Kozlowski



On 5/12/20 12:40 PM, Markus Elfring wrote:
>> Maybe dmc->df->lock seems not needed to protect "if (ret)
>> & dev_warn" branch. Maybe this change speed up the code a bit.
> 
> I suggest to improve also this commit message.
> 
> * Please reduce uncertainty.
> 
> * An imperative wording is probably preferred, isn't it?
>    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=152036d1379ffd6985262743dcf6b0f9c75f83a4#n151
> 
> * Will it be more appropriate to refer to the transformation “Reduce the lock scope”?
> 
> * Would you like to add the tag “Fixes” to the change description?
> 
> Regards,
> Markus
> 

Thank you Markus for providing to Bernard helpful suggestions.

@Bernard please read the link above and send v3

Something like: 'memory/samsung: reduce protected code area in IRQ
handler' for the subject header would be better.
Then in the message explain (without 'maybe') that it will speed-up a
bit this IRQ processing and there is no need to protect return value or
printing.

Regards,
Lukasz

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re:Re: [PATCH v2] memory/samsung: reduce unnecessary mutex lock area
  2020-05-12 11:56   ` Lukasz Luba
@ 2020-05-12 12:31     ` Bernard
  -1 siblings, 0 replies; 11+ messages in thread
From: Bernard @ 2020-05-12 12:31 UTC (permalink / raw)
  To: Lukasz Luba
  Cc: Markus Elfring, linux-arm-kernel, linux-pm, linux-samsung-soc,
	linux-kernel, opensource.kernel, Krzysztof Kozlowski, Kukjin Kim



From: Lukasz Luba <lukasz.luba@arm.com>
Date: 2020-05-12 19:56:49
To:  Markus Elfring <Markus.Elfring@web.de>,Bernard Zhao <bernard@vivo.com>,linux-arm-kernel@lists.infradead.org,linux-pm@vger.kernel.org,linux-samsung-soc@vger.kernel.org
Cc:  linux-kernel@vger.kernel.org,opensource.kernel@vivo.com,Krzysztof Kozlowski <krzk@kernel.org>,Kukjin Kim <kgene@kernel.org>
Subject: Re: [PATCH v2] memory/samsung: reduce unnecessary mutex lock area>
>
>On 5/12/20 12:40 PM, Markus Elfring wrote:
>>> Maybe dmc->df->lock seems not needed to protect "if (ret)
>>> & dev_warn" branch. Maybe this change speed up the code a bit.
>> 
>> I suggest to improve also this commit message.
>> 
>> * Please reduce uncertainty.
>> 
>> * An imperative wording is probably preferred, isn't it?
>>    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=152036d1379ffd6985262743dcf6b0f9c75f83a4#n151
>> 
>> * Will it be more appropriate to refer to the transformation “Reduce the lock scope”?
>> 
>> * Would you like to add the tag “Fixes” to the change description?
>> 
>> Regards,
>> Markus
>> 
>
>Thank you Markus for providing to Bernard helpful suggestions.
>
>@Bernard please read the link above and send v3
>
>Something like: 'memory/samsung: reduce protected code area in IRQ
>handler' for the subject header would be better.
>Then in the message explain (without 'maybe') that it will speed-up a
>bit this IRQ processing and there is no need to protect return value or
>printing.
>
>Regards,

>Lukasz

Sure, thank you both Markus & Lukasz for your helpful suggestions, I will read the content
of the link in detail and use that preferred format in my future subsequent submissions.

Regards,
Bernard


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re:Re: [PATCH v2] memory/samsung: reduce unnecessary mutex lock area
@ 2020-05-12 12:31     ` Bernard
  0 siblings, 0 replies; 11+ messages in thread
From: Bernard @ 2020-05-12 12:31 UTC (permalink / raw)
  To: Lukasz Luba
  Cc: opensource.kernel, linux-samsung-soc, linux-pm, linux-kernel,
	Krzysztof Kozlowski, Kukjin Kim, Markus Elfring,
	linux-arm-kernel



From: Lukasz Luba <lukasz.luba@arm.com>
Date: 2020-05-12 19:56:49
To:  Markus Elfring <Markus.Elfring@web.de>,Bernard Zhao <bernard@vivo.com>,linux-arm-kernel@lists.infradead.org,linux-pm@vger.kernel.org,linux-samsung-soc@vger.kernel.org
Cc:  linux-kernel@vger.kernel.org,opensource.kernel@vivo.com,Krzysztof Kozlowski <krzk@kernel.org>,Kukjin Kim <kgene@kernel.org>
Subject: Re: [PATCH v2] memory/samsung: reduce unnecessary mutex lock area>
>
>On 5/12/20 12:40 PM, Markus Elfring wrote:
>>> Maybe dmc->df->lock seems not needed to protect "if (ret)
>>> & dev_warn" branch. Maybe this change speed up the code a bit.
>> 
>> I suggest to improve also this commit message.
>> 
>> * Please reduce uncertainty.
>> 
>> * An imperative wording is probably preferred, isn't it?
>>    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=152036d1379ffd6985262743dcf6b0f9c75f83a4#n151
>> 
>> * Will it be more appropriate to refer to the transformation “Reduce the lock scope”?
>> 
>> * Would you like to add the tag “Fixes” to the change description?
>> 
>> Regards,
>> Markus
>> 
>
>Thank you Markus for providing to Bernard helpful suggestions.
>
>@Bernard please read the link above and send v3
>
>Something like: 'memory/samsung: reduce protected code area in IRQ
>handler' for the subject header would be better.
>Then in the message explain (without 'maybe') that it will speed-up a
>bit this IRQ processing and there is no need to protect return value or
>printing.
>
>Regards,

>Lukasz

Sure, thank you both Markus & Lukasz for your helpful suggestions, I will read the content
of the link in detail and use that preferred format in my future subsequent submissions.

Regards,
Bernard

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [v2] memory/samsung: reduce unnecessary mutex lock area
  2020-05-12 11:56   ` Lukasz Luba
@ 2020-05-12 12:32     ` Markus Elfring
  -1 siblings, 0 replies; 11+ messages in thread
From: Markus Elfring @ 2020-05-12 12:32 UTC (permalink / raw)
  To: Lukasz Luba, Bernard Zhao, linux-arm-kernel, linux-pm, linux-samsung-soc
  Cc: linux-kernel, opensource.kernel, Krzysztof Kozlowski, Kukjin Kim

> Something like: 'memory/samsung: reduce protected code area in IRQ
> handler' for the subject header would be better.
> Then in the message explain (without 'maybe') that it will speed-up a
> bit this IRQ processing and there is no need to protect return value
> or printing.

Do you tend to prefer smaller lock scopes for nicer run time characteristics?

Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [v2] memory/samsung: reduce unnecessary mutex lock area
@ 2020-05-12 12:32     ` Markus Elfring
  0 siblings, 0 replies; 11+ messages in thread
From: Markus Elfring @ 2020-05-12 12:32 UTC (permalink / raw)
  To: Lukasz Luba, Bernard Zhao, linux-arm-kernel, linux-pm, linux-samsung-soc
  Cc: opensource.kernel, Kukjin Kim, linux-kernel, Krzysztof Kozlowski

> Something like: 'memory/samsung: reduce protected code area in IRQ
> handler' for the subject header would be better.
> Then in the message explain (without 'maybe') that it will speed-up a
> bit this IRQ processing and there is no need to protect return value
> or printing.

Do you tend to prefer smaller lock scopes for nicer run time characteristics?

Regards,
Markus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [v2] memory/samsung: reduce unnecessary mutex lock area
  2020-05-12 12:32     ` Markus Elfring
@ 2020-05-12 12:48       ` Lukasz Luba
  -1 siblings, 0 replies; 11+ messages in thread
From: Lukasz Luba @ 2020-05-12 12:48 UTC (permalink / raw)
  To: Markus Elfring, Bernard Zhao, linux-arm-kernel, linux-pm,
	linux-samsung-soc
  Cc: linux-kernel, opensource.kernel, Krzysztof Kozlowski, Kukjin Kim



On 5/12/20 1:32 PM, Markus Elfring wrote:
>> Something like: 'memory/samsung: reduce protected code area in IRQ
>> handler' for the subject header would be better.
>> Then in the message explain (without 'maybe') that it will speed-up a
>> bit this IRQ processing and there is no need to protect return value
>> or printing.
> 
> Do you tend to prefer smaller lock scopes for nicer run time characteristics?

Yes and I am probably not the only one. Of course it consumes time, to
make and test this kind of changes (so it must be in my current scope
of work).

Regards,
Lukasz

> 
> Regards,
> Markus
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [v2] memory/samsung: reduce unnecessary mutex lock area
@ 2020-05-12 12:48       ` Lukasz Luba
  0 siblings, 0 replies; 11+ messages in thread
From: Lukasz Luba @ 2020-05-12 12:48 UTC (permalink / raw)
  To: Markus Elfring, Bernard Zhao, linux-arm-kernel, linux-pm,
	linux-samsung-soc
  Cc: opensource.kernel, Kukjin Kim, linux-kernel, Krzysztof Kozlowski



On 5/12/20 1:32 PM, Markus Elfring wrote:
>> Something like: 'memory/samsung: reduce protected code area in IRQ
>> handler' for the subject header would be better.
>> Then in the message explain (without 'maybe') that it will speed-up a
>> bit this IRQ processing and there is no need to protect return value
>> or printing.
> 
> Do you tend to prefer smaller lock scopes for nicer run time characteristics?

Yes and I am probably not the only one. Of course it consumes time, to
make and test this kind of changes (so it must be in my current scope
of work).

Regards,
Lukasz

> 
> Regards,
> Markus
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] memory/samsung: reduce unnecessary mutex lock area
@ 2020-05-12 11:08 ` Bernard Zhao
  0 siblings, 0 replies; 11+ messages in thread
From: Bernard Zhao @ 2020-05-12 11:08 UTC (permalink / raw)
  To: Lukasz Luba, Kukjin Kim, Krzysztof Kozlowski, linux-pm,
	linux-samsung-soc, linux-arm-kernel, linux-kernel
  Cc: opensource.kernel, Bernard Zhao

Maybe dmc->df->lock seems not needed to protect "if (ret)
& dev_warn" branch. Maybe this change speed up the code a bit.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
----
Changes since v1:
*change release lock before the if statement.
*revert dmc->df->lock mutex lock to protect function
exynos5_dmc_perf_events_check
Link for V1:
*https://lore.kernel.org/patchwork/patch/1238888/
---
 drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index 22a43d662833..25196d6268e2 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -1346,15 +1346,13 @@ static irqreturn_t dmc_irq_thread(int irq, void *priv)
 	struct exynos5_dmc *dmc = priv;
 
 	mutex_lock(&dmc->df->lock);
-
 	exynos5_dmc_perf_events_check(dmc);
-
 	res = update_devfreq(dmc->df);
+	mutex_unlock(&dmc->df->lock);
+
 	if (res)
 		dev_warn(dmc->dev, "devfreq failed with %d\n", res);
 
-	mutex_unlock(&dmc->df->lock);
-
 	return IRQ_HANDLED;
 }
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2] memory/samsung: reduce unnecessary mutex lock area
@ 2020-05-12 11:08 ` Bernard Zhao
  0 siblings, 0 replies; 11+ messages in thread
From: Bernard Zhao @ 2020-05-12 11:08 UTC (permalink / raw)
  To: Lukasz Luba, Kukjin Kim, Krzysztof Kozlowski, linux-pm,
	linux-samsung-soc, linux-arm-kernel, linux-kernel
  Cc: opensource.kernel, Bernard Zhao

Maybe dmc->df->lock seems not needed to protect "if (ret)
& dev_warn" branch. Maybe this change speed up the code a bit.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
----
Changes since v1:
*change release lock before the if statement.
*revert dmc->df->lock mutex lock to protect function
exynos5_dmc_perf_events_check
Link for V1:
*https://lore.kernel.org/patchwork/patch/1238888/
---
 drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index 22a43d662833..25196d6268e2 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -1346,15 +1346,13 @@ static irqreturn_t dmc_irq_thread(int irq, void *priv)
 	struct exynos5_dmc *dmc = priv;
 
 	mutex_lock(&dmc->df->lock);
-
 	exynos5_dmc_perf_events_check(dmc);
-
 	res = update_devfreq(dmc->df);
+	mutex_unlock(&dmc->df->lock);
+
 	if (res)
 		dev_warn(dmc->dev, "devfreq failed with %d\n", res);
 
-	mutex_unlock(&dmc->df->lock);
-
 	return IRQ_HANDLED;
 }
 
-- 
2.26.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-05-12 12:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 11:40 [PATCH v2] memory/samsung: reduce unnecessary mutex lock area Markus Elfring
2020-05-12 11:56 ` Lukasz Luba
2020-05-12 11:56   ` Lukasz Luba
2020-05-12 12:31   ` Bernard
2020-05-12 12:31     ` Bernard
2020-05-12 12:32   ` [v2] " Markus Elfring
2020-05-12 12:32     ` Markus Elfring
2020-05-12 12:48     ` Lukasz Luba
2020-05-12 12:48       ` Lukasz Luba
  -- strict thread matches above, loose matches on Subject: below --
2020-05-12 11:08 [PATCH v2] " Bernard Zhao
2020-05-12 11:08 ` Bernard Zhao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.