From owner-svn-src-head@freebsd.org Mon May 21 17:24:13 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 A856DEFA02D; Mon, 21 May 2018 17:24:13 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (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 5C87168455; Mon, 21 May 2018 17:24:13 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) (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 2265617841; Mon, 21 May 2018 17:24:13 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f51.google.com with SMTP id c3-v6so22002000itj.4; Mon, 21 May 2018 10:24:13 -0700 (PDT) X-Gm-Message-State: ALKqPweC0hixMfe6L900yGJ2GoJAQ5K5UXzKnTiav01wxSthdiZjGBLT mCef3wRjTPMXfxizzXoQq8N2CnDmrUtNmKDeQS4= X-Google-Smtp-Source: AB8JxZq3TQv1DzxnyTlRSsQ8tePGu6bU4FvnyAA2k02tneNGF8lmtq1PqFyYTlr9ovrB/gGWriK8DEm6P6+9fk5+Rmc= X-Received: by 2002:a24:f9cc:: with SMTP id l195-v6mr18069533ith.132.1526923452586; Mon, 21 May 2018 10:24:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ae:0:0:0:0:0 with HTTP; Mon, 21 May 2018 10:24:12 -0700 (PDT) In-Reply-To: References: <201805190509.w4J59Atx053545@repo.freebsd.org> From: Matthew Macy Date: Mon, 21 May 2018 10:24:12 -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 17:24:13 -0000 Good point. Will fix. 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