Received: by 10.223.176.5 with SMTP id f5csp2800534wra; Mon, 5 Feb 2018 10:03:01 -0800 (PST) X-Google-Smtp-Source: AH8x224Y+fm68Vm5DooinTlgMpvdvrcv+CW0YWr7k6dB8lXEXMeNQ4vHK96wpQsZ67w/XYNlhrzC X-Received: by 10.99.120.134 with SMTP id t128mr23353648pgc.313.1517853780989; Mon, 05 Feb 2018 10:03:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517853780; cv=none; d=google.com; s=arc-20160816; b=pyG9s/XzB0aaBc2Y75YdwX/lvVKSGckgQ2qEPgBP8SGt+y/zyAhusVoGdUsJZPbDCQ PwDJRzbsa+K1Y7KEUojUSQQGstP2PTaNPnVIMidgDVSRej4Qw114/6DoWvDDUjCrZ9Oc IEfxVqakNyygBavZvD/JzXJ0mxpERUB65ZpxO0rhhE4IpVq6Ayuo3LzmRf/XUmYl3T6w 5n72FBH++jfvzhINFmF8Vp2cwA+iicX4+uPBec2cLPjPu2Rw5XIEq0e9PDYHCc2xo8/H QC60CgIfwVa4Oh/EhSdQjk8O8Q351Nb37aDgoPmRD5Rno0fYROGBxBHep2nZEgrQb70f +TAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dmarc-filter :arc-authentication-results; bh=vc5k+/KX8KQTwToh/eHt9eLN7uVPd5VzRP+TDswRHd0=; b=H65QgNyZhWUKHcBs8pEgEpWxNTEetKonDQdK8JO8kht6xv/rH0YXzIQgVs6RmNZ7Um lInaDuCRKcGp6lg+KpwCI8OvWM/EXBIfm0zQ9HoFMi6b9qRfkKz3fEtM+o4qapwqKKPA UAEyUhzbnQBJxo0uE0RLvCsEARSAdUQmMG98c2xEsmoGmiZQrGZY4pDLTgPlDGU+ikui ZNW5hyJ9D/Dqmg3jlv3G6OsZ69PL9qeGK+EEO6jV+oaBm+g6S88qshoX9N4MzzcrJ8/1 OQ53VvTWjl5mY9TCiDdUWP9mIuIxQOVmopX8VMdvb2E3a2GxdZAoW2pRsu/d9L8P9YtC bXYw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p6si76155pgd.282.2018.02.05.10.02.46; Mon, 05 Feb 2018 10:03:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbeBESBk (ORCPT + 99 others); Mon, 5 Feb 2018 13:01:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:34180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753028AbeBESBe (ORCPT ); Mon, 5 Feb 2018 13:01:34 -0500 Received: from [10.135.48.227] (unknown [12.248.85.146]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C5C7E2172D; Mon, 5 Feb 2018 18:01:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5C7E2172D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sstabellini@kernel.org Date: Mon, 5 Feb 2018 10:01:32 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: Boris Ostrovsky cc: Stefano Stabellini , jgross@suse.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pvcalls-back: do not return error on inet_accept EAGAIN In-Reply-To: <936e4d18-3f0d-3fc5-2272-c1ad9a5c7022@oracle.com> Message-ID: References: <936e4d18-3f0d-3fc5-2272-c1ad9a5c7022@oracle.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1047736138-1517853694=:10160" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1047736138-1517853694=:10160 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT 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." https://xenbits.xen.org/docs/unstable/misc/pvcalls.html Look under the "Accept" sub-chapter. Cheers, Stefano --8323329-1047736138-1517853694=:10160--