From owner-svn-src-head@freebsd.org Wed Jun 6 13:02:28 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 4918AFF5524 for ; Wed, 6 Jun 2018 13:02:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (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)) by mx1.freebsd.org (Postfix) with ESMTPS id CEBAF73472 for ; Wed, 6 Jun 2018 13:02:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id l6-v6so7904197iti.2 for ; Wed, 06 Jun 2018 06:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=N+BQ7neqjDYb0GLU6fFleJi5HshcU+4aQh0hi+xWI6I=; b=b0Yfy9XSLdmgsefHjqzS+Mlx1EnZEdJrEdS8H4lUUNrOngqA4KxcfI3MM/mwa5w//r oEOuSUWuBRYKsJhyuBn/ApX/3mLt5+98XOiPQrZip5LWGTiMV4CMcMWq/XKfAy4/SkAe tqjDjmdUHK5t1sK6C5/bZz1pToHmwZ2hdsf0/664fCIBupyIytTe2P5UONEfSzrPXOx+ SwOtWfO+wTh5LvDBrh3QuLDAfdqnGATWZt36juP6CPm1fmKc3DVIcs/9vuhpZZ40QOdG 99lJ02LMM0UtWokPno27bE1i39Qp4h1Xw1Tt4khYOxGqNItpFiqeuNjfl10I3Z1mCR2Y ey4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=N+BQ7neqjDYb0GLU6fFleJi5HshcU+4aQh0hi+xWI6I=; b=bW7xaQm+QP44qvvpHBKpCkH6FXzxCxEnIb/ypY9LbbqX7dnRVoPbBOyBRqaat2mtwh 5aQXVDF4+o28IiddaEFtPIwctvL99WQ1KGKd9/8lEPipuB9ujGfvTw7/dinTEKh/+fVM D2UkkKUn+FhT7Os27FfZzS9dVqFQcohJalyxW3AXoblSzxQc3XjhlPiW6RGJHx0fCa08 MqFaf//nPIik5CjqP9pRVFRTlRDrliFOETaFuEZqZrxuTuG0Jyy1y3Pminb+z+EVc2oE Opl5W7kA62TC8gvgLowvGV7qmzOEvXmNl+gYSktZzv4qt9VywmiVryK9Gf3tbKHwYCzy eKDA== X-Gm-Message-State: APt69E0Q5eTorzBbtyWKBO67siN6t6NWmAKvSvKSsnvqKH0OjxJc/C1S nHf2arIFBynmgJK8TUnRRCGvTFFI6pDbAQiuzxp2Og== X-Google-Smtp-Source: ADUXVKIuuOYt0jCvw0SQCFX+uwxNzPheRVzpFg99b1ixEDZue5e7NyY+EBEkHjDNvcCran+EF70rdZR4rPdyQ5+3LxU= X-Received: by 2002:a24:efc2:: with SMTP id i185-v6mr2307999ith.57.1528290147084; Wed, 06 Jun 2018 06:02:27 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 06:02:26 -0700 (PDT) X-Originating-IP: [137.122.64.159] In-Reply-To: <201806061257.w56CvCwq089369@repo.freebsd.org> References: <201806061257.w56CvCwq089369@repo.freebsd.org> From: Warner Losh Date: Wed, 6 Jun 2018 09:02:26 -0400 X-Google-Sender-Auth: d89317V9BHXN54oHRsYZhw30gJc Message-ID: Subject: Re: svn commit: r334708 - head/sys/kern To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 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: Wed, 06 Jun 2018 13:02:28 -0000 On Wed, Jun 6, 2018 at 8:57 AM, Justin Hibbits wrote: > Author: jhibbits > Date: Wed Jun 6 12:57:11 2018 > New Revision: 334708 > URL: https://svnweb.freebsd.org/changeset/base/334708 > > Log: > Add a memory barrier after taking a reference on the vnode holdcnt in > _vhold > > This is needed to avoid a race between the VNASSERT() below, and another > thread updating the VI_FREE flag, on weakly-ordered architectures. > > On a 72-thread POWER9, without this barrier a 'make -j72 buildworld' > would > panic on the assert regularly. > > It may be possible to use a weaker barrier, and I'll investigate that > once > all stability issues are worked out on POWER9. > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================ > ================== > --- head/sys/kern/vfs_subr.c Wed Jun 6 10:46:24 2018 (r334707) > +++ head/sys/kern/vfs_subr.c Wed Jun 6 12:57:11 2018 (r334708) > @@ -2807,6 +2807,9 @@ _vhold(struct vnode *vp, bool locked) > CTR2(KTR_VFS, "%s: vp %p", __func__, vp); > if (!locked) { > if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { > +#if !defined(__amd64__) && !defined(__i386__) > + mb(); > +#endif > VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, > ("_vhold: vnode with holdcnt is free")); > return; > > So why isn't the refcount_acquire() enough? Warner