path: root/sys/sys/mdioctl.h
diff options
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-03-10 20:41:09 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-03-10 20:41:09 +0000
commit7a6b2b64294749875e4dc9ae49feac24c1d862e5 (patch)
tree59ebe2a7ed44e7865042f27309af6372e0e6c948 /sys/sys/mdioctl.h
parent724e52cd0dd6494889b65466e9350632f4d6eaa8 (diff)
Fix a long-standing deadlock issue with vnode backed md(4) devices:
On vnode backed md(4) devices over a certain, currently undetermined size relative to the buffer cache our "lemming-syncer" can provoke a buffer starvation which puts the md thread to sleep on wdrain. This generally tends to grind the entire system to a stop because the event that is supposed to wake up the thread will not happen until a fair bit of the piled up I/O requests in the system finish, and since a lot of those are on a md(4) vnode backed device which is currently waiting on wdrain until a fair amount of the piled up ... you get the picture. The cure is to issue all VOP_WRITES on the vnode backing the device with IO_SYNC. In addition to more closely emulating a real disk device with a non-lying write-cache, this makes the writes exempt from rate-limited (there to avoid starving the buffer cache) and consequently prevents the deadlock. Unfortunately performance takes a hit. Add "async" option to give people who know what they are doing the old behaviour.
Notes: svn path=/head/; revision=126821
Diffstat (limited to 'sys/sys/mdioctl.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/mdioctl.h b/sys/sys/mdioctl.h
index 3ba206b6aa9a..861619b3b8cb 100644
--- a/sys/sys/mdioctl.h
+++ b/sys/sys/mdioctl.h
@@ -90,5 +90,6 @@ struct md_ioctl {
#define MD_READONLY 0x08 /* Readonly mode */
#define MD_COMPRESS 0x10 /* Compression mode */
#define MD_FORCE 0x20 /* Don't try to prevent foot-shooting */
+#define MD_ASYNC 0x40 /* Don't try to prevent foot-shooting */
#endif /* _SYS_MDIOCTL_H_*/