From owner-freebsd-net@FreeBSD.ORG Tue Jul 8 20:10:08 2014 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 ESMTPS id E560487F; Tue, 8 Jul 2014 20:10:08 +0000 (UTC) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9BD7E2C0B; Tue, 8 Jul 2014 20:10:07 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYEAG5PvFODaFve/2dsb2JhbABWA4NgWoJvvBUIhm5TAYEwdYQDAQEBBAEBASArIAsbGAICDRkCKQEJJgYIBwQBHASIIQ2uPZkaF4EsiE6EcQYBARskEAcRgmaBTAWYCoQ0igSIQINfITV9CBci X-IronPort-AV: E=Sophos;i="5.01,626,1400040000"; d="scan'208";a="139260753" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-annu.net.uoguelph.ca with ESMTP; 08 Jul 2014 16:10:07 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 26EEFB409B; Tue, 8 Jul 2014 16:10:07 -0400 (EDT) Date: Tue, 8 Jul 2014 16:10:07 -0400 (EDT) From: Rick Macklem To: John-Mark Gurney Message-ID: <1065824414.8871880.1404850207148.JavaMail.root@uoguelph.ca> In-Reply-To: <20140708005234.GJ45513@funkthat.com> Subject: Re: [RFC] Allow m_dup() to use JUMBO clusters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.209] X-Mailer: Zimbra 7.2.6_GA_2926 (ZimbraWebClient - FF3.0 (Win)/7.2.6_GA_2926) Cc: Hans Petter Selasky , freebsd-net@freebsd.org, freebsd-current@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 20:10:09 -0000 John-Mark Gurney wrote: > Hans Petter Selasky wrote this message on Mon, Jul 07, 2014 at 10:12 > +0200: > > I'm asking for some input on the attached m_dup() patch, so that > > existing functionality or dependencies are not broken. The > > background > > for the change is to allow m_dup() to defrag long mbuf chains that > > doesn't fit into a specific hardware's scatter gather entries, > > typically > > when doing TSO. > > > > In my case the HW limit is 16 entries of length 4K for doing a > > 64KByte > > TSO packet. Currently m_dup() is at best producing 32 entries of > > each 2K > > for a 64Kbytes TSO packet. > > > > By allowing m_dup() to get JUMBO clusters when allocating mbufs, we > > avoid creating a new function, specific to the hardware, to defrag > > some > > rare-occurring very long mbuf chains into a mbuf chain below 16 > > entries. > > Please no... Until we get a better allocator, we should not use jumbo > (>page sized) mbufs otherwise we will quickly fail to allocate mbufs > after a machine has been up for a long while causing other > failures... > > Unless of course if the code fails to allocate the largest cluster it > falls through to trying to allocate the next smaller size, that might > be better... > Unfortunately, for the "can't allocate boundary tags" case, the allocation request with M_NOWAIT loops instead of failing. I tried: m = m_getjcl(M_NOWAIT..M_JUMPAGESIZE); if (m == NULL) m = getjcl(M_WAITOK..MCLBYTES); when I was experimenting with MJUMPAGESIZE clusters for NFS and what happened was the thread looped in the first m_getjcl() instead of returning NULL. It is about 12 layers of function calls deep and most fail/return NULL, but somewhere one of them decides to "try again". I didn't locate the location of that and don't know if it would be safe to change it so that m_getjcl() returns NULL for this case. rick > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" >