diff options
author | dg <dg@FreeBSD.org> | 1994-05-29 07:48:17 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-05-29 07:48:17 +0000 |
commit | 2f931bd07027c939a6a312b7a48bc1e51bc80594 (patch) | |
tree | 6242d297ffb749f19a23843540fc33b17a8c4e38 /sys | |
parent | c64ef605af3edef35bca35bcdf0273c35e392033 (diff) | |
download | FreeBSD-src-2f931bd07027c939a6a312b7a48bc1e51bc80594.zip FreeBSD-src-2f931bd07027c939a6a312b7a48bc1e51bc80594.tar.gz |
Changed mbuf allocation policy to get a cluster if size > MINCLSIZE. Makes
a BIG difference in socket performance.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_socket.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index ede6c08..510556c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -407,25 +407,15 @@ restart: MGET(m, M_WAIT, MT_DATA); mlen = MLEN; } - if (resid >= MINCLSIZE && space >= MCLBYTES) { + if (resid >= MINCLSIZE) { MCLGET(m, M_WAIT); if ((m->m_flags & M_EXT) == 0) goto nopages; mlen = MCLBYTES; -#ifdef MAPPED_MBUFS - len = min(MCLBYTES, resid); -#else - if (atomic && top == 0) { - len = min(MCLBYTES - max_hdr, resid); - m->m_data += max_hdr; - } else - len = min(MCLBYTES, resid); -#endif - space -= MCLBYTES; + len = min(min(mlen, resid), space); } else { nopages: len = min(min(mlen, resid), space); - space -= len; /* * For datagram protocols, leave room * for protocol headers in first mbuf. @@ -433,6 +423,7 @@ nopages: if (atomic && top == 0 && len < mlen) MH_ALIGN(m, len); } + space -= len; error = uiomove(mtod(m, caddr_t), (int)len, uio); resid = uio->uio_resid; m->m_len = len; |