From owner-svn-src-head@freebsd.org Mon May 21 20:45:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16B18EFDE78; Mon, 21 May 2018 20:45:17 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B807A6F8FC; Mon, 21 May 2018 20:45:16 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 7E7B418C43; Mon, 21 May 2018 20:45:16 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f173.google.com with SMTP id e20-v6so15865307iof.4; Mon, 21 May 2018 13:45:16 -0700 (PDT) X-Gm-Message-State: ALKqPwd0PCoIHkuOiEdVacNwkgf0JW2OeP8nftaRqNlAA/zKk4TCnhCz BiBHK7fphkMH1MmJMj+TqpQCdQ2q+/t+cfnAHFY= X-Google-Smtp-Source: AB8JxZpmryqIBQYkKWs3hnnWYUEA154fF3jVdnjPQq20aSIagwoDYRluIvzbYDbJqBct/n7c9tGYyxh4QLXdLdMjYIA= X-Received: by 2002:a6b:b7c6:: with SMTP id h189-v6mr22151844iof.94.1526935515972; Mon, 21 May 2018 13:45:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ae:0:0:0:0:0 with HTTP; Mon, 21 May 2018 13:45:15 -0700 (PDT) In-Reply-To: References: <201805190509.w4J59Atx053545@repo.freebsd.org> From: Matthew Macy Date: Mon, 21 May 2018 13:45:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333859 - head/sys/kern To: Eric van Gyzen Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2018 20:45:17 -0000 Bear in mind that prior to my change most functions would call it without ever using it on non-debug builds. On Mon, May 21, 2018 at 9:54 AM, Eric van Gyzen wrote: > On 05/19/2018 00:09, Matt Macy wrote: >> @@ -1663,16 +1655,18 @@ static int >> umtxq_sleep_pi(struct umtx_q *uq, struct umtx_pi *pi, uint32_t owner, >> const char *wmesg, struct abs_timeout *timo, bool shared) >> { >> - struct umtxq_chain *uc; >> struct thread *td, *td1; >> struct umtx_q *uq1; >> int error, pri; >> +#ifdef INVARIANTS >> + struct umtxq_chain *uc; >> >> + uc = umtxq_getchain(&pi->pi_key); >> +#endif >> error = 0; >> td = uq->uq_thread; >> KASSERT(td == curthread, ("inconsistent uq_thread")); >> - uc = umtxq_getchain(&uq->uq_key); >> - UMTXQ_LOCKED_ASSERT(uc); >> + UMTXQ_LOCKED_ASSERT(umtxq_getchain(&uq->uq_key)); > > Couldn't this line stay as it was? > > UMTXQ_LOCKED_ASSERT(uc); > > With the current code, we're calling umtxq_getchain() once more than > necessary. Also, the casual reader might be confused by calling it with > two different arguments. > > Eric