From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753061AbdHOCFQ (ORCPT ); Mon, 14 Aug 2017 22:05:16 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:19565 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752923AbdHOCFN (ORCPT ); Mon, 14 Aug 2017 22:05:13 -0400 Subject: Re: [PATCH v3 08/13] xen/pvcalls: implement accept command From: Boris Ostrovsky To: Stefano Stabellini , xen-devel@lists.xen.org Cc: linux-kernel@vger.kernel.org, jgross@suse.com, Stefano Stabellini 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> Message-ID: <37d72529-c8d4-96e1-422c-342a19af9055@oracle.com> Date: Mon, 14 Aug 2017 22:04:59 -0400 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: <1a368546-fec3-7f10-cc1b-296e095c9ba1@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> + >> + 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. -boris > > -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; >> +}