From owner-svn-src-head@freebsd.org Mon May 21 17:00:53 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 8B552EF8810; Mon, 21 May 2018 17:00:53 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 2D90C86C44; Mon, 21 May 2018 17:00:52 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 20C495646B; Mon, 21 May 2018 11:54:20 -0500 (CDT) Subject: Re: svn commit: r333859 - head/sys/kern To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805190509.w4J59Atx053545@repo.freebsd.org> From: Eric van Gyzen Openpgp: preference=signencrypt Message-ID: Date: Mon, 21 May 2018 11:54:14 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201805190509.w4J59Atx053545@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 17:00:53 -0000 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