From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752540AbdJFU3P (ORCPT ); Fri, 6 Oct 2017 16:29:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:36408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751491AbdJFU3O (ORCPT ); Fri, 6 Oct 2017 16:29:14 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3C80218D1 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, 6 Oct 2017 13:29:12 -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 v4 02/13] xen/pvcalls: implement frontend disconnect In-Reply-To: <4aa02396-b2b6-dd89-b83c-32e6919c8f18@oracle.com> Message-ID: References: <1505516440-11111-1-git-send-email-sstabellini@kernel.org> <1505516440-11111-2-git-send-email-sstabellini@kernel.org> <7f24ec66-d370-5f2f-3c6a-8e949c8ed074@oracle.com> <4aa02396-b2b6-dd89-b83c-32e6919c8f18@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 On Fri, 6 Oct 2017, Boris Ostrovsky wrote: > On 10/06/2017 01:51 PM, Stefano Stabellini wrote: > > On Wed, 20 Sep 2017, Boris Ostrovsky wrote: > >>> + > >>> +struct pvcalls_bedata { > >>> + struct xen_pvcalls_front_ring ring; > >>> + grant_ref_t ref; > >>> + int irq; > >>> + > >>> + struct list_head socket_mappings; > >>> + struct list_head socketpass_mappings; > >>> + spinlock_t socket_lock; > >>> + > >>> + wait_queue_head_t inflight_req; > >>> + struct xen_pvcalls_response rsp[PVCALLS_NR_REQ_PER_RING]; > >>> +}; > >>> +static struct xenbus_device *pvcalls_front_dev; > >>> +static atomic_t pvcalls_refcount; > >> Should the refcount be per back/frontend? > > Yes it is, but only one back/frontend connection is supported by the > > frontend. I can add a comment. > > Since it's per backend connection --- shouldn't it be part of struct > pvcalls_bedata? struct pvcalls_bedata is allocated with kzalloc. To protect accesses to it, pvcalls_refcount needs to be outside of it.