Date: Wed, 21 Mar 2007 20:56:28 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 116292 for review Message-ID: <200703212056.l2LKuSul017862@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=116292 Change 116292 by jhb@jhb_mutex on 2007/03/21 20:55:35 IFC @116291 Affected files ... .. //depot/projects/smpng/sys/kern/kern_condvar.c#45 integrate .. //depot/projects/smpng/sys/kern/kern_lock.c#60 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#126 integrate .. //depot/projects/smpng/sys/netinet/tcp_hostcache.c#10 integrate .. //depot/projects/smpng/sys/netinet/tcp_input.c#100 integrate .. //depot/projects/smpng/sys/netinet/tcp_output.c#46 integrate .. //depot/projects/smpng/sys/netinet/tcp_sack.c#19 integrate .. //depot/projects/smpng/sys/netinet/tcp_subr.c#89 integrate .. //depot/projects/smpng/sys/netinet/tcp_timer.c#34 integrate .. //depot/projects/smpng/sys/netinet/tcp_usrreq.c#59 integrate Differences ... ==== //depot/projects/smpng/sys/kern/kern_condvar.c#45 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_condvar.c,v 1.57 2006/12/16 06:54:08 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_condvar.c,v 1.58 2007/03/21 20:46:26 jhb Exp $"); #include "opt_ktrace.h" @@ -96,7 +96,16 @@ cv_wait(struct cv *cvp, struct mtx *mp) { WITNESS_SAVE_DECL(mp); + struct thread *td; + td = curthread; +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) + ktrcsw(1, 0); +#endif + CV_ASSERT(cvp, mp, td); + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &mp->mtx_object, + "Waiting on \"%s\"", cvp->cv_description); WITNESS_SAVE(&mp->mtx_object, mp); if (cold || panicstr) { @@ -109,7 +118,21 @@ return; } - cv_wait_unlock(cvp, mp); + sleepq_lock(cvp); + + cvp->cv_waiters++; + DROP_GIANT(); + mtx_unlock(mp); + + sleepq_add(cvp, &mp->mtx_object, cvp->cv_description, SLEEPQ_CONDVAR, + 0); + sleepq_wait(cvp); + +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) + ktrcsw(0, 0); +#endif + PICKUP_GIANT(); mtx_lock(mp); WITNESS_RESTORE(&mp->mtx_object, mp); } @@ -153,6 +176,10 @@ 0); sleepq_wait(cvp); +#ifdef KTRACE + if (KTRPOINT(td, KTR_CSW)) + ktrcsw(0, 0); +#endif PICKUP_GIANT(); } ==== //depot/projects/smpng/sys/kern/kern_lock.c#60 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_lock.c,v 1.106 2007/03/09 16:27:11 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_lock.c,v 1.107 2007/03/21 19:28:20 jhb Exp $"); #include "opt_ddb.h" #include "opt_global.h" ==== //depot/projects/smpng/sys/kern/vfs_syscalls.c#126 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.433 2007/03/14 08:45:55 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.434 2007/03/21 19:32:08 jhb Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/smpng/sys/netinet/tcp_hostcache.c#10 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netinet/tcp_hostcache.c,v 1.11 2006/12/12 12:17:56 bz Exp $ + * $FreeBSD: src/sys/netinet/tcp_hostcache.c,v 1.12 2007/03/21 19:34:12 andre Exp $ */ /* @@ -156,26 +156,26 @@ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0, "TCP Host cache"); SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, cachelimit, CTLFLAG_RDTUN, - &tcp_hostcache.cache_limit, 0, "Overall entry limit for hostcache"); + &tcp_hostcache.cache_limit, 0, "Overall entry limit for hostcache"); SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, hashsize, CTLFLAG_RDTUN, - &tcp_hostcache.hashsize, 0, "Size of TCP hostcache hashtable"); + &tcp_hostcache.hashsize, 0, "Size of TCP hostcache hashtable"); SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, bucketlimit, CTLFLAG_RDTUN, - &tcp_hostcache.bucket_limit, 0, "Per-bucket hash limit for hostcache"); + &tcp_hostcache.bucket_limit, 0, "Per-bucket hash limit for hostcache"); SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, count, CTLFLAG_RD, - &tcp_hostcache.cache_count, 0, "Current number of entries in hostcache"); + &tcp_hostcache.cache_count, 0, "Current number of entries in hostcache"); SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, expire, CTLFLAG_RW, - &tcp_hostcache.expire, 0, "Expire time of TCP hostcache entries"); + &tcp_hostcache.expire, 0, "Expire time of TCP hostcache entries"); SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, purge, CTLFLAG_RW, - &tcp_hostcache.purgeall, 0, "Expire all entires on next purge run"); + &tcp_hostcache.purgeall, 0, "Expire all entires on next purge run"); SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, list, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP, 0, 0, - sysctl_tcp_hc_list, "A", "List of all hostcache entries"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP, 0, 0, + sysctl_tcp_hc_list, "A", "List of all hostcache entries"); static MALLOC_DEFINE(M_HOSTCACHE, "hostcache", "TCP hostcache"); ==== //depot/projects/smpng/sys/netinet/tcp_input.c#100 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_input.c,v 1.324 2007/03/21 18:56:03 andre Exp $ + * $FreeBSD: src/sys/netinet/tcp_input.c,v 1.325 2007/03/21 19:37:55 andre Exp $ */ #include "opt_ipfw.h" /* for ipfw_fwd */ @@ -236,11 +236,7 @@ } static int -tcp_reass(tp, th, tlenp, m) - register struct tcpcb *tp; - register struct tcphdr *th; - int *tlenp; - struct mbuf *m; +tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) { struct tseg_qent *q; struct tseg_qent *p = NULL; @@ -310,7 +306,7 @@ * segment. If it provides all of our data, drop us. */ if (p != NULL) { - register int i; + int i; /* conversion to int (in i) handles seq wraparound */ i = p->tqe_th->th_seq + p->tqe_len - th->th_seq; if (i > 0) { @@ -342,7 +338,7 @@ * if they are completely covered, dequeue them. */ while (q) { - register int i = (th->th_seq + *tlenp) - q->tqe_th->th_seq; + int i = (th->th_seq + *tlenp) - q->tqe_th->th_seq; if (i <= 0) break; if (i < q->tqe_len) { @@ -408,11 +404,9 @@ */ #ifdef INET6 int -tcp6_input(mp, offp, proto) - struct mbuf **mp; - int *offp, proto; +tcp6_input(struct mbuf **mp, int *offp, int proto) { - register struct mbuf *m = *mp; + struct mbuf *m = *mp; struct in6_ifaddr *ia6; IP6_EXTHDR_CHECK(m, *offp, sizeof(struct tcphdr), IPPROTO_DONE); @@ -437,20 +431,18 @@ #endif void -tcp_input(m, off0) - register struct mbuf *m; - int off0; +tcp_input(struct mbuf *m, int off0) { - register struct tcphdr *th; - register struct ip *ip = NULL; - register struct ipovly *ipov; - register struct inpcb *inp = NULL; + struct tcphdr *th; + struct ip *ip = NULL; + struct ipovly *ipov; + struct inpcb *inp = NULL; u_char *optp = NULL; int optlen = 0; int len, tlen, off; int drop_hdrlen; - register struct tcpcb *tp = 0; - register int thflags; + struct tcpcb *tp = 0; + int thflags; struct socket *so = 0; int todrop, acked, ourfinisacked, needoutput = 0; u_long tiwin; @@ -2137,8 +2129,8 @@ */ if ((!tcp_do_newreno && !tp->sack_enable) || !IN_FASTRECOVERY(tp)) { - register u_int cw = tp->snd_cwnd; - register u_int incr = tp->t_maxseg; + u_int cw = tp->snd_cwnd; + u_int incr = tp->t_maxseg; if (cw > tp->snd_ssthresh) incr = incr * incr / cw; tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<<tp->snd_scale); @@ -2597,11 +2589,7 @@ * Parse TCP options and place in tcpopt. */ static void -tcp_dooptions(to, cp, cnt, flags) - struct tcpopt *to; - u_char *cp; - int cnt; - int flags; +tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags) { int opt, optlen; @@ -2691,11 +2679,8 @@ * sequencing purposes. */ static void -tcp_pulloutofband(so, th, m, off) - struct socket *so; - struct tcphdr *th; - register struct mbuf *m; - int off; /* delayed to be droped hdrlen */ +tcp_pulloutofband(struct socket *so, struct tcphdr *th, struct mbuf *m, + int off) { int cnt = off + th->th_urp - 1; @@ -2725,11 +2710,9 @@ * and update averages and current timeout. */ static void -tcp_xmit_timer(tp, rtt) - register struct tcpcb *tp; - int rtt; +tcp_xmit_timer(struct tcpcb *tp, int rtt) { - register int delta; + int delta; INP_LOCK_ASSERT(tp->t_inpcb); @@ -2833,9 +2816,7 @@ * segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt(). */ void -tcp_mss(tp, offer) - struct tcpcb *tp; - int offer; +tcp_mss(struct tcpcb *tp, int offer) { int rtt, mss; u_long bufsize; @@ -3079,8 +3060,7 @@ * Determine the MSS option to send on an outgoing SYN. */ int -tcp_mssopt(inc) - struct in_conninfo *inc; +tcp_mssopt(struct in_conninfo *inc) { int mss = 0; u_long maxmtu = 0; @@ -3122,9 +3102,7 @@ * be started again. */ static void -tcp_newreno_partial_ack(tp, th) - struct tcpcb *tp; - struct tcphdr *th; +tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th) { tcp_seq onxt = tp->snd_nxt; u_long ocwnd = tp->snd_cwnd; @@ -3158,12 +3136,8 @@ * looking for a pcb in the listen state. Returns 0 otherwise. */ static int -tcp_timewait(inp, to, th, m, tlen) - struct inpcb *inp; - struct tcpopt *to; - struct tcphdr *th; - struct mbuf *m; - int tlen; +tcp_timewait(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, + struct mbuf *m, int tlen) { struct tcptw *tw; int thflags; ==== //depot/projects/smpng/sys/netinet/tcp_output.c#46 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_output.c,v 1.129 2007/03/21 19:04:07 andre Exp $ + * $FreeBSD: src/sys/netinet/tcp_output.c,v 1.130 2007/03/21 19:37:55 andre Exp $ */ #include "opt_inet.h" @@ -1226,8 +1226,7 @@ } void -tcp_setpersist(tp) - register struct tcpcb *tp; +tcp_setpersist(struct tcpcb *tp) { int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; int tt; ==== //depot/projects/smpng/sys/netinet/tcp_sack.c#19 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)tcp_sack.c 8.12 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_sack.c,v 1.33 2007/03/21 18:25:28 andre Exp $ + * $FreeBSD: src/sys/netinet/tcp_sack.c,v 1.34 2007/03/21 19:37:55 andre Exp $ */ /*- @@ -319,7 +319,7 @@ */ static struct sackhole * tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, - struct sackhole *after) + struct sackhole *after) { struct sackhole *hole; @@ -582,9 +582,7 @@ * of sack recovery. */ void -tcp_sack_partialack(tp, th) - struct tcpcb *tp; - struct tcphdr *th; +tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th) { int num_segs = 1; ==== //depot/projects/smpng/sys/netinet/tcp_subr.c#89 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.271 2007/03/21 18:05:54 andre Exp $ + * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.272 2007/03/21 19:37:55 andre Exp $ */ #include "opt_compat.h" @@ -466,10 +466,10 @@ * NOTE: If m != NULL, then ti must point to *inside* the mbuf. */ void -tcp_respond(struct tcpcb *tp, void *ipgen, register struct tcphdr *th, - register struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags) +tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, + struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags) { - register int tlen; + int tlen; int win = 0; struct ip *ip; struct tcphdr *nth; @@ -1058,7 +1058,7 @@ } SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, - tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); + tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); static int tcp_getcred(SYSCTL_HANDLER_ARGS) ==== //depot/projects/smpng/sys/netinet/tcp_timer.c#34 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_timer.c,v 1.87 2007/03/19 18:57:10 andre Exp $ + * $FreeBSD: src/sys/netinet/tcp_timer.c,v 1.88 2007/03/21 19:37:55 andre Exp $ */ #include "opt_inet6.h" @@ -146,8 +146,7 @@ */ void -tcp_timer_delack(xtp) - void *xtp; +tcp_timer_delack(void *xtp) { struct tcpcb *tp = xtp; struct inpcb *inp; @@ -182,8 +181,7 @@ } void -tcp_timer_2msl(xtp) - void *xtp; +tcp_timer_2msl(void *xtp) { struct tcpcb *tp = xtp; struct inpcb *inp; @@ -306,8 +304,7 @@ } void -tcp_timer_keep(xtp) - void *xtp; +tcp_timer_keep(void *xtp) { struct tcpcb *tp = xtp; struct tcptemp *t_template; @@ -398,8 +395,7 @@ } void -tcp_timer_persist(xtp) - void *xtp; +tcp_timer_persist(void *xtp) { struct tcpcb *tp = xtp; struct inpcb *inp; @@ -465,8 +461,7 @@ } void -tcp_timer_rexmt(xtp) - void *xtp; +tcp_timer_rexmt(void * xtp) { struct tcpcb *tp = xtp; int rexmt; ==== //depot/projects/smpng/sys/netinet/tcp_usrreq.c#59 (text+ko) ==== @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 - * $FreeBSD: src/sys/netinet/tcp_usrreq.c,v 1.148 2007/03/21 18:05:54 andre Exp $ + * $FreeBSD: src/sys/netinet/tcp_usrreq.c,v 1.149 2007/03/21 19:37:55 andre Exp $ */ #include "opt_ddb.h" @@ -777,7 +777,7 @@ */ static int tcp_usr_send(struct socket *so, int flags, struct mbuf *m, - struct sockaddr *nam, struct mbuf *control, struct thread *td) + struct sockaddr *nam, struct mbuf *control, struct thread *td) { int error = 0; struct inpcb *inp; @@ -1100,10 +1100,7 @@ * Initialize connection parameters and enter SYN-SENT state. */ static int -tcp_connect(tp, nam, td) - register struct tcpcb *tp; - struct sockaddr *nam; - struct thread *td; +tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td) { struct inpcb *inp = tp->t_inpcb, *oinp; struct socket *so = inp->inp_socket; @@ -1159,10 +1156,7 @@ #ifdef INET6 static int -tcp6_connect(tp, nam, td) - register struct tcpcb *tp; - struct sockaddr *nam; - struct thread *td; +tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td) { struct inpcb *inp = tp->t_inpcb, *oinp; struct socket *so = inp->inp_socket; @@ -1232,9 +1226,7 @@ * from Linux. */ static void -tcp_fill_info(tp, ti) - struct tcpcb *tp; - struct tcp_info *ti; +tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti) { INP_LOCK_ASSERT(tp->t_inpcb); @@ -1276,9 +1268,7 @@ * the inpcb lock. */ int -tcp_ctloutput(so, sopt) - struct socket *so; - struct sockopt *sopt; +tcp_ctloutput(struct socket *so, struct sockopt *sopt) { int error, opt, optval; struct inpcb *inp; @@ -1440,10 +1430,9 @@ * bufer space, and entering LISTEN state if to accept connections. */ static int -tcp_attach(so) - struct socket *so; +tcp_attach(struct socket *so) { - register struct tcpcb *tp; + struct tcpcb *tp; struct inpcb *inp; int error; #ifdef INET6 @@ -1503,8 +1492,7 @@ * send segment to peer (with FIN). */ static void -tcp_disconnect(tp) - register struct tcpcb *tp; +tcp_disconnect(struct tcpcb *tp) { struct inpcb *inp = tp->t_inpcb; struct socket *so = inp->inp_socket; @@ -1544,8 +1532,7 @@ * We can let the user exit from the close as soon as the FIN is acked. */ static void -tcp_usrclosed(tp) - register struct tcpcb *tp; +tcp_usrclosed(struct tcpcb *tp) { INP_INFO_WLOCK_ASSERT(&tcbinfo);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703212056.l2LKuSul017862>