From owner-cvs-all@FreeBSD.ORG Sat Jun 26 19:10:56 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22C7B16A4CE; Sat, 26 Jun 2004 19:10:56 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 191BB43D1F; Sat, 26 Jun 2004 19:10:56 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5QJAdkF072788; Sat, 26 Jun 2004 19:10:39 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5QJAd8d072787; Sat, 26 Jun 2004 19:10:39 GMT (envelope-from rwatson) Message-Id: <200406261910.i5QJAd8d072787@repoman.freebsd.org> From: Robert Watson Date: Sat, 26 Jun 2004 19:10:39 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern uipc_socket2.c uipc_usrreq.c src/sys/netinet ip_divert.c ip_mroute.c raw_ip.c tcp_input.c udp_usrreq.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2004 19:10:56 -0000 rwatson 2004-06-26 19:10:39 UTC FreeBSD src repository Modified files: sys/kern uipc_socket2.c uipc_usrreq.c sys/netinet ip_divert.c ip_mroute.c raw_ip.c tcp_input.c udp_usrreq.c Log: Reduce the number of unnecessary unlock-relocks on socket buffer mutexes associated with performing a wakeup on the socket buffer: - When performing an sbappend*() followed by a so[rw]wakeup(), explicitly acquire the socket buffer lock and use the _locked() variants of both calls. Note that the _locked() sowakeup() versions unlock the mutex on return. This is done in uipc_send(), divert_packet(), mroute socket_send(), raw_append(), tcp_reass(), tcp_input(), and udp_append(). - When the socket buffer lock is dropped before a sowakeup(), remove the explicit unlock and use the _locked() sowakeup() variant. This is done in soisdisconnecting(), soisdisconnected() when setting the can't send/ receive flags and dropping data, and in uipc_rcvd() which adjusting back-pressure on the sockets. For UNIX domain sockets running mpsafe with a contention-intensive SMP mysql benchmark, this results in a 1.6% query rate improvement due to reduce mutex costs. Revision Changes Path 1.136 +5 -8 src/sys/kern/uipc_socket2.c 1.131 +3 -6 src/sys/kern/uipc_usrreq.c 1.93 +6 -4 src/sys/netinet/ip_divert.c 1.102 +5 -2 src/sys/netinet/ip_mroute.c 1.135 +7 -3 src/sys/netinet/raw_ip.c 1.248 +13 -8 src/sys/netinet/tcp_input.c 1.156 +7 -2 src/sys/netinet/udp_usrreq.c