Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751466AbdG0AIi (ORCPT ); Wed, 26 Jul 2017 20:08:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:41752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbdG0AIh (ORCPT ); Wed, 26 Jul 2017 20:08:37 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B9AF22BC7 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: Wed, 26 Jul 2017 17:08:36 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: Boris Ostrovsky cc: Stefano Stabellini , xen-devel@lists.xen.org, jgross@suse.com, Stefano Stabellini , linux-kernel@vger.kernel.org Subject: Re: [Xen-devel] [PATCH v2 09/13] xen/pvcalls: implement recvmsg In-Reply-To: Message-ID: 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> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 777 Lines: 19 On Wed, 26 Jul 2017, Boris Ostrovsky wrote: > >> + 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). The code (admittedly unintuitive) is busy-looping (non-sleeping) for 5000 iterations *before* attempting to sleep. So in that regard, recvmsg and sendmsg use PVCALLS_FRONT_MAX_SPIN in the same way: only for non-sleeping iterations.