Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/kern pull up revs 1.31-1.33 from trunk (requested b...



details:   https://anonhg.NetBSD.org/src/rev/8873f43ac20b
branches:  netbsd-1-4
changeset: 469466:8873f43ac20b
user:      cgd <cgd%NetBSD.org@localhost>
date:      Wed Sep 22 03:19:44 1999 +0000

description:
pull up revs 1.31-1.33 from trunk (requested by cgd):
  Compact mbuf clusters, to help prevent mbuf cluster exhaustion when
  receiving lots of small packets.  This costs some performance (the
  compaction copies data), but adds a lot of stability to many systems.

diffstat:

 sys/kern/uipc_socket2.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r 64db4bd66fb7 -r 8873f43ac20b sys/kern/uipc_socket2.c
--- a/sys/kern/uipc_socket2.c   Wed Sep 22 03:17:57 1999 +0000
+++ b/sys/kern/uipc_socket2.c   Wed Sep 22 03:19:44 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket2.c,v 1.28 1999/03/23 10:45:37 lukem Exp $  */
+/*     $NetBSD: uipc_socket2.c,v 1.28.2.1 1999/09/22 03:19:44 cgd Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -678,9 +678,12 @@
                        m = m_free(m);
                        continue;
                }
-               if (n && (n->m_flags & (M_EXT | M_EOR)) == 0 &&
-                   (n->m_data + n->m_len + m->m_len) < &n->m_dat[MLEN] &&
-                   n->m_type == m->m_type) {
+               if (n && (n->m_flags & M_EOR) == 0 && n->m_type == m->m_type &&
+                   (((n->m_flags & M_EXT) == 0 &&
+                     n->m_data + n->m_len + m->m_len <= &n->m_dat[MLEN]) ||
+                    ((~n->m_flags & (M_EXT|M_CLUSTER)) == 0 &&
+                     !MCLISREFERENCED(n) &&
+                     n->m_data + n->m_len + m->m_len <= &n->m_ext.ext_buf[MCLBYTES]))) {
                        memcpy(mtod(n, caddr_t) + n->m_len, mtod(m, caddr_t),
                            (unsigned)m->m_len);
                        n->m_len += m->m_len;



Home | Main Index | Thread Index | Old Index