Commit Graph

52 Commits

Author SHA1 Message Date
phk
7a5cb964c5 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.
2004-03-10 20:41:09 +00:00
phk
3eb009d511 s/bytes/byte/ 2004-02-19 19:53:07 +00:00
phk
176e74437b Note that geometry can also be specified on vnode backed deviecs. 2004-01-12 10:54:09 +00:00
phk
9155a1ca57 Warn that big malloc disks are a panic(8) implementation.
Submitted by:	Colin Percival <cperciva@builder.daemonology.net>
(Who should really get his own bit one of these days!)

PR:	59988
2004-01-02 14:28:06 +00:00
blackend
76f0fef3ee Add a full example of a file-backed disk creation, I used the Handbook's
example.

PR:		docs/51897
Submitted by:	Kevin Oberman <oberman@es.net>
2003-10-11 09:59:25 +00:00
blackend
4377ede447 s/disklabel/bsdlabel where needed. 2003-10-11 08:24:07 +00:00
phk
d6731e1a0d Document the -x and -y options. 2003-09-21 19:05:35 +00:00
kan
9e7af78d2e Do not compare unsigned int values with ULONG_MAX. The comparison is
always false on 64bit platforms and GCC 3.3.1 issues warning there.
2003-07-11 05:47:05 +00:00
rwatson
2299752110 Add "-n" argument, which causes mdconfig to simply print the unit
number X, rather than mdX, making it easier to script tests that
use md devices but don't want to make assumptions about any existing
md use (such as in diskless environments).
2003-06-11 06:38:24 +00:00
dougb
54acfe8b8b Add .Xr's to mdmfs(8).
Submitted by:	Scot W. Hetzel <hetzels@westbend.net>
2003-04-27 01:46:56 +00:00
phk
3bd8a2129b Add a couple of undocumented test options to MD(4) to aid in regression
testting of GEOM.
2003-04-09 11:59:29 +00:00
yar
f3adc42c76 Give clearer diagnostics on some cases of invalid
combinations of mdconfig(8) command-line arguments.

Make mdconfig(8) accept "-a -f file -o options"
equally with "-a -f file" (assuming "-t vnode".)
2003-04-01 15:23:55 +00:00
phk
649519b8f6 Add a "-S sectorsize" option to enable Kirk to find a bug :-) 2003-03-03 13:05:00 +00:00
phk
0b1f6e1c57 Don't use the kern.disks sysctl to find a list of md devices, use the
MDIOCLIST ioctl instead.

Spotted by:	keramida
2003-01-27 08:01:08 +00:00
keramida
a56381b175 Make sure strsep() gets a nul-terminated string.
Reviewed by:	phk
2002-10-10 10:07:19 +00:00
phk
34e71fb635 Don't show disklabel in the examples, it is not necessary. 2002-09-26 21:29:10 +00:00
trhodes
8dde7c54b8 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
imp
cf37df614d Don't use NULL where you really mean 0 to sysctlbyname. 2002-08-21 15:15:15 +00:00
rse
089c69d76e Replace extra call to "tunefs" with the equivalent of "newfs -U".
Reviewed by:	phk
2002-07-15 11:30:21 +00:00
charnier
548d38d27c The .Nm utility 2002-07-06 19:34:18 +00:00
des
c91c856b3e Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
mike
e3adb62dc6 Revert 1.20:
Memory disks may be used for other purposes besides newfs(8), so it
isn't helpful to require the minimum size meet newfs(8)'s criteria.
2002-03-21 12:03:09 +00:00
mike
88244def1c Provide a proper error message in mdconfig(8) when a filesystem is too
small, instead of a less meaningful error in newfs(8).
2002-03-21 07:46:09 +00:00
dd
2af26e9320 Actually make use of the md_version field of 'struct mdio'. In order
not to needlessly break compatibility, decrement MDIOVERSION to 0.

Approved by:	phk
2001-12-20 06:38:21 +00:00
obrien
a537f22ad4 Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by:	mike
2001-12-04 02:19:58 +00:00
ru
d88513dbae mdoc(7) police: removed (now gratuitous) .Xo/.Xc brackets. 2001-08-10 10:41:30 +00:00
dd
474a84333b Move all the prototypes to one place. 2001-08-07 19:27:46 +00:00
dd
f174811aa2 Introduce a force option, MD_FORCE, that instructs the driver to
bypass some extra anti-foot-shooting measures.  Currently, its only
effect is to allow detaching a device while it's still open (e.g.,
mounted).  This is useful for testing how the system reacts to a disk
suddenly going away, which can happen with some removeable media.

