From owner-svn-src-all@freebsd.org Mon Aug 3 18:45:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665AF9B2E53; Mon, 3 Aug 2015 18:45:42 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::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 07859164B; Mon, 3 Aug 2015 18:45:42 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by lbqc9 with SMTP id c9so57359037lbq.1; Mon, 03 Aug 2015 11:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0jr4Q5Q6bSnWsrODk9LPNXYQTRAlC1KHTlqo9aQ0DRY=; b=yNW7L0vR9RC4oKU+pv5a/TRpKdPvi9hdZkdA7bNeju7/j8RNUM5x/pskWPeGDd0zJ1 +PXNSJ+F+5PZEpQFRXK/T9ahEsNMpU4hxNqBOcPswfnNwRJAu5NwXM6RnHDHL0qoNOMw ft5Zr5v+5WBkU83ZjNfSrf1t4ISoPJszKWacoyNi1dQVRSNXqahmZBjb0KAURHTJ5o0+ fbn+C/tD/Kn3l3e2+mQr0DjyA3oRDtNvJ0Z2yDrr7CkuHiuqHaxUIql+jG5QHgtX3D+i ArZKyUelo277pQC63782v+VkcGRiVI2shoyl4B34sA9siXucffc5lFnu2GY0K15vawX4 pWUg== MIME-Version: 1.0 X-Received: by 10.152.181.34 with SMTP id dt2mr18291579lac.84.1438627539930; Mon, 03 Aug 2015 11:45:39 -0700 (PDT) Received: by 10.152.112.170 with HTTP; Mon, 3 Aug 2015 11:45:39 -0700 (PDT) In-Reply-To: References: <201507312143.t6VLhSBm046797@repo.freebsd.org> Date: Mon, 3 Aug 2015 15:45:39 -0300 Message-ID: Subject: Re: svn commit: r286142 - head/sys/net From: Luiz Otavio O Souza To: Guy Helmer Cc: Ed Schouten , Luiz Otavio O Souza , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 18:45:42 -0000 On Sat, Aug 1, 2015 at 6:02 PM, Guy Helmer wrote: > >> On Aug 1, 2015, at 4:50 AM, Ed Schouten wrote: >> >> Hi Luiz, >> >> 2015-07-31 23:43 GMT+02:00 Luiz Otavio O Souza : >>> - while (d->bd_hbuf_in_use) >>> - mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, >>> - PRINET, "bd_hbuf", 0); >> >> Would it make sense to replace them by an assertion, instead of >> omitting them entirely? >> >> KASSERT(!d->bd_hbuf_in_use, ("...")); > > I would appreciate the confidence that would provide. > > Guy Yeah, I agree. The KASSERT() makes the code even easier to understand. Note that only one KASSERT() is needed here, because to other case is specific to zero-copy buffers and the zero-copy buffers cannot be read with read(2) and this way they never set the in use flag for the hold buffer. Committed in r286243. Thanks! Luiz