Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1FB1C43381 for ; Tue, 19 Feb 2019 15:20:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D57020818 for ; Tue, 19 Feb 2019 15:20:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="uVdmPTDx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbfBSPUw (ORCPT ); Tue, 19 Feb 2019 10:20:52 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:55896 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726110AbfBSPUw (ORCPT ); Tue, 19 Feb 2019 10:20:52 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1JFJOqU020487; Tue, 19 Feb 2019 15:20:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=vCwkgkkDAgsi3G9F91C4OeMlrK7G12322Er7+NURNCY=; b=uVdmPTDxox66dEq8yMAG2t9bzOFAon2+gyq/svMxm1ZCbiLLDtEurWhnKVrH4GjP3UfP gPvxog30Ucg3P3Ba/nOtj5WWTfkYUGO0/FGIfePXm4RCkwoEnzYOV9FCnCKoYIiv9Gxl AIDZgguJHQ5tNU2x4D3GGl+Wbdfmibhy5/IrCjzgXB77paeD6pB4I/mV3sUki9ZLfJ5Z LP1MOjZ9ZmaHaFTHtZNfnNXdTPvX4BmLKWt3tJ7wY5u2tNm7nMgQbI3UZAdHiiJcW6cS 2Qg7V8iyZRLTCTvoftCXRI8Srz3UVXso8jqz7h9k/0M/oQIKe3EDIL9aL0JHTxyEoZ6L 0g== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2qp9xtuuss-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Feb 2019 15:20:49 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x1JFKhOu010725 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Feb 2019 15:20:43 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1JFKgZi032487; Tue, 19 Feb 2019 15:20:43 GMT Received: from anon-dhcp-171.1015granger.net (/68.61.232.219) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Feb 2019 07:20:42 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH] SUNRPC: Use poll() to fix up the socket requeue races From: Chuck Lever In-Reply-To: Date: Tue, 19 Feb 2019 10:20:41 -0500 Cc: Linux NFS Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: <255A7507-061E-41C3-84A4-211DFFB702ED@oracle.com> References: <20190219140616.123141-1-trond.myklebust@hammerspace.com> To: Trond Myklebust X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9172 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902190114 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > On Feb 19, 2019, at 10:13 AM, Trond Myklebust = wrote: >=20 > On Tue, 2019-02-19 at 09:54 -0500, Chuck Lever wrote: >> Hi Trond- >>=20 >>> On Feb 19, 2019, at 9:06 AM, Trond Myklebust >>> wrote: >>>=20 >>> Because we clear XPRT_SOCK_DATA_READY before reading, we can end up >>> with a situation where new data arrives, causing xs_data_ready() to >>> queue up a second receive worker job for the same socket, which >>> then >>> immediately gets stuck waiting on the transport receive mutex. >>> The fix is to only clear XPRT_SOCK_DATA_READY once we're done >>> reading, >>> and then to use poll() to check if we might need to queue up a new >>> job in order to deal with any new data. >>=20 >> Does this fix an application-visible hang, or is it merely a >> performance >> optimization? >=20 > I'm not aware of any hang associated with this behaviour. The patch is > rather intended as an optimisation to avoid having these threads block > uselessly on a mutex. That was my guess, thanks, just wanted to make certain. -- Chuck Lever