At this point, the force option is only checked on detach, so it
would've been possible to allow the option to be passed with the
MDIOCDETACH operation.  This was not done to allow the possibility of
having the force flag influence other tests in the future, which may
not necessarily deal with detaching the device.

Reviewed by:	sobomax
Approved by:	phk
2001-08-07 19:23:16 +00:00
dd
46af69d151 Use MD_NAME and MDCTL_NAME constants where appropriate. 2001-07-18 13:32:38 +00:00
dd
c49a4e6620 Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
ru
cb3283b5da mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 11:04:34 +00:00
dd
bbaeff8b29 Constify mdmaybeload(), add a prototype for usage(), and get rid of a
sizeof(int) == sizeof(long) assumption; clamp down with WARNS=2.
2001-06-21 02:10:26 +00:00
dd
e0b1675e89 Don't assume the length of MD_NAME is 2. 2001-06-21 01:39:01 +00:00
dd
1d63e53afe Fail if -s isn't specified for an MD_MALLOC or MD_SWAP disk; the
driver itself obviously won't configure such a disk, but the error
returned (EDOM) is more cryptic to the average user than it should be.

Also assert that the argument to -u is in fact a valid unit; don't
just accept any string to mean 0.

Approved by:	phk
2001-06-21 01:36:09 +00:00
ru
e7c03cd6b0 - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:33:27 +00:00
ru
e2a472a47a Set the default manual section for sbin/ to 8. 2001-03-20 18:13:31 +00:00
ru
e31294bd61 mdoc(7) police: add a missing An call. 2001-03-12 09:18:12 +00:00
sobomax
a217ffd7d5 In the absence of explicit `-t type'' option assume that `-f file''
implies ``-t vnode''.

Approved by:	phk
2001-03-09 21:15:08 +00:00
phk
75afbf0041 Make md(4) and mdconfig(8) take over the role of vn(4) and vnconfig(8)
entirely as previously advertised.

md(4) adopted all assets of vn(4) some time back and has proper devfs
support and cloning abilities to boot.
2001-03-09 20:09:28 +00:00
phk
4ea37f2fcc 1) If mdconfig isn't given an action argument, it assumes detach.
2) Running `mdconfig -l` without any attached devices results in
mdconfig printing "md0" to standard output.

Submitted by:	dd [1]

[1] no, not "dd(1)" but "Dima Dorfman"
2001-03-09 20:05:06 +00:00
phk
ddcf00ec76 Remove "autounit" from settable options, it's the default unless you
specify -u.

Spotted by:	dcs
2001-02-26 15:31:47 +00:00
phk
cb4dc88c1d Forgot to remove unneeded "intcmp" function. 2001-02-25 13:14:41 +00:00
phk
dc1a4fe257 Make "md" and "mdctl" macroized parameters.
Implement "-l" option to mdconfig which can list one or all md devices.

Submitted by:   Dima Dorfman <dima@unixfreak.org>
2001-02-25 13:12:57 +00:00
phk
4cc2d77d23 Make md/mdconfig do kld.
Submitted by:	dcs
2001-02-24 16:26:41 +00:00
phk
52eef69973 Strip optional prefixes "/dev/" and "md" from the -u argument. 2001-01-31 08:41:18 +00:00
phk
3fc2302319 Duh, the version of mdconfig.c I committed came from the wrong machine.
Commit the right version, but without the -b option which is too evil
for the present.

Remove -b and preload from the manpage as well.
2001-01-28 20:17:46 +00:00
phk
c2a54fd98c Don't specify fragment size, it autosizes from the sectorsize.
Remember to set mode 1777 on /tmp

Submitted by:	mjacob
2001-01-28 20:03:02 +00:00
ru
b8c8d16c77 Mdoc(7)ify. 2001-01-10 14:53:46 +00:00
phk
b7ed866b94 Add padding space and a version number to the md_ioctl structre for future
extension.

Add ability to create a preload disk giving an address and a length
(suggested by imp)

Fix bug relating to very small md(4) devices.

Update md.c copyright to reflect the status of code copied from vn.c.
(noticed by dillon)
2001-01-01 23:08:26 +00:00
phk
f5d33e675c This is the first snapshot of the new all-singing-and-dancing md(4).
Using the mdconfig(8) program you can now configure memory disks
on malloc(9), swap or a file/vnode.  preloaded md disks also work
as usual.
2000-12-31 13:03:42 +00:00