Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757278AbdIHV6O (ORCPT ); Fri, 8 Sep 2017 17:58:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:33634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757132AbdIHV6N (ORCPT ); Fri, 8 Sep 2017 17:58:13 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 977E620C48 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: Fri, 8 Sep 2017 14:58:11 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: Boris Ostrovsky cc: Stefano Stabellini , xen-devel@lists.xen.org, linux-kernel@vger.kernel.org, jgross@suse.com, Stefano Stabellini Subject: Re: [PATCH v3 08/13] xen/pvcalls: implement accept command In-Reply-To: <37d72529-c8d4-96e1-422c-342a19af9055@oracle.com> Message-ID: References: <1501541855-7354-1-git-send-email-sstabellini@kernel.org> <1501541855-7354-8-git-send-email-sstabellini@kernel.org> <1a368546-fec3-7f10-cc1b-296e095c9ba1@oracle.com> <37d72529-c8d4-96e1-422c-342a19af9055@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: 516 Lines: 20 On Mon, 14 Aug 2017, Boris Ostrovsky wrote: > > > + > > > + ret = bedata->rsp[req_id].ret; > > > > You can just return bedata->rsp[req_id].ret; > > Or maybe not. The slot may get reused by the time you get to the end. Right! > > > > -boris > > > > > + /* read ret, then set this rsp slot to be reused */ > > > + smp_mb(); > > > + WRITE_ONCE(bedata->rsp[req_id].req_id, PVCALLS_INVALID_ID); > > > + WRITE_ONCE(map->passive.inflight_req_id, PVCALLS_INVALID_ID); > > > + return ret; > > > +} >