linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Maxim V. Patlasov" <MPatlasov@parallels.com>
To: miklos@szeredi.hu
Cc: fuse-devel@lists.sourceforge.net, xemul@parallels.com,
	linux-kernel@vger.kernel.org, devel@openvz.org,
	dev@parallels.com
Subject: [PATCH 3/4] fuse: skip blocking on allocations of synchronous requests
Date: Thu, 21 Mar 2013 18:02:28 +0400	[thread overview]
Message-ID: <20130321140220.4051.16728.stgit@maximpc.sw.ru> (raw)
In-Reply-To: <20130321140047.4051.6701.stgit@maximpc.sw.ru>

Miklos wrote:

> A task may have at most one synchronous request allocated. So these
> requests need not be otherwise limited.

The patch re-works fuse_get_req() to follow this idea.

Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
---
 fs/fuse/dev.c |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 6137650..1f7ce89 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -137,17 +137,27 @@ struct fuse_req *fuse_get_req_internal(struct fuse_conn *fc, unsigned npages,
 				       bool for_background)
 {
 	struct fuse_req *req;
-	sigset_t oldset;
-	int intr;
 	int err;
+	int *flag_p = NULL;
 
 	atomic_inc(&fc->num_waiting);
-	block_sigs(&oldset);
-	intr = wait_event_interruptible(fc->blocked_waitq, !fc->blocked);
-	restore_sigs(&oldset);
-	err = -EINTR;
-	if (intr)
-		goto out;
+
+	if (for_background)
+		flag_p = &fc->blocked;
+	else if (fc->uninitialized)
+		flag_p = &fc->uninitialized;
+
+	if (flag_p) {
+		sigset_t oldset;
+		int intr;
+
+		block_sigs(&oldset);
+		intr = wait_event_interruptible(fc->blocked_waitq, !*flag_p);
+		restore_sigs(&oldset);
+		err = -EINTR;
+		if (intr)
+			goto out;
+	}
 
 	err = -ENOTCONN;
 	if (!fc->connected)


  parent reply	other threads:[~2013-03-21 14:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 14:01 [PATCH 0/4] fuse: fix accounting background requests (v2) Maxim V. Patlasov
2013-03-21 14:02 ` [PATCH 1/4] fuse: make request allocations for background processing explicit Maxim V. Patlasov
2013-03-21 14:02 ` [PATCH 2/4] fuse: add flag fc->uninitialized Maxim V. Patlasov
2013-03-21 14:02 ` Maxim V. Patlasov [this message]
2013-03-21 14:02 ` [PATCH 4/4] fuse: implement exclusive wakeup for blocked_waitq Maxim V. Patlasov
2013-04-11 11:19 ` [fuse-devel] [PATCH 0/4] fuse: fix accounting background requests (v2) Maxim V. Patlasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130321140220.4051.16728.stgit@maximpc.sw.ru \
    --to=mpatlasov@parallels.com \
    --cc=dev@parallels.com \
    --cc=devel@openvz.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).