From 17a74e8800eb0f00a74b9c1d269483e4f9f22bc8 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 19 May 2002 02:22:12 -0700 Subject: [PATCH] pdflush exclusion Use the pdflush exclusion infrastructure to ensure that only one pdlfush thread is ever performing writeback against a particular request_queue. This works rather well. It requires a lot of activity against a lot of disks to cause more pdflush threads to start up. Possibly the thread-creation logic is a little weak: it starts more threads when a pdflush thread goes back to sleep. It may be better to start new threads within pdlfush_operation(). All non-request_queue-backed address_spaces share the global default_backing_dev_info structure. So at present only a single pdflush instance will be available for background writeback of *all* NFS filesystems (for example). If there is benefit in concurrent background writeback for multiple NFS mounts then NFS would need to create per-mount backing_dev_info structures and install those into new inode's address_spaces in some manner. --- include/linux/fs.h | 2 -- include/linux/writeback.h | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/fs.h b/include/linux/fs.h index 374045884cb8..b936413f96f2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -112,7 +112,6 @@ extern int leases_enable, dir_notify_enable, lease_break_time; #define MS_MOVE 8192 #define MS_REC 16384 #define MS_VERBOSE 32768 -#define MS_FLUSHING (1<<16) /* inodes are currently under writeout */ #define MS_ACTIVE (1<<30) #define MS_NOUSER (1<<31) @@ -156,7 +155,6 @@ extern int leases_enable, dir_notify_enable, lease_break_time; #define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY) #define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || ((inode)->i_flags & S_SYNC)) #define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) -#define IS_FLUSHING(inode) __IS_FLG(inode, MS_FLUSHING) #define IS_QUOTAINIT(inode) ((inode)->i_flags & S_QUOTA) #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 1978e06d1131..a089dd009fc1 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -12,6 +12,15 @@ extern spinlock_t inode_lock; extern struct list_head inode_in_use; extern struct list_head inode_unused; +/* + * Yes, writeback.h requires sched.h + * No, sched.h is not included from here. + */ +static inline int current_is_pdflush(void) +{ + return current->flags & PF_FLUSHER; +} + /* * fs/fs-writeback.c */ -- cgit v1.2.3