From owner-freebsd-net@FreeBSD.ORG Sun Oct 5 06:33:00 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20BD4901; Sun, 5 Oct 2014 06:33:00 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAF7FA25; Sun, 5 Oct 2014 06:32:59 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NCY001IPKUF9940@st11p02mm-asmtp002.mac.com>; Sun, 05 Oct 2014 06:32:41 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.28,0.0.0000 definitions=2014-10-05_02:2014-10-03,2014-10-05,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1410050075 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.0 \(1988\)) Subject: Re: [PATCH] Only lock send buffer in sopoll() if needed From: Rui Paulo In-reply-to: <201409301400.09999.jhb@freebsd.org> Date: Sat, 04 Oct 2014 23:32:38 -0700 Content-transfer-encoding: quoted-printable Message-id: <5442AFCD-14D1-4CCE-B86E-140C534E2C95@me.com> References: <201409301400.09999.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1988) Cc: Robert Watson , net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Oct 2014 06:33:00 -0000 On Sep 30, 2014, at 11:00, John Baldwin wrote: >=20 > Right now sopoll() always locks both socket buffers. The receive = socket=20 > buffer lock is always needed, but the send socket buffer lock is only = needed=20 > while polling for writing (there is a potential test of = SBS_CANTSENDMORE=20 > without the lock, but I think this might be ok). What do folks think? Does this really help us much? Are you worried about sending data when = another thread is polling? The patch looks ok, but I'm not sure about the handling of POLLHUP. I = suppose that's okay since if that flag is set, the socket is = disconnected. -- Rui Paulo