Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751406AbdGZVcG (ORCPT ); Wed, 26 Jul 2017 17:32:06 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:39422 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbdGZVcF (ORCPT ); Wed, 26 Jul 2017 17:32:05 -0400 Subject: Re: [Xen-devel] [PATCH v2 09/13] xen/pvcalls: implement recvmsg To: Stefano Stabellini , xen-devel@lists.xen.org References: <1501017730-12797-1-git-send-email-sstabellini@kernel.org> <1501017730-12797-9-git-send-email-sstabellini@kernel.org> <3485ca4d-9c8f-fe0d-fc07-31578e370228@oracle.com> Cc: jgross@suse.com, Stefano Stabellini , linux-kernel@vger.kernel.org From: Boris Ostrovsky Message-ID: Date: Wed, 26 Jul 2017 17:33:34 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <3485ca4d-9c8f-fe0d-fc07-31578e370228@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 628 Lines: 20 >> + while (!(flags & MSG_DONTWAIT) && !pvcalls_front_read_todo(map)) { >> + if (count < PVCALLS_FRONT_MAX_SPIN) >> + count++; >> + else >> + wait_event_interruptible(map->active.inflight_conn_req, >> + pvcalls_front_read_todo(map)); >> + } > Should we be using PVCALLS_FRONT_MAX_SPIN here? In sendmsg it is > counting non-sleeping iterations but here we are sleeping so > PVCALLS_FRONT_MAX_SPIN (5000) may take a while. > > In fact, what shouldn't this waiting be a function of MSG_DONTWAIT err, which it already is. But the question still stands (except for MSG_DONTWAIT). -boris > and/or socket's O_NONBLOCK?