From owner-dev-commits-src-all@freebsd.org Sat Sep 18 20:10:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C02E867BF34; Sat, 18 Sep 2021 20:10:36 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBhlJ4kkcz4jHt; Sat, 18 Sep 2021 20:10:36 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 7E81C2B959; Sat, 18 Sep 2021 20:10:36 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-qk1-f178.google.com with SMTP id y144so28786551qkb.6; Sat, 18 Sep 2021 13:10:36 -0700 (PDT) X-Gm-Message-State: AOAM532yPCx3zaydJR0iZWU2IQiwS66RLsXLj7Rrtaoo5ss//bHBDTHk XDZZLDCuw1Ox7ZRCHONe3/IuRvl0P2ihzX2KJiA= X-Google-Smtp-Source: ABdhPJw1wC0ATl7ICJ3McCUYmSLwdmRBvjiuR8jXvJG9aPCAjGB2AGRaBrIJeqridJLW3uxGoVopKuWvUMrP8XvuopI= X-Received: by 2002:a25:3b04:: with SMTP id i4mr22207227yba.524.1631995835966; Sat, 18 Sep 2021 13:10:35 -0700 (PDT) MIME-Version: 1.0 References: <202109181018.18IAIMfG066006@gitrepo.freebsd.org> In-Reply-To: <202109181018.18IAIMfG066006@gitrepo.freebsd.org> From: Mitchell Horne Date: Sat, 18 Sep 2021 17:10:25 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: f902e4bb04ad - main - lockmgr: fix lock profiling of face adaptive spinning To: Mateusz Guzik Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 20:10:36 -0000 On Sat, Sep 18, 2021 at 7:18 AM Mateusz Guzik wrote: > > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f902e4bb04ad717935a97ce1ae59e2dd389d940d > > commit f902e4bb04ad717935a97ce1ae59e2dd389d940d > Author: Mateusz Guzik > AuthorDate: 2021-09-11 18:23:51 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-09-18 10:16:58 +0000 > > lockmgr: fix lock profiling of face adaptive spinning In what way was it broken? 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