From owner-freebsd-net@FreeBSD.ORG Wed Sep 11 17:00:32 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2997498F; Wed, 11 Sep 2013 17:00:32 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pb0-x22b.google.com (mail-pb0-x22b.google.com [IPv6:2607:f8b0:400e:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F0F9D28E2; Wed, 11 Sep 2013 17:00:31 +0000 (UTC) Received: by mail-pb0-f43.google.com with SMTP id md4so9295244pbc.2 for ; Wed, 11 Sep 2013 10:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=WPHZ71yEBbSQ9EAJVEeXL+hw2s0+Gxt1HGI1pbv8AaI=; b=C2179KfLe0utG3p+tD324EB799Ye6Coy7EGnQVWFySV+aqYf+l34gd7mGNjvBv0+18 sSh6tqUa/7wlOuB9aSk9x4PQCkyIDArjigIrD1QUlqaRh2oNqeDm/i7T3V36pMOYUx8f y6fP5V9niehSxN3LdaZs7QUyVHnf/61TMX1wncuS8bUdffA0r6io5oyNhtELNvmzMDBq eQ+tqkvxgk6jq08VUKkKmv/nNPZVoJOjbkpJcdpPRgF9YjqChzE8FbhX2ufirSXY9F0m SS4GNz5UUmNMWvkQaGtVyiLH8O0C8x6uPT76Z7jj0ehjhxeXgRDdt7EB1vFRVbjYkE90 MxcA== X-Received: by 10.68.13.3 with SMTP id d3mr3050646pbc.62.1378918831528; Wed, 11 Sep 2013 10:00:31 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id dw3sm5681181pbc.17.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 10:00:30 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <5230A1AC.8020209@FreeBSD.org> Date: Wed, 11 Sep 2013 10:00:28 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130819 Thunderbird/17.0.8 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: Please review: atomic updates to mbuf's external refcount References: <521FA792.9000807@FreeBSD.org> <20130911145418.GN4574@FreeBSD.org> In-Reply-To: <20130911145418.GN4574@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-net@FreeBSD.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2013 17:00:32 -0000 On 09/11/13 07:54, Gleb Smirnoff wrote: > On Thu, Aug 29, 2013 at 12:57:06PM -0700, Navdeep Parhar wrote: > N> I'd like to merge r254341 from user/np/cxl_tuning to head if there are > N> no objections. It eliminates a couple of iffy looking constructs in > N> uipc_mbuf.c > N> > N> http://svnweb.freebsd.org/base/user/np/cxl_tuning/sys/kern/uipc_mbuf.c?r1=254334&r2=254341&diff_format=u > N> > N> --------------------- > N> Always increment or decrement an mbuf's external refcount atomically. > N> Always decrement it in mb_free_ext() so that an external free routine > N> can safely assert the refcount is 0 (and not 0 or 1) when it's called. > N> --------------------- > > I'd like to second on this patch. > > The "iffy looking constructs" do not work if we break assumption that > the mbuf is the only way to find a refcount for an external storage. > ok, I'll ask re@ to approve this for head. Regards, Navdeep