You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
FROMLIST: fuse: give wakeup hints to the scheduler
The synchronous wakeup interface is available only for the interruptible wakeup. Add it for normal wakeup and use this synchronous wakeup interface to wakeup the userspace daemon. Scheduler can make use of this hint to find a better CPU for the waker task. With this change the performance numbers for compress, decompress and copy use-cases on /sdcard path has improved by ~30%. Use-case details: 1. copy 10000 files of each 4k size into /sdcard path 2. use any File explorer application that has compress/decompress support 3. start compress/decompress and capture the time. ------------------------------------------------- | Default | wakeup support | Improvement/Diff | ------------------------------------------------- | 13.8 sec | 9.9 sec | 3.9 sec (28.26%) | ------------------------------------------------- Co-developed-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com> Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com> Bug: 216261533 Link: https://lore.kernel.org/lkml/1638780405-38026-1-git-send-email-quic_pragalla@quicinc.com/ Change-Id: I9ac89064e34b1e0605064bf4d2d3a310679cb605 Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com> Signed-off-by: Alessio Balsini <balsini@google.com> (cherry picked from commit 30d72758dbe0e7fa9992f5d21ee8d23eec27934a)
This commit is contained in:
committed by
Treehugger Robot
parent
134c1aae43
commit
05a8f2c4d2
@@ -208,10 +208,13 @@ 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)
|
||||
{
|
||||
wake_up(&fiq->waitq);
|
||||
if (sync)
|
||||
wake_up_sync(&fiq->waitq);
|
||||
else
|
||||
wake_up(&fiq->waitq);
|
||||
kill_fasync(&fiq->fasync, SIGIO, POLL_IN);
|
||||
spin_unlock(&fiq->lock);
|
||||
}
|
||||
@@ -224,14 +227,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,
|
||||
@@ -246,7 +249,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, false);
|
||||
} else {
|
||||
kfree(forget);
|
||||
spin_unlock(&fiq->lock);
|
||||
@@ -266,7 +269,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, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +362,7 @@ static int queue_interrupt(struct fuse_req *req)
|
||||
spin_unlock(&fiq->lock);
|
||||
return 0;
|
||||
}
|
||||
fiq->ops->wake_interrupt_and_unlock(fiq);
|
||||
fiq->ops->wake_interrupt_and_unlock(fiq, false);
|
||||
} else {
|
||||
spin_unlock(&fiq->lock);
|
||||
}
|
||||
@@ -426,7 +429,7 @@ static void __fuse_request_send(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, true);
|
||||
|
||||
request_wait_answer(req);
|
||||
/* Pairs with smp_wmb() in fuse_request_end() */
|
||||
@@ -601,7 +604,7 @@ static int fuse_simple_notify_reply(struct fuse_mount *fm,
|
||||
|
||||
spin_lock(&fiq->lock);
|
||||
if (fiq->connected) {
|
||||
queue_request_and_unlock(fiq, req);
|
||||
queue_request_and_unlock(fiq, req, false);
|
||||
} else {
|
||||
err = -ENODEV;
|
||||
spin_unlock(&fiq->lock);
|
||||
|
||||
@@ -412,19 +412,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);
|
||||
|
||||
/**
|
||||
|
||||
@@ -971,7 +971,7 @@ static struct virtio_driver virtio_fs_driver = {
|
||||
#endif
|
||||
};
|
||||
|
||||
static void virtio_fs_wake_forget_and_unlock(struct fuse_iqueue *fiq)
|
||||
static void virtio_fs_wake_forget_and_unlock(struct fuse_iqueue *fiq, bool sync)
|
||||
__releases(fiq->lock)
|
||||
{
|
||||
struct fuse_forget_link *link;
|
||||
@@ -1006,7 +1006,8 @@ __releases(fiq->lock)
|
||||
kfree(link);
|
||||
}
|
||||
|
||||
static void virtio_fs_wake_interrupt_and_unlock(struct fuse_iqueue *fiq)
|
||||
static void virtio_fs_wake_interrupt_and_unlock(struct fuse_iqueue *fiq,
|
||||
bool sync)
|
||||
__releases(fiq->lock)
|
||||
{
|
||||
/*
|
||||
@@ -1221,7 +1222,8 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void virtio_fs_wake_pending_and_unlock(struct fuse_iqueue *fiq)
|
||||
static void virtio_fs_wake_pending_and_unlock(struct fuse_iqueue *fiq,
|
||||
bool sync)
|
||||
__releases(fiq->lock)
|
||||
{
|
||||
unsigned int queue_id = VQ_REQUEST; /* TODO multiqueue */
|
||||
|
||||
@@ -219,6 +219,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head);
|
||||
#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)
|
||||
#define wake_up_sync(x) __wake_up_sync((x), TASK_NORMAL)
|
||||
|
||||
/*
|
||||
* Wakeup macros to be used to report events to the targets.
|
||||
|
||||
Reference in New Issue
Block a user