Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1459564ybe; Thu, 5 Sep 2019 16:06:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8PuHL+mx6VllBBhTpjI6E8ifMDFladSJ5+QMq6QDrW901rDxicWVhDFt3bMhdxc2n3rW8 X-Received: by 2002:a63:6a81:: with SMTP id f123mr5508693pgc.348.1567724761908; Thu, 05 Sep 2019 16:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567724761; cv=none; d=google.com; s=arc-20160816; b=WKA8ccLdiwSGvoxq61rg9zB7+XF9F7R++E6jD7mq5SSzBVYb9xsBW87wNpZh3xtouw UsTQEV43OX5ezI1VeiN9Bf0bBMk+XSsGMY5px4RSuQZFsMJYiHccLGTSWFCO4MEHS9ry hdGQ8708HOPiqgAw7DRs2G1toEolerpr2M8GcOJ9Z+CMym0jHZenmtoiKfBE6t24ao5v nwIbe9o/Bt3yqHl73BlkU35QmG6z/NngWujb9Ib/NPEztrXT505IM3LZLQPUtzhMpvEm bcPzWBwflish7VPlsfSC9W0LnCtcKF0godY2sAzwFDKPnfH20/Tg3Spa59Ck67a8kAJb 3zTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CEvyUsDi+NtemN50w7Yzohzb2dsDBrrkrRfTTcAunHc=; b=BOb5tal5P2WIyXfLrnm4QOJ8xHBuB5KuHRT/BflpLGvInsHEQ2S83+csipMPOlUH0Q uUrK6BoS7S6Rhy0h34/LHAOZZnFsIOTixxG7scJtqzWohT8oQrprzIRA9PXn/i2OCvpl G/rE5+E5sI6EaCvIMoGd7Czhvq9R76NOpKtDNd5jPYkQ32hra+W4WWhPkxK+8dwidNzw vpV4FAEr8TECZWZgreuvdYFs1CozCDbuKVRsv3f00qL6HgwubA4yjUMWw07+c+H2jV4V agU+d1WP3vy8ylK5P9UX0mWST4HZ3fX1NO13fKThR2MbfHlyMLtg46NGad4t494IkICA OZxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c75si3707968pfc.180.2019.09.05.16.05.44; Thu, 05 Sep 2019 16:06:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390367AbfIETtr (ORCPT + 99 others); Thu, 5 Sep 2019 15:49:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390162AbfIETte (ORCPT ); Thu, 5 Sep 2019 15:49:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DB32308FBAC; Thu, 5 Sep 2019 19:49:34 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66C2419C77; Thu, 5 Sep 2019 19:49:26 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id D781822539D; Thu, 5 Sep 2019 15:49:17 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org, miklos@szeredi.hu Cc: linux-kernel@vger.kernel.org, virtio-fs@redhat.com, vgoyal@redhat.com, stefanha@redhat.com, dgilbert@redhat.com, mst@redhat.com Subject: [PATCH 05/18] Maintain count of in flight requests for VQ_REQUEST queue Date: Thu, 5 Sep 2019 15:48:46 -0400 Message-Id: <20190905194859.16219-6-vgoyal@redhat.com> In-Reply-To: <20190905194859.16219-1-vgoyal@redhat.com> References: <20190905194859.16219-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 05 Sep 2019 19:49:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As of now we maintain this count only for VQ_HIPRIO. Maintain it for VQ_REQUEST as well so that later it can be used to drain VQ_REQUEST queue. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index c46dd4d284d6..5df97dfee37d 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -360,6 +360,9 @@ static void virtio_fs_requests_done_work(struct work_struct *work) spin_unlock(&fpq->lock); fuse_request_end(fc, req); + spin_lock(&fsvq->lock); + fsvq->in_flight--; + spin_unlock(&fsvq->lock); } } @@ -769,6 +772,7 @@ static int virtio_fs_enqueue_req(struct virtio_fs_vq *fsvq, goto out; } + fsvq->in_flight++; notify = virtqueue_kick_prepare(vq); spin_unlock(&fsvq->lock); -- 2.20.1