From owner-svn-src-head@FreeBSD.ORG Tue Mar 12 21:12:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D9FF6A67; Tue, 12 Mar 2013 21:12:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id DB69B853; Tue, 12 Mar 2013 21:12:03 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3713BB972; Tue, 12 Mar 2013 17:12:03 -0400 (EDT) From: John Baldwin To: Andre Oppermann Subject: Re: svn commit: r248196 - head/sys/nfs Date: Tue, 12 Mar 2013 13:27:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201303121219.r2CCJN5Z069789@svn.freebsd.org> <20130312155005.GJ48089@FreeBSD.org> <513F58C0.4050302@freebsd.org> In-Reply-To: <513F58C0.4050302@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201303121327.58164.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 12 Mar 2013 17:12:03 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 12 Mar 2013 21:12:06 -0000 On Tuesday, March 12, 2013 12:33:04 pm Andre Oppermann wrote: > On 12.03.2013 16:50, Gleb Smirnoff wrote: > > On Tue, Mar 12, 2013 at 04:31:05PM +0100, Andre Oppermann wrote: > > A> > If you are concerned about using jumbos that are > PAGE_SIZE, then I can > > A> > extend API in my patch. ... done. > > A> > > > A> > Patch attached. > > A> > > > A> > The NFS code itself guarantees that it won't request > than MCLBYTES, > > A> > so using bare m_get2() here is safe. I can add flag there later for > > A> > clarity. > > A> > > A> Using PAGE_SIZE clusters is perfectly fine and no flag to prevent that > > A> is necessary. In fact we're doing it for years on socket writes without > > A> complaints (through m_getm2()). > > > > mbuf usage isn't limited to sockets. There is some code that right now utilizes > > only mbufs and standard clusters, netipsec for example. > > Yes, I understand that. > > > I'd like to remove a lot of handmade mbuf allocating, in different places in > > kernel and this can be done with M_NOJUMBO flag. I don't have time to dig more > > deep into large chunks of code trying to understand whether it is possible to > > convert them into using PAGE_SIZE clusters or not, I just want to reduce > > amount of pasted hand allocating. > > Reducing the amount of hand allocation is very good. > > > We have very common case when we allocate either mbuf or mbuf + cluster, > > depending on size. Everywhere this is made by hand, but can be substituted > > with m_get2(len, ..., M_NOJUMBO); > > I guess what I'm trying to say is that not wanting jumbo > PAGE_SIZE is > normal and shouldn't be specified all the time. > > This makes the API look like this: > > m_get2(len, ..., 0); /* w/o flags I get at most MJUMPAGESIZE */ > > If someone really, really, really knows what he is doing he can say > he wants jumbo > PAGE_SIZE returned with M_JUMBOOK or such. However > IMHO even that shouldn't be offered and m_getm2() should be used for > a chain. I agree, large clusters should require opting-in, they should not be provided by default (if at all as Andre suggests). -- John Baldwin