diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-17 11:59:30 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-20 13:08:26 -0400 |
commit | 3b3be88d67cc17d0f0ab6edaf131516793fc947e (patch) | |
tree | 293bc2bcc7cf7a175786ec33a4e2aff8c5c7ebca /fs/nfs/pnfs.h | |
parent | 5ae67c4fee869c9b3c87b727a9ea511b6326b834 (diff) |
NFS: Use cond_resched_lock() to reduce latencies in the commit scans
Ensure that we conditionally drop the inode->i_lock when it is safe
to do so in the commit loops.
We do so after locking the nfs_page, but before removing it from the
commit list. We can then use list_safe_reset_next to recover the loop
after the lock is retaken.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r-- | fs/nfs/pnfs.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index e98ff3027d3a..07802652f5a3 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h @@ -97,7 +97,7 @@ struct pnfs_layoutdriver_type { void (*mark_request_commit) (struct nfs_page *req, struct pnfs_layout_segment *lseg); void (*clear_request_commit) (struct nfs_page *req); - int (*scan_commit_lists) (struct inode *inode, int max); + int (*scan_commit_lists) (struct inode *inode, int max, spinlock_t *lock); int (*commit_pagelist)(struct inode *inode, struct list_head *mds_pages, int how); /* @@ -294,14 +294,14 @@ pnfs_clear_request_commit(struct nfs_page *req) } static inline int -pnfs_scan_commit_lists(struct inode *inode, int max) +pnfs_scan_commit_lists(struct inode *inode, int max, spinlock_t *lock) { struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; int ret; if (ld == NULL || ld->scan_commit_lists == NULL) return 0; - ret = ld->scan_commit_lists(inode, max); + ret = ld->scan_commit_lists(inode, max, lock); if (ret != 0) set_bit(NFS_INO_PNFS_COMMIT, &NFS_I(inode)->flags); return ret; @@ -419,7 +419,7 @@ pnfs_clear_request_commit(struct nfs_page *req) } static inline int -pnfs_scan_commit_lists(struct inode *inode, int max) +pnfs_scan_commit_lists(struct inode *inode, int max, spinlock_t *lock) { return 0; } |