linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended
@ 2023-11-08 21:53 Namhyung Kim
  2023-11-20 20:28 ` Namhyung Kim
  2024-02-28 12:53 ` [tip: locking/core] " tip-bot2 for Namhyung Kim
  0 siblings, 2 replies; 7+ messages in thread
From: Namhyung Kim @ 2023-11-08 21:53 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon; +Cc: Waiman Long, Boqun Feng, LKML

It mistakenly fires lock contention tracepoints always in the writer path.
It should be conditional on the try lock result.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 kernel/locking/percpu-rwsem.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
index 185bd1c906b0..6083883c4fe0 100644
--- a/kernel/locking/percpu-rwsem.c
+++ b/kernel/locking/percpu-rwsem.c
@@ -223,9 +223,10 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
 
 void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
 {
+	bool contended = false;
+
 	might_sleep();
 	rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
-	trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
 
 	/* Notify readers to take the slow path. */
 	rcu_sync_enter(&sem->rss);
@@ -234,8 +235,11 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
 	 * Try set sem->block; this provides writer-writer exclusion.
 	 * Having sem->block set makes new readers block.
 	 */
-	if (!__percpu_down_write_trylock(sem))
+	if (!__percpu_down_write_trylock(sem)) {
+		trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
 		percpu_rwsem_wait(sem, /* .reader = */ false);
+		contended = true;
+	}
 
 	/* smp_mb() implied by __percpu_down_write_trylock() on success -- D matches A */
 
@@ -247,7 +251,8 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
 
 	/* Wait for all active readers to complete. */
 	rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE);
-	trace_contention_end(sem, 0);
+	if (contended)
+		trace_contention_end(sem, 0);
 }
 EXPORT_SYMBOL_GPL(percpu_down_write);
 
-- 
2.42.0.869.gea05f2083d-goog


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

* Re: [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended
  2023-11-08 21:53 [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended Namhyung Kim
@ 2023-11-20 20:28 ` Namhyung Kim
  2024-02-27 23:02   ` Namhyung Kim
  2024-02-28 12:53 ` [tip: locking/core] " tip-bot2 for Namhyung Kim
  1 sibling, 1 reply; 7+ messages in thread
From: Namhyung Kim @ 2023-11-20 20:28 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon; +Cc: Waiman Long, Boqun Feng, LKML

Ping!

On Wed, Nov 8, 2023 at 1:53 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> It mistakenly fires lock contention tracepoints always in the writer path.
> It should be conditional on the try lock result.
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  kernel/locking/percpu-rwsem.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
> index 185bd1c906b0..6083883c4fe0 100644
> --- a/kernel/locking/percpu-rwsem.c
> +++ b/kernel/locking/percpu-rwsem.c
> @@ -223,9 +223,10 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
>
>  void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
>  {
> +       bool contended = false;
> +
>         might_sleep();
>         rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
> -       trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
>
>         /* Notify readers to take the slow path. */
>         rcu_sync_enter(&sem->rss);
> @@ -234,8 +235,11 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
>          * Try set sem->block; this provides writer-writer exclusion.
>          * Having sem->block set makes new readers block.
>          */
> -       if (!__percpu_down_write_trylock(sem))
> +       if (!__percpu_down_write_trylock(sem)) {
> +               trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
>                 percpu_rwsem_wait(sem, /* .reader = */ false);
> +               contended = true;
> +       }
>
>         /* smp_mb() implied by __percpu_down_write_trylock() on success -- D matches A */
>
> @@ -247,7 +251,8 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
>
>         /* Wait for all active readers to complete. */
>         rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE);
> -       trace_contention_end(sem, 0);
> +       if (contended)
> +               trace_contention_end(sem, 0);
>  }
>  EXPORT_SYMBOL_GPL(percpu_down_write);
>
> --
> 2.42.0.869.gea05f2083d-goog
>

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

* Re: [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended
  2023-11-20 20:28 ` Namhyung Kim
@ 2024-02-27 23:02   ` Namhyung Kim
  2024-02-28  0:18     ` Waiman Long
  0 siblings, 1 reply; 7+ messages in thread
From: Namhyung Kim @ 2024-02-27 23:02 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon; +Cc: Waiman Long, Boqun Feng, LKML

Hello,

On Mon, Nov 20, 2023 at 12:28 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> Ping!
>
> On Wed, Nov 8, 2023 at 1:53 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > It mistakenly fires lock contention tracepoints always in the writer path.
> > It should be conditional on the try lock result.

Can anybody take a look at this?  This makes a large noise
in the lock contention result.

Thanks,
Namhyung

> >
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> >  kernel/locking/percpu-rwsem.c | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
> > index 185bd1c906b0..6083883c4fe0 100644
> > --- a/kernel/locking/percpu-rwsem.c
> > +++ b/kernel/locking/percpu-rwsem.c
> > @@ -223,9 +223,10 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
> >
> >  void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> >  {
> > +       bool contended = false;
> > +
> >         might_sleep();
> >         rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
> > -       trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
> >
> >         /* Notify readers to take the slow path. */
> >         rcu_sync_enter(&sem->rss);
> > @@ -234,8 +235,11 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> >          * Try set sem->block; this provides writer-writer exclusion.
> >          * Having sem->block set makes new readers block.
> >          */
> > -       if (!__percpu_down_write_trylock(sem))
> > +       if (!__percpu_down_write_trylock(sem)) {
> > +               trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
> >                 percpu_rwsem_wait(sem, /* .reader = */ false);
> > +               contended = true;
> > +       }
> >
> >         /* smp_mb() implied by __percpu_down_write_trylock() on success -- D matches A */
> >
> > @@ -247,7 +251,8 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> >
> >         /* Wait for all active readers to complete. */
> >         rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE);
> > -       trace_contention_end(sem, 0);
> > +       if (contended)
> > +               trace_contention_end(sem, 0);
> >  }
> >  EXPORT_SYMBOL_GPL(percpu_down_write);
> >
> > --
> > 2.42.0.869.gea05f2083d-goog
> >

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

* Re: [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended
  2024-02-27 23:02   ` Namhyung Kim
@ 2024-02-28  0:18     ` Waiman Long
  2024-02-28  0:49       ` Namhyung Kim
  2024-02-28 12:50       ` Ingo Molnar
  0 siblings, 2 replies; 7+ messages in thread
From: Waiman Long @ 2024-02-28  0:18 UTC (permalink / raw)
  To: Namhyung Kim, Peter Zijlstra, Ingo Molnar, Will Deacon; +Cc: Boqun Feng, LKML


On 2/27/24 18:02, Namhyung Kim wrote:
> Hello,
>
> On Mon, Nov 20, 2023 at 12:28 PM Namhyung Kim <namhyung@kernel.org> wrote:
>> Ping!
>>
>> On Wed, Nov 8, 2023 at 1:53 PM Namhyung Kim <namhyung@kernel.org> wrote:
>>> It mistakenly fires lock contention tracepoints always in the writer path.
>>> It should be conditional on the try lock result.
> Can anybody take a look at this?  This makes a large noise
> in the lock contention result.
>
> Thanks,
> Namhyung
>
>>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>>> ---
>>>   kernel/locking/percpu-rwsem.c | 11 ++++++++---
>>>   1 file changed, 8 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
>>> index 185bd1c906b0..6083883c4fe0 100644
>>> --- a/kernel/locking/percpu-rwsem.c
>>> +++ b/kernel/locking/percpu-rwsem.c
>>> @@ -223,9 +223,10 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
>>>
>>>   void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
>>>   {
>>> +       bool contended = false;
>>> +
>>>          might_sleep();
>>>          rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
>>> -       trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
>>>
>>>          /* Notify readers to take the slow path. */
>>>          rcu_sync_enter(&sem->rss);
>>> @@ -234,8 +235,11 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
>>>           * Try set sem->block; this provides writer-writer exclusion.
>>>           * Having sem->block set makes new readers block.
>>>           */
>>> -       if (!__percpu_down_write_trylock(sem))
>>> +       if (!__percpu_down_write_trylock(sem)) {
>>> +               trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
>>>                  percpu_rwsem_wait(sem, /* .reader = */ false);
>>> +               contended = true;
>>> +       }
>>>
>>>          /* smp_mb() implied by __percpu_down_write_trylock() on success -- D matches A */
>>>
>>> @@ -247,7 +251,8 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
>>>
>>>          /* Wait for all active readers to complete. */
>>>          rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE);
>>> -       trace_contention_end(sem, 0);
>>> +       if (contended)
>>> +               trace_contention_end(sem, 0);
>>>   }
>>>   EXPORT_SYMBOL_GPL(percpu_down_write);
>>>
>>> --
>>> 2.42.0.869.gea05f2083d-goog

Yes, that makes sense. Sorry for missing this patch.

Reviewed-by: Waiman Long <longman@redhat.com>


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

* Re: [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended
  2024-02-28  0:18     ` Waiman Long
@ 2024-02-28  0:49       ` Namhyung Kim
  2024-02-28 12:50       ` Ingo Molnar
  1 sibling, 0 replies; 7+ messages in thread
From: Namhyung Kim @ 2024-02-28  0:49 UTC (permalink / raw)
  To: Waiman Long; +Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, LKML

On Tue, Feb 27, 2024 at 4:19 PM Waiman Long <longman@redhat.com> wrote:
>
>
> On 2/27/24 18:02, Namhyung Kim wrote:
> > Hello,
> >
> > On Mon, Nov 20, 2023 at 12:28 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >> Ping!
> >>
> >> On Wed, Nov 8, 2023 at 1:53 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >>> It mistakenly fires lock contention tracepoints always in the writer path.
> >>> It should be conditional on the try lock result.
> > Can anybody take a look at this?  This makes a large noise
> > in the lock contention result.
> >
> > Thanks,
> > Namhyung
> >
> >>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> >>> ---
> >>>   kernel/locking/percpu-rwsem.c | 11 ++++++++---
> >>>   1 file changed, 8 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
> >>> index 185bd1c906b0..6083883c4fe0 100644
> >>> --- a/kernel/locking/percpu-rwsem.c
> >>> +++ b/kernel/locking/percpu-rwsem.c
> >>> @@ -223,9 +223,10 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
> >>>
> >>>   void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> >>>   {
> >>> +       bool contended = false;
> >>> +
> >>>          might_sleep();
> >>>          rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
> >>> -       trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
> >>>
> >>>          /* Notify readers to take the slow path. */
> >>>          rcu_sync_enter(&sem->rss);
> >>> @@ -234,8 +235,11 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> >>>           * Try set sem->block; this provides writer-writer exclusion.
> >>>           * Having sem->block set makes new readers block.
> >>>           */
> >>> -       if (!__percpu_down_write_trylock(sem))
> >>> +       if (!__percpu_down_write_trylock(sem)) {
> >>> +               trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
> >>>                  percpu_rwsem_wait(sem, /* .reader = */ false);
> >>> +               contended = true;
> >>> +       }
> >>>
> >>>          /* smp_mb() implied by __percpu_down_write_trylock() on success -- D matches A */
> >>>
> >>> @@ -247,7 +251,8 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> >>>
> >>>          /* Wait for all active readers to complete. */
> >>>          rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE);
> >>> -       trace_contention_end(sem, 0);
> >>> +       if (contended)
> >>> +               trace_contention_end(sem, 0);
> >>>   }
> >>>   EXPORT_SYMBOL_GPL(percpu_down_write);
> >>>
> >>> --
> >>> 2.42.0.869.gea05f2083d-goog
>
> Yes, that makes sense. Sorry for missing this patch.
>
> Reviewed-by: Waiman Long <longman@redhat.com>

Thanks for your review.
Namhyung

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

* Re: [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended
  2024-02-28  0:18     ` Waiman Long
  2024-02-28  0:49       ` Namhyung Kim
@ 2024-02-28 12:50       ` Ingo Molnar
  1 sibling, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2024-02-28 12:50 UTC (permalink / raw)
  To: Waiman Long; +Cc: Namhyung Kim, Peter Zijlstra, Will Deacon, Boqun Feng, LKML


* Waiman Long <longman@redhat.com> wrote:

> 
> On 2/27/24 18:02, Namhyung Kim wrote:
> > Hello,
> > 
> > On Mon, Nov 20, 2023 at 12:28 PM Namhyung Kim <namhyung@kernel.org> wrote:
> > > Ping!
> > > 
> > > On Wed, Nov 8, 2023 at 1:53 PM Namhyung Kim <namhyung@kernel.org> wrote:
> > > > It mistakenly fires lock contention tracepoints always in the writer path.
> > > > It should be conditional on the try lock result.
> > Can anybody take a look at this?  This makes a large noise
> > in the lock contention result.
> > 
> > Thanks,
> > Namhyung
> > 
> > > > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > > > ---
> > > >   kernel/locking/percpu-rwsem.c | 11 ++++++++---
> > > >   1 file changed, 8 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
> > > > index 185bd1c906b0..6083883c4fe0 100644
> > > > --- a/kernel/locking/percpu-rwsem.c
> > > > +++ b/kernel/locking/percpu-rwsem.c
> > > > @@ -223,9 +223,10 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
> > > > 
> > > >   void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> > > >   {
> > > > +       bool contended = false;
> > > > +
> > > >          might_sleep();
> > > >          rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
> > > > -       trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
> > > > 
> > > >          /* Notify readers to take the slow path. */
> > > >          rcu_sync_enter(&sem->rss);
> > > > @@ -234,8 +235,11 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> > > >           * Try set sem->block; this provides writer-writer exclusion.
> > > >           * Having sem->block set makes new readers block.
> > > >           */
> > > > -       if (!__percpu_down_write_trylock(sem))
> > > > +       if (!__percpu_down_write_trylock(sem)) {
> > > > +               trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
> > > >                  percpu_rwsem_wait(sem, /* .reader = */ false);
> > > > +               contended = true;
> > > > +       }
> > > > 
> > > >          /* smp_mb() implied by __percpu_down_write_trylock() on success -- D matches A */
> > > > 
> > > > @@ -247,7 +251,8 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> > > > 
> > > >          /* Wait for all active readers to complete. */
> > > >          rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE);
> > > > -       trace_contention_end(sem, 0);
> > > > +       if (contended)
> > > > +               trace_contention_end(sem, 0);
> > > >   }
> > > >   EXPORT_SYMBOL_GPL(percpu_down_write);
> > > > 
> > > > --
> > > > 2.42.0.869.gea05f2083d-goog
> 
> Yes, that makes sense. Sorry for missing this patch.
> 
> Reviewed-by: Waiman Long <longman@redhat.com>

Applied to tip:locking/core, thanks guys!

	Ingo

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

* [tip: locking/core] locking/percpu-rwsem: Trigger contention tracepoints only if contended
  2023-11-08 21:53 [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended Namhyung Kim
  2023-11-20 20:28 ` Namhyung Kim
@ 2024-02-28 12:53 ` tip-bot2 for Namhyung Kim
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot2 for Namhyung Kim @ 2024-02-28 12:53 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Namhyung Kim, Ingo Molnar, Waiman Long, x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     f3e3620f1a97fcd02a5f3606fa63888dbcffd82c
Gitweb:        https://git.kernel.org/tip/f3e3620f1a97fcd02a5f3606fa63888dbcffd82c
Author:        Namhyung Kim <namhyung@kernel.org>
AuthorDate:    Wed, 08 Nov 2023 13:53:22 -08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 28 Feb 2024 13:10:29 +01:00

locking/percpu-rwsem: Trigger contention tracepoints only if contended

We mistakenly always fire lock contention tracepoints in the writer path,
while it should be conditional on the trylock result.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Waiman Long <longman@redhat.com>
Link: https://lore.kernel.org/r/20231108215322.2845536-1-namhyung@kernel.org
---
 kernel/locking/percpu-rwsem.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
index 185bd1c..6083883 100644
--- a/kernel/locking/percpu-rwsem.c
+++ b/kernel/locking/percpu-rwsem.c
@@ -223,9 +223,10 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
 
 void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
 {
+	bool contended = false;
+
 	might_sleep();
 	rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
-	trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
 
 	/* Notify readers to take the slow path. */
 	rcu_sync_enter(&sem->rss);
@@ -234,8 +235,11 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
 	 * Try set sem->block; this provides writer-writer exclusion.
 	 * Having sem->block set makes new readers block.
 	 */
-	if (!__percpu_down_write_trylock(sem))
+	if (!__percpu_down_write_trylock(sem)) {
+		trace_contention_begin(sem, LCB_F_PERCPU | LCB_F_WRITE);
 		percpu_rwsem_wait(sem, /* .reader = */ false);
+		contended = true;
+	}
 
 	/* smp_mb() implied by __percpu_down_write_trylock() on success -- D matches A */
 
@@ -247,7 +251,8 @@ void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
 
 	/* Wait for all active readers to complete. */
 	rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE);
-	trace_contention_end(sem, 0);
+	if (contended)
+		trace_contention_end(sem, 0);
 }
 EXPORT_SYMBOL_GPL(percpu_down_write);
 

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

end of thread, other threads:[~2024-02-28 12:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-08 21:53 [PATCH] locking/percpu-rwsem: Trigger contention tracepoints only if contended Namhyung Kim
2023-11-20 20:28 ` Namhyung Kim
2024-02-27 23:02   ` Namhyung Kim
2024-02-28  0:18     ` Waiman Long
2024-02-28  0:49       ` Namhyung Kim
2024-02-28 12:50       ` Ingo Molnar
2024-02-28 12:53 ` [tip: locking/core] " tip-bot2 for Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).