summaryrefslogtreecommitdiffstats
path: root/fs/fuse/fuse_i.h
diff options
context:
space:
mode:
authorKirill Tkhai2018-08-27 17:29:46 +0200
committerMiklos Szeredi2018-09-28 16:43:22 +0200
commitae2dffa39485c6fd4f22321814c7287c274b473a (patch)
treeae65ad5f3ac4f02fb9f7ba8b7fce89cac5d565bf /fs/fuse/fuse_i.h
parentfuse: add locking to max_background and congestion_threshold changes (diff)
downloadkernel-qcow2-linux-ae2dffa39485c6fd4f22321814c7287c274b473a.tar.gz
kernel-qcow2-linux-ae2dffa39485c6fd4f22321814c7287c274b473a.tar.xz
kernel-qcow2-linux-ae2dffa39485c6fd4f22321814c7287c274b473a.zip
fuse: introduce fc->bg_lock
To reduce contention of fc->lock, this patch introduces bg_lock for protection of fields related to background queue. These are: max_background, congestion_threshold, num_background, active_background, bg_queue and blocked. This allows next patch to make async reads not requiring fc->lock, so async reads and writes will have better performance executed in parallel. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r--fs/fuse/fuse_i.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 3e45d408a644..d6d55641a5a6 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -500,6 +500,10 @@ struct fuse_conn {
/** The list of background requests set aside for later queuing */
struct list_head bg_queue;
+ /** Protects: max_background, congestion_threshold, num_background,
+ * active_background, bg_queue, blocked */
+ spinlock_t bg_lock;
+
/** Flag indicating that INIT reply has been received. Allocating
* any fuse request will be suspended until the flag is set */
int initialized;
@@ -860,8 +864,8 @@ ssize_t fuse_simple_request(struct fuse_conn *fc, struct fuse_args *args);
*/
void fuse_request_send_background(struct fuse_conn *fc, struct fuse_req *req);
-void fuse_request_send_background_locked(struct fuse_conn *fc,
- struct fuse_req *req);
+void fuse_request_send_background_nocheck(struct fuse_conn *fc,
+ struct fuse_req *req);
/* Abort all requests */
void fuse_abort_conn(struct fuse_conn *fc, bool is_abort);