Date: Sun, 19 Sep 2021 15:58:48 +0200 From: Mateusz Guzik <mjguzik@gmail.com> To: Mitchell Horne <mhorne@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f902e4bb04ad - main - lockmgr: fix lock profiling of face adaptive spinning Message-ID: <CAGudoHHgo3GCjXvTnbqk%2BnOVsy3XzPjhrvDOLCb29vZMvHp43A@mail.gmail.com> In-Reply-To: <CADeAsy0BvuCQTHdH2xpxqZ-Z9mrMm4tvb6uL5jZoqL2MNt_wMw@mail.gmail.com> References: <202109181018.18IAIMfG066006@gitrepo.freebsd.org> <CADeAsy0BvuCQTHdH2xpxqZ-Z9mrMm4tvb6uL5jZoqL2MNt_wMw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 9/18/21, Mitchell Horne <mhorne@freebsd.org> wrote: > On Sat, Sep 18, 2021 at 7:18 AM Mateusz Guzik <mjg@freebsd.org> wrote: >> >> The branch main has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=f902e4bb04ad717935a97ce1ae59e2dd389d940d >> >> commit f902e4bb04ad717935a97ce1ae59e2dd389d940d >> Author: Mateusz Guzik <mjg@FreeBSD.org> >> AuthorDate: 2021-09-11 18:23:51 +0000 >> Commit: Mateusz Guzik <mjg@FreeBSD.org> >> CommitDate: 2021-09-18 10:16:58 +0000 >> >> lockmgr: fix lock profiling of face adaptive spinning > > In what way was it broken? > If there was only spinning the time would fail to register. > Mitchell > >> --- >> sys/kern/kern_lock.c | 11 +++++++---- >> 1 file changed, 7 insertions(+), 4 deletions(-) >> >> diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c >> index bec49f29d162..2eb4feb7c4b5 100644 >> --- a/sys/kern/kern_lock.c >> +++ b/sys/kern/kern_lock.c >> @@ -631,6 +631,9 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, >> struct lock_object *ilk, >> if (lockmgr_slock_try(lk, &x, flags, false)) >> break; >> >> + lock_profile_obtain_lock_failed(&lk->lock_object, false, >> + &contested, &waittime); >> + >> if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) >> { >> if (lockmgr_slock_adaptive(&lda, lk, &x, flags)) >> continue; >> @@ -639,8 +642,6 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, >> struct lock_object *ilk, >> #ifdef HWPMC_HOOKS >> PMC_SOFT_CALL( , , lock, failed); >> #endif >> - lock_profile_obtain_lock_failed(&lk->lock_object, false, >> - &contested, &waittime); >> >> /* >> * If the lock is expected to not sleep just give up >> @@ -845,6 +846,10 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, >> struct lock_object *ilk, >> break; >> continue; >> } >> + >> + lock_profile_obtain_lock_failed(&lk->lock_object, false, >> + &contested, &waittime); >> + >> if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) >> { >> if (lockmgr_xlock_adaptive(&lda, lk, &x)) >> continue; >> @@ -852,8 +857,6 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, >> struct lock_object *ilk, >> #ifdef HWPMC_HOOKS >> PMC_SOFT_CALL( , , lock, failed); >> #endif >> - lock_profile_obtain_lock_failed(&lk->lock_object, false, >> - &contested, &waittime); >> >> /* >> * If the lock is expected to not sleep just give up > -- Mateusz Guzik <mjguzik gmail.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGudoHHgo3GCjXvTnbqk%2BnOVsy3XzPjhrvDOLCb29vZMvHp43A>