Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8694227d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "fuse: give wakeup hints to the scheduler"

parents 00e60067 ac247e74
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -204,9 +204,12 @@ static unsigned int fuse_req_hash(u64 unique)
/**
 * A new request is available, wake fiq->waitq
 */
static void fuse_dev_wake_and_unlock(struct fuse_iqueue *fiq)
static void fuse_dev_wake_and_unlock(struct fuse_iqueue *fiq, bool sync)
__releases(fiq->lock)
{
	if (sync)
		wake_up_sync(&fiq->waitq);
	else
		wake_up(&fiq->waitq);
	kill_fasync(&fiq->fasync, SIGIO, POLL_IN);
	spin_unlock(&fiq->lock);
@@ -220,14 +223,14 @@ const struct fuse_iqueue_ops fuse_dev_fiq_ops = {
EXPORT_SYMBOL_GPL(fuse_dev_fiq_ops);

static void queue_request_and_unlock(struct fuse_iqueue *fiq,
				     struct fuse_req *req)
				     struct fuse_req *req, bool sync)
__releases(fiq->lock)
{
	req->in.h.len = sizeof(struct fuse_in_header) +
		fuse_len_args(req->args->in_numargs,
			      (struct fuse_arg *) req->args->in_args);
	list_add_tail(&req->list, &fiq->pending);
	fiq->ops->wake_pending_and_unlock(fiq);
	fiq->ops->wake_pending_and_unlock(fiq, sync);
}

void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget,
@@ -242,7 +245,7 @@ void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget,
	if (fiq->connected) {
		fiq->forget_list_tail->next = forget;
		fiq->forget_list_tail = forget;
		fiq->ops->wake_forget_and_unlock(fiq);
		fiq->ops->wake_forget_and_unlock(fiq, 0);
	} else {
		kfree(forget);
		spin_unlock(&fiq->lock);
@@ -262,7 +265,7 @@ static void flush_bg_queue(struct fuse_conn *fc)
		fc->active_background++;
		spin_lock(&fiq->lock);
		req->in.h.unique = fuse_get_unique(fiq);
		queue_request_and_unlock(fiq, req);
		queue_request_and_unlock(fiq, req, 0);
	}
}

@@ -351,7 +354,7 @@ static int queue_interrupt(struct fuse_iqueue *fiq, struct fuse_req *req)
			spin_unlock(&fiq->lock);
			return 0;
		}
		fiq->ops->wake_interrupt_and_unlock(fiq);
		fiq->ops->wake_interrupt_and_unlock(fiq, 0);
	} else {
		spin_unlock(&fiq->lock);
	}
@@ -417,7 +420,7 @@ static void __fuse_request_send(struct fuse_conn *fc, struct fuse_req *req)
		/* acquire extra reference, since request is still needed
		   after fuse_request_end() */
		__fuse_get_request(req);
		queue_request_and_unlock(fiq, req);
		queue_request_and_unlock(fiq, req, 1);

		request_wait_answer(fc, req);
		/* Pairs with smp_wmb() in fuse_request_end() */
@@ -588,7 +591,7 @@ static int fuse_simple_notify_reply(struct fuse_conn *fc,

	spin_lock(&fiq->lock);
	if (fiq->connected) {
		queue_request_and_unlock(fiq, req);
		queue_request_and_unlock(fiq, req, 0);
	} else {
		err = -ENODEV;
		spin_unlock(&fiq->lock);
+3 −3
Original line number Diff line number Diff line
@@ -379,19 +379,19 @@ struct fuse_iqueue_ops {
	/**
	 * Signal that a forget has been queued
	 */
	void (*wake_forget_and_unlock)(struct fuse_iqueue *fiq)
	void (*wake_forget_and_unlock)(struct fuse_iqueue *fiq, bool sync)
		__releases(fiq->lock);

	/**
	 * Signal that an INTERRUPT request has been queued
	 */
	void (*wake_interrupt_and_unlock)(struct fuse_iqueue *fiq)
	void (*wake_interrupt_and_unlock)(struct fuse_iqueue *fiq, bool sync)
		__releases(fiq->lock);

	/**
	 * Signal that a request has been queued
	 */
	void (*wake_pending_and_unlock)(struct fuse_iqueue *fiq)
	void (*wake_pending_and_unlock)(struct fuse_iqueue *fiq, bool sync)
		__releases(fiq->lock);

	/**
+1 −0
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@ void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode, int nr);
#define wake_up_interruptible_nr(x, nr)	__wake_up(x, TASK_INTERRUPTIBLE, nr, NULL)
#define wake_up_interruptible_all(x)	__wake_up(x, TASK_INTERRUPTIBLE, 0, NULL)
#define wake_up_interruptible_sync(x)	__wake_up_sync((x), TASK_INTERRUPTIBLE, 1)
#define wake_up_sync(x)			__wake_up_sync(x, TASK_NORMAL, 1)

/*
 * Wakeup macros to be used to report events to the targets.