diff options
author | Brian Behlendorf <[email protected]> | 2011-08-01 18:24:40 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-08-04 13:37:38 -0700 |
commit | 76659dc110ef2ada13bcb8e4e2ec60d8216c6836 (patch) | |
tree | 19de8ecbb20ae764ae16b0f05399fff16424c440 /lib | |
parent | 3c0e5c0f455576d045fa443cbab74834d70ded55 (diff) |
Add backing_device_info per-filesystem
For a long time now the kernel has been moving away from using the
pdflush daemon to write 'old' dirty pages to disk. The primary reason
for this is because the pdflush daemon is single threaded and can be
a limiting factor for performance. Since pdflush sequentially walks
the dirty inode list for each super block any delay in processing can
slow down dirty page writeback for all filesystems.
The replacement for pdflush is called bdi (backing device info). The
bdi system involves creating a per-filesystem control structure each
with its own private sets of queues to manage writeback. The advantage
is greater parallelism which improves performance and prevents a single
filesystem from slowing writeback to the others.
For a long time both systems co-existed in the kernel so it wasn't
strictly required to implement the bdi scheme. However, as of
Linux 2.6.36 kernels the pdflush functionality has been retired.
Since ZFS already bypasses the page cache for most I/O this is only
an issue for mmap(2) writes which must go through the page cache.
Even then adding this missing support for newer kernels was overlooked
because there are other mechanisms which can trigger writeback.
However, there is one critical case where not implementing the bdi
functionality can cause problems. If an application handles a page
fault it can enter the balance_dirty_pages() callpath. This will
result in the application hanging until the number of dirty pages in
the system drops below the dirty ratio.
Without a registered backing_device_info for the filesystem the
dirty pages will not get written out. Thus the application will hang.
As mentioned above this was less of an issue with older kernels because
pdflush would eventually write out the dirty pages.
This change adds a backing_device_info structure to the zfs_sb_t
which is already allocated per-super block. It is then registered
when the filesystem mounted and unregistered on unmount. It will
not be registered for mounted snapshots which are read-only. This
change will result in flush-<pool> thread being dynamically created
and destroyed per-mounted filesystem for writeback.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #174
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libavl/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libefi/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libnvpair/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libshare/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/asm-generic/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/asm-i386/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/asm-x86_64/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/ia32/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/ia32/sys/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/rpc/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/sys/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/sys/dktp/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/sys/sysevent/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/util/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libunicode/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libuutil/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libzfs/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libzpool/Makefile.in | 1 |
21 files changed, 21 insertions, 0 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in index 001235471..2f8d492cd 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -41,6 +41,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in index 05a76d471..33484b3ab 100644 --- a/lib/libavl/Makefile.in +++ b/lib/libavl/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in index 17cf68457..ec4e14aa1 100644 --- a/lib/libefi/Makefile.in +++ b/lib/libefi/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in index 02c351198..7d3eaa433 100644 --- a/lib/libnvpair/Makefile.in +++ b/lib/libnvpair/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libshare/Makefile.in b/lib/libshare/Makefile.in index b2af5fdc3..6254a97b7 100644 --- a/lib/libshare/Makefile.in +++ b/lib/libshare/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in index 11b517ae5..238ab009a 100644 --- a/lib/libspl/Makefile.in +++ b/lib/libspl/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in index 4356f51f6..6fe820cd7 100644 --- a/lib/libspl/asm-generic/Makefile.in +++ b/lib/libspl/asm-generic/Makefile.in @@ -42,6 +42,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in index 4346d0d21..1f951adfe 100644 --- a/lib/libspl/asm-i386/Makefile.in +++ b/lib/libspl/asm-i386/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in index e9bab0719..10226a96e 100644 --- a/lib/libspl/asm-x86_64/Makefile.in +++ b/lib/libspl/asm-x86_64/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in index 4990f24b9..88b840495 100644 --- a/lib/libspl/include/Makefile.in +++ b/lib/libspl/include/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in index e54dd3be5..36af1a80b 100644 --- a/lib/libspl/include/ia32/Makefile.in +++ b/lib/libspl/include/ia32/Makefile.in @@ -41,6 +41,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in index cbcc2e4c3..ff11b1de4 100644 --- a/lib/libspl/include/ia32/sys/Makefile.in +++ b/lib/libspl/include/ia32/sys/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in index 133664598..e2ae91cf9 100644 --- a/lib/libspl/include/rpc/Makefile.in +++ b/lib/libspl/include/rpc/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in index ae28b4245..eeaca9be1 100644 --- a/lib/libspl/include/sys/Makefile.in +++ b/lib/libspl/include/sys/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in index 0d33f468c..c9b011530 100644 --- a/lib/libspl/include/sys/dktp/Makefile.in +++ b/lib/libspl/include/sys/dktp/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in index 99d2433e6..c37669fc4 100644 --- a/lib/libspl/include/sys/sysevent/Makefile.in +++ b/lib/libspl/include/sys/sysevent/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in index 553937802..70ce9733b 100644 --- a/lib/libspl/include/util/Makefile.in +++ b/lib/libspl/include/util/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in index faa940e3d..6b5d57590 100644 --- a/lib/libunicode/Makefile.in +++ b/lib/libunicode/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in index 45c4e84f5..2c2c8e5a3 100644 --- a/lib/libuutil/Makefile.in +++ b/lib/libuutil/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in index 5dc7d3570..ad31c720a 100644 --- a/lib/libzfs/Makefile.in +++ b/lib/libzfs/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in index 212c964d0..1b60fe324 100644 --- a/lib/libzpool/Makefile.in +++ b/lib/libzpool/Makefile.in @@ -43,6 +43,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \ $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \ $(top_srcdir)/config/kernel-bdev-logical-size.m4 \ + $(top_srcdir)/config/kernel-bdi.m4 \ $(top_srcdir)/config/kernel-bio-empty-barrier.m4 \ $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \ $(top_srcdir)/config/kernel-bio-failfast.m4 \ |