Hi,

Would it be better if my patch used the PAGE_SIZE clusters instead of
the 16K ones? Then it should not be affected by memory defragmentation.
Thanks for shedding some light into this area?

--HPS


Hi,

Updated patch attached.

--HPS
=== sys/kern/uipc_mbuf.c
==================================================================
--- sys/kern/uipc_mbuf.c	(revision 268358)
+++ sys/kern/uipc_mbuf.c	(local)
@@ -917,7 +917,15 @@
 		struct mbuf *n;
 
 		/* Get the next new mbuf */
-		if (remain >= MINCLSIZE) {
+		if (remain >= MJUMPAGESIZE) {
+			/*
+			 * By allocating a bigger mbuf, we get fewer
+			 * scatter gather entries for the hardware to
+			 * process:
+			 */
+			n = m_getjcl(how, m->m_type, 0, MJUMPAGESIZE);
+			nsize = MJUMPAGESIZE;
+		} else if (remain >= MINCLSIZE) {
 			n = m_getcl(how, m->m_type, 0);
 			nsize = MCLBYTES;
 		} else {
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to