[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cguuyY74L9XK=z384bwO6nTCw4XOFNK1yaJhhmKYTBBoA@mail.gmail.com>
Date: Tue, 1 Mar 2022 10:03:57 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Byungchul Park <byungchul.park@....com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Arnd Bergmann <arnd@...db.de>, linux-arch@...r.kernel.org,
bpf <bpf@...r.kernel.org>, Radoslaw Burny <rburny@...gle.com>
Subject: Re: [PATCH 2/4] locking: Apply contention tracepoints in the slow path
Hi Peter,
On Tue, Mar 1, 2022 at 12:44 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Mon, Feb 28, 2022 at 05:04:10PM -0800, Namhyung Kim wrote:
> > @@ -80,7 +81,9 @@ static inline void queued_read_lock(struct qrwlock *lock)
> > return;
> >
> > /* The slowpath will decrement the reader count, if necessary. */
> > + LOCK_CONTENTION_BEGIN(lock, LCB_F_READ);
> > queued_read_lock_slowpath(lock);
> > + LOCK_CONTENTION_END(lock);
> > }
> >
> > /**
> > @@ -94,7 +97,9 @@ static inline void queued_write_lock(struct qrwlock *lock)
> > if (likely(atomic_try_cmpxchg_acquire(&lock->cnts, &cnts, _QW_LOCKED)))
> > return;
> >
> > + LOCK_CONTENTION_BEGIN(lock, LCB_F_WRITE);
> > queued_write_lock_slowpath(lock);
> > + LOCK_CONTENTION_END(lock);
> > }
>
> > @@ -82,7 +83,9 @@ static __always_inline void queued_spin_lock(struct qspinlock *lock)
> > if (likely(atomic_try_cmpxchg_acquire(&lock->val, &val, _Q_LOCKED_VAL)))
> > return;
> >
> > + LOCK_CONTENTION_BEGIN(lock, 0);
> > queued_spin_lock_slowpath(lock, val);
> > + LOCK_CONTENTION_END(lock);
> > }
>
> Can you please stick that _inside_ the slowpath? You really don't want
> to inline that.
I can move it into the slow path with caller ip.
Thanks,
Namhyung
Powered by blists - more mailing lists