From owner-svn-src-head@freebsd.org Thu Jun 6 17:43:46 2019 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 0066E15BA735; Thu, 6 Jun 2019 17:43:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD5B7710D; Thu, 6 Jun 2019 17:43:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd2e.google.com with SMTP id u13so901046iop.0; Thu, 06 Jun 2019 10:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fXGT8BP5UeZ02hYFCrmYGNXSrCJCxnalRjfA8iFJFio=; b=q2nGjPKbfm3pThGn6O1+LXcPwEFhaOolzYaY5wnDOsXw97ffBqSTdbYS2huPpjIY+4 DHe9+tonZziwSr0qmcyGWUkPQnVijMxy5mxvf6QwlpBAkJlhwpgL46pK9bUfouE/WAiP 6jXRlZ53ZCqVzpEV7GzcRh/4H2NJKHM+DNuqswOdxZ+c7fgvfHUEsYjOFdH20VRpxPPZ vEcoPY1kTv7ZpG5G/1GPJM4wxaFYU/Dl40K1nBuxk//T9XRR7kN51Naht32QqydvIZUZ MTvllD8GpkgnS+9Onxx0jvwxQbiKl0d/BEEU4QBu20cKJ71ng7LGpWXqGONPEihiwsM7 Z2dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=fXGT8BP5UeZ02hYFCrmYGNXSrCJCxnalRjfA8iFJFio=; b=HjDifKXDVlTxKOypLC8XT2pG0MybJtvkcKvfV3qL8rLPaDfrYcRuJRSydO3IYSF9p0 QTPn7xXO9iVbQtAElCwmc5yht5va/lZJbjow2bu0PBO4JhHTLCUdEa73oyVD1yyqgLGW YgQcL6+sSETvhenah4+bsR9GmAZJ7ivXXRQE/ObobEVdLSr1nIBtMENZAneoMyGaAHDa 0q3L21B6mcxll08M/sn6LIcfMXbCqKlpDqdRli1MPo6PaXlS+6Ng2i8mjJaRJo1nfiWB aOb3xbtcYOPhinmFaRPWMQqH0K32oN3nz1URncjyLh0LPzOXucpBlkobublEG+H7Lznp CMzw== X-Gm-Message-State: APjAAAVc4no6UR+B0BR9S+ikdZ1eBtxI/1+l1GYIk7abiKPx8J0k9kcL TxInm437JDuUe1vITr9waHGeB2EV X-Google-Smtp-Source: APXvYqxYHPloxH1A28yTFNq4it8heUmV4dZmMuUq0g9rqxFfJa6jh1I2C1oFZkuStXhRTnC3w9lFsQ== X-Received: by 2002:a5d:8456:: with SMTP id w22mr22558253ior.136.1559843024449; Thu, 06 Jun 2019 10:43:44 -0700 (PDT) Received: from raichu (toroon0560w-lp130-12-70-50-22-99.dsl.bell.ca. [70.50.22.99]) by smtp.gmail.com with ESMTPSA id v130sm1148214itc.8.2019.06.06.10.43.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 06 Jun 2019 10:43:43 -0700 (PDT) Sender: Mark Johnston Date: Thu, 6 Jun 2019 13:43:39 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348745 - head/sys/net Message-ID: <20190606174339.GA3015@raichu> References: <201906061622.x56GMTmT076525@repo.freebsd.org> <61b60bb0-da61-00cf-5fca-69ac306ce6d2@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61b60bb0-da61-00cf-5fca-69ac306ce6d2@FreeBSD.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Rspamd-Queue-Id: 8DD5B7710D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Thu, 06 Jun 2019 17:43:46 -0000 On Thu, Jun 06, 2019 at 10:13:13AM -0700, John Baldwin wrote: > On 6/6/19 9:22 AM, Mark Johnston wrote: > > Author: markj > > Date: Thu Jun 6 16:22:29 2019 > > New Revision: 348745 > > URL: https://svnweb.freebsd.org/changeset/base/348745 > > > > Log: > > Conditionalize an in_epoch() call on INVARIANTS. > > > > Its result is only used to determine whether to perform further > > INVARIANTS-only checks. Remove a stale comment while here. > > > > Submitted by: Sebastian Huber > > MFC after: 1 week > > > > Modified: > > head/sys/net/if_lagg.c > > > > Modified: head/sys/net/if_lagg.c > > ============================================================================== > > --- head/sys/net/if_lagg.c Thu Jun 6 16:20:50 2019 (r348744) > > +++ head/sys/net/if_lagg.c Thu Jun 6 16:22:29 2019 (r348745) > > @@ -1955,12 +1955,10 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po > > * Search a port which reports an active link state. > > */ > > > > - /* > > - * This is called with either LAGG_RLOCK() held or > > - * LAGG_XLOCK(sc) held. > > - */ > > +#ifdef INVARIANTS > > if (!in_epoch(net_epoch_preempt)) > > LAGG_XLOCK_ASSERT(sc); > > +#endif > > FWIW, the comment wasn't stale but on purpose (I added it when I added the check). > The idea is to be the equivalent of > > assert(in_epoch(net_epoch_preempt) || lagg_xlocked(sc)) > > However, I couldn't write it that way, so I use LAGG_XLOCK_ASSERT when !in_epoch > returns false. We could add #ifdef INVARIANTS #define LAGG_ASSERT_LOCKED(_sc) (sx_xlocked(&(_sc)->sc_sx) || in_epoch(net_epoch_preempt)) #else #define LAGG_ASSERT_LOCKED(_sc) #endif > Note that LAGG_RLOCK == epoch_enter, hence why the comment isn't stale. I noticed that, but thought it was oddly phrased and decided it was stale without checking when the comment was added. I re-added it.