Received: by 10.223.176.5 with SMTP id f5csp2832798wra; Mon, 5 Feb 2018 10:36:16 -0800 (PST) X-Google-Smtp-Source: AH8x226QlwcrzMvZE07ZrQaar+yL5cueQA9L8i4nAiNgAmXpiOe9TUlJzI8fwzF4zXjKN2or51wI X-Received: by 2002:a17:902:b486:: with SMTP id y6-v6mr23714338plr.70.1517855775949; Mon, 05 Feb 2018 10:36:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517855775; cv=none; d=google.com; s=arc-20160816; b=ihJNuDpSqM1tNosjWqvsL5LhKkxs5cpIuxJedFIKJBzBFfDseeMF5V+ViWL8kc5iE9 asDxC7+orC3oOOLvgiovje7aDQqbS/LZitLyxlQx+WUXCdf/HdrM8oH9shNDZ4uY2Q7Y kbC0xs/xA+CJnVb4e+e+TYGJKekPGEfU5iFmEf2V4zfZE35XSIH4ppXjvF0eVRRzxDra Floc4IensfJqlIyhMtVadXzQzUKBdNRUxcDaBZO/KiC3q70LOZLPmF2LD0ve2QAhOTXb Uwd6iCu/Xud0Nf/XiSa36WG6J1pBE3O/yBX7JqTr/bgTk4nO7dp21KqQCxsKDlV7W8a/ jICg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=HohJqVB+/oZ0qCC2b+4K2Y8JW44hZv1LXF0ru/2UUF4=; b=vm3LPvkNZrmYpFECDeYny0yoy9Rnhkfy1hH7GS1NKJNbV/fSHsVZO5wdJsSwQ+gDCN cEw+Hy91XhYh2AJswA5jhVgv+/Ddx969lMPFFQfUVqytts/W3w+nfF+daVRotCHKnldK Gns7o3UWnwVCaeVXTF6tnd7Bw0WK8AWAE961x+lEnxegWvY4/pIRdSXSlFt2HFrcJJfk NyYvA1MpwQd6kTrGcjl/QYbv/I0PY79Vlw3BiaSfJ1cUVpuCUhQuMVYBivqbG04zRVBv r3KZH72eo6bVEi3suJXb2+iv/xsQq1TK1vPAwMhsmM3F+h6ZWj6tICjP3ansp8QAOQzl L87A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=gpJN+GjE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35-v6si1064987plh.147.2018.02.05.10.36.01; Mon, 05 Feb 2018 10:36:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=gpJN+GjE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754058AbeBESdv (ORCPT + 99 others); Mon, 5 Feb 2018 13:33:51 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:35908 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753748AbeBESdi (ORCPT ); Mon, 5 Feb 2018 13:33:38 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w15IW2Ho087182; Mon, 5 Feb 2018 18:33:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=HohJqVB+/oZ0qCC2b+4K2Y8JW44hZv1LXF0ru/2UUF4=; b=gpJN+GjEAxpND9VKBwiOSoMPGbzSDXOVfd2vRpCW803KZGO1hdy7pJrlmmKIYxPnbRBF /ds3L6+zrfOUIRFSKFJg4XHN6RbdG4NtBcF+keMMhrRWemc7KzbqQw5g1BvtJQnks+QV G5CUqwShzNAJE/7N35428MbIfo3r2QNHO/v7d10w7yDb8PP1XbBGClMn4bFINVAs7jxZ 0ppz9ACeJXzVYp/7MgjpATjEhNoPJjPqcAcsTZA7XmX4IrgYX9I+pvSgECJ73bR3znSH xILU0k3m45ElXDz0pWmGR8Ov0FddAMrirT7E5D7jJui/qZbEmZevJQMzL5GcYfZoXapI Kg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2fxv5w063e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Feb 2018 18:33:31 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w15IXV0O024481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Feb 2018 18:33:31 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w15IXUTh004996; Mon, 5 Feb 2018 18:33:31 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Feb 2018 10:33:30 -0800 Subject: Re: [PATCH] pvcalls-back: do not return error on inet_accept EAGAIN To: Stefano Stabellini Cc: jgross@suse.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org References: <936e4d18-3f0d-3fc5-2272-c1ad9a5c7022@oracle.com> From: Boris Ostrovsky Message-ID: Date: Mon, 5 Feb 2018 13:34:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8796 signatures=668662 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802050234 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/05/2018 01:01 PM, Stefano Stabellini wrote: > On Sun, 4 Feb 2018, Boris Ostrovsky wrote: >> On 02/02/2018 08:34 PM, Stefano Stabellini wrote: >>> When the client sends a regular blocking accept request, the backend is >>> expected to return only when the accept is completed, simulating a >>> blocking behavior, or return an error. >>> >>> Specifically, on EAGAIN from inet_accept, the backend shouldn't return >>> "EAGAIN" to the client. Instead, it should simply continue the wait. >>> Otherwise, the client will send another accept request, which will cause >>> another EAGAIN to be sent back, which is a waste of resources and not >>> conforming to the expected behavior. Change the behavior by turning the >>> "goto error" into a return. >>> >>> Signed-off-by: Stefano Stabellini >> >> I am looking at SYSCALL_DEFINE4(accept4) and sock->ops->accept (which *I >> think* is inet_accept, at least in some cases) passes all errors (including >> EAGAIN) back to the caller. Is this a different case? > Hi Boris, > > I didn't explain myself well. You are right that inet_accept passes all > errors back to the caller, but this is different: not only it would be a > waste of resources to do so, but the different behavior is specified in > the PVCalls spec: > > "The backend will reply to the request only when a new connection is > successfully accepted, i.e. the backend does not return EAGAIN or > EWOULDBLOCK." Got it, thanks. Reviewed-by: Boris Ostrovsky -boris > > https://xenbits.xen.org/docs/unstable/misc/pvcalls.html > > Look under the "Accept" sub-chapter. > > Cheers, > > Stefano