Date: Thu, 24 Jun 2004 04:40:16 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 55695 for review Message-ID: <200406240440.i5O4eGUi053055@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=55695 Change 55695 by rwatson@rwatson_tislabs on 2004/06/24 04:39:22 Integrate netperf_socket: - Loop back socket buffer lock protections for low and high watermark socket options from rwatson_netperf. - Loop back out-of-band data locking for SPX from rwatson_netperf. - Loop back socket locking annotation updates, sowwakeup_locked() socket buffer assertions from rwatson_netperf. Affected files ... .. //depot/projects/netperf_socket/sys/kern/uipc_socket.c#24 integrate .. //depot/projects/netperf_socket/sys/netipx/spx_usrreq.c#7 integrate .. //depot/projects/netperf_socket/sys/sys/socketvar.h#19 integrate .. //depot/projects/netperf_socket/sys/vm/vm_pageout.c#7 integrate Differences ... ==== //depot/projects/netperf_socket/sys/kern/uipc_socket.c#24 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/uipc_socket.c,v 1.188 2004/06/24 00:54:26 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_socket.c,v 1.189 2004/06/24 04:28:30 rwatson Exp $"); #include "opt_inet.h" #include "opt_mac.h" @@ -1526,14 +1526,18 @@ * the high-water. */ case SO_SNDLOWAT: + SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_lowat = (optval > so->so_snd.sb_hiwat) ? so->so_snd.sb_hiwat : optval; + SOCKBUF_UNLOCK(&so->so_snd); break; case SO_RCVLOWAT: + SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_lowat = (optval > so->so_rcv.sb_hiwat) ? so->so_rcv.sb_hiwat : optval; + SOCKBUF_UNLOCK(&so->so_rcv); break; } break; ==== //depot/projects/netperf_socket/sys/netipx/spx_usrreq.c#7 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/netipx/spx_usrreq.c,v 1.44 2004/06/20 21:47:12 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/netipx/spx_usrreq.c,v 1.45 2004/06/24 04:29:53 rwatson Exp $"); #include <sys/param.h> #include <sys/lock.h> @@ -575,13 +575,12 @@ m = dtom(q); if (SI(q)->si_cc & SPX_OB) { cb->s_oobflags &= ~SF_IOOB; + SOCKBUF_LOCK(&so->so_rcv); if (so->so_rcv.sb_cc) so->so_oobmark = so->so_rcv.sb_cc; - else { - SOCKBUF_LOCK(&so->so_rcv); + else so->so_rcv.sb_state |= SBS_RCVATMARK; - SOCKBUF_UNLOCK(&so->so_rcv); - } + SOCKBUF_UNLOCK(&so->so_rcv); } q = q->si_prev; remque(q->si_next); @@ -610,8 +609,8 @@ if (sp->spx_cc & SPX_OB) { MCHTYPE(m, MT_OOBDATA); spx_newchecks[1]++; + SOCKBUF_LOCK(&so->so_rcv); so->so_oobmark = 0; - SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_state &= ~SBS_RCVATMARK; SOCKBUF_UNLOCK(&so->so_rcv); } ==== //depot/projects/netperf_socket/sys/sys/socketvar.h#19 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 - * $FreeBSD: src/sys/sys/socketvar.h,v 1.129 2004/06/24 03:12:46 rwatson Exp $ + * $FreeBSD: src/sys/sys/socketvar.h,v 1.130 2004/06/24 04:27:10 rwatson Exp $ */ #ifndef _SYS_SOCKETVAR_H_ @@ -85,7 +85,7 @@ connections */ short so_qlimit; /* (e) max number queued connections */ short so_timeo; /* (g) connection timeout */ - u_short so_error; /* error affecting connection */ + u_short so_error; /* (f) error affecting connection */ struct sigio *so_sigio; /* [sg] information for async I/O or out of band data (SIGURG) */ u_long so_oobmark; /* (c) chars to oob mark */ @@ -399,6 +399,7 @@ } while (0) #define sowwakeup_locked(so) do { \ + SOCKBUF_LOCK_ASSERT(&(so)->so_snd); \ if (sb_notify(&(so)->so_snd)) \ sowakeup((so), &(so)->so_snd); \ else \ ==== //depot/projects/netperf_socket/sys/vm/vm_pageout.c#7 (text+ko) ==== @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/vm/vm_pageout.c,v 1.257 2004/06/24 03:13:30 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_pageout.c,v 1.258 2004/06/24 04:08:43 alc Exp $"); #include "opt_vm.h" #include <sys/param.h> @@ -1243,6 +1243,7 @@ static int fullintervalcount = 0; int page_shortage; + mtx_assert(&vm_page_queue_mtx, MA_OWNED); page_shortage = (cnt.v_inactive_target + cnt.v_cache_max + cnt.v_free_min) - (cnt.v_free_count + cnt.v_inactive_count + cnt.v_cache_count); @@ -1250,7 +1251,6 @@ if (page_shortage <= 0) return; - vm_page_lock_queues(); pcount = cnt.v_active_count; fullintervalcount += vm_pageout_stats_interval; if (fullintervalcount < vm_pageout_full_stats_interval) { @@ -1313,7 +1313,6 @@ m = next; } - vm_page_unlock_queues(); } /* @@ -1437,9 +1436,9 @@ error = msleep(&vm_pages_needed, &vm_page_queue_mtx, PVM, "psleep", vm_pageout_stats_interval * hz); if (error && !vm_pages_needed) { - vm_page_unlock_queues(); pass = 0; vm_pageout_page_stats(); + vm_page_unlock_queues(); continue; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406240440.i5O4eGUi053055>