summaryrefslogtreecommitdiffstats
path: root/sys/dev/md
Commit message (Collapse)AuthorAgeFilesLines
* Request a CPU private mapping from sf_buf_alloc(). If the swap-backedalc2005-02-131-1/+6
| | | | | | | | | memory disk is larger than the number of available sf_bufs, this improves performance on SMPs by eliminating interprocessor TLB shootdowns. For example, with 6656 sf_bufs, the default on my test machine, and a 256MB swap-backed memory disk, I see the command "dd if=/dev/md0 of=/dev/null bs=64k" achieve ~489MB/sec with the default, shared mappings, and ~587MB/sec with CPU private mappings.
* Use MAXMINORphk2005-01-291-1/+1
|
* - Don't destroy UMA zone on error in mdcreate_malloc(), because we need itpjd2005-01-221-4/+1
| | | | | | | | | in mddestroy() to properly free already allocated memory. This fixes a panic when we want to create too big memory backed device with preallocate memory (-o reserve). - Remove redundant { }. MFC after: 1 week
* Add a couple of mtx_asserts() to try to narrow down the window onphk2005-01-221-0/+2
| | | | a bug repeatedly reported.
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-2/+2
|
* Add needed synchronization to the error handling code that was introducedalc2005-01-051-0/+6
| | | | | | in revision 1.141. Lock assertion failures reported by: Kris Kennaway
* Stop explicitly touching td_base_pri outside of the scheduler and simplyjhb2004-12-301-1/+4
| | | | | set a thread's priority via sched_prio() when that is the desired action. The schedulers will start managing td_base_pri internally shortly.
* Rewrite piece of code which I committed some time ago that allows topjd2004-12-271-10/+8
| | | | | | | | | show file name for 'mdconfig -l -u <x>' command. This allows to preserve API/ABI compatibility with version 0 (that's why I changed version number back to 0) and will allow to merge this change to RELENG_5. MFC after: 5 days
* Fix the MDIOCDETACH ioctl() for md(4). Now that the md_file field inmarcel2004-11-131-1/+1
| | | | | the mdio structure is an array and not a pointer, we cannot test for it to be NULL. It never is. Instead, test for md_file[0] to be '\0'.
* Be consistent and use 'if (error != 0)' instead of 'if (error)' everywhere.pjd2004-11-061-5/+5
|
* For file backed md(4) devices output their source file viapjd2004-11-061-4/+13
| | | | | 'mdconfig -l -u <unit>'. Bump version number, as this change breaks ABI/API.
* Don't explicitly call g_waitidle(), it happens automagically now.phk2004-10-231-2/+0
|
* Account for failure in vm_pager_allocate() or vm_pager_get_pages() ingreen2004-10-121-1/+19
| | | | | | | | | md(8). The former is generally not going to fail, but the latter can fail when the underlying swap device returns an error. There are still plenty of other places where vm_pager_get_pages() failing will lead directly to crashes, so it's a good idea to put your swap on RAID if you care enough to put any of your disks on RAID....
* Actually this order (unlock, wakeup) in this case is race-safe and canpjd2004-09-181-1/+1
| | | | | | save us 2 context switches. Explained by: njl
* - Make md(4) 64-bit clean.pjd2004-09-161-161/+89
| | | | | | | | | After this change it should be possible to use very big md(4) devices. - Clean up and simplify the code a bit. - Use humanize_number(3) to print size of md(4) devices. - Add 't' suffix which stands for terabyte. - Make '-S' to really work with all types of devices. - Other minor changes.
* There is no need to keep 'npage' value inside our softc structure,pjd2004-09-161-8/+8
| | | | | | | it is only used in one function. While doing so, change its type to vm_ooffset_t. We are still limited for swap-backed devices to 16TB on 32-bit architectures where PAGE_SIZE is 4096 bytes.
* - Do not use bio_pblkno as it is going away anyway.pjd2004-09-161-13/+14
| | | | - Prefer bio_length than bio_bcount.
* First wakeup, then unlock.pjd2004-09-161-2/+1
|
* Type 'int' is too small for 'i' and 'lastp' variables. Use proper type,pjd2004-09-161-2/+2
| | | | which is vm_pindex_t (unsigned 64bit on i386).
* Deallocate VM object on failure.pjd2004-09-141-0/+2
|
* One more missing NDFREE(9).pjd2004-09-141-0/+1
|
* - Don't forget about NDFREE() in case of vn_open() failure.pjd2004-09-141-2/+4
| | | | - Don't forget about vn_close() in case of failure.
* Fix UMA zone leak.pjd2004-09-141-0/+1
|
* Use bioq_takefirst()phk2004-09-071-3/+1
|
* Don't g_waitidle() when initializing a preloaded md. This fixes acperciva2004-08-301-1/+2
| | | | | | | | deadlock which otherwise occurs during the boot process. Reported by: kensmith MFC after: 3 days (assuming that re@ approves)
* When creating a new md, wait for geom's event queue to become emptycperciva2004-08-221-0/+1
| | | | | | | | | | before returning. Device nodes are created via the "taste" mechanism, so this is necessary in order to make sure that devfs entries are created before mdconfig(8) returns. This may be a MFC candidate for 5.3. Suggested by: phk
* Tag all geom classes in the tree with a version number.phk2004-08-081-0/+1
|
* Use a ->fini() from the geom class to destroy the control device.phk2004-08-081-40/+19
| | | | Use default initialization of geom methods.
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-0/+1
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-3/+3
| | | | Bump __FreeBSD_version accordingly.
* Fix panic which occurs when given sector size for memory-backed devicepjd2004-05-181-2/+1
| | | | | | | is less than DEV_BSIZE (512) bytes. Reported by: Mike Bristow <mike@urgle.com> Approved by: phk
* Ooops, removed this acknowledgement bogusly.imp2004-04-091-0/+4
| | | | Eagle Eyes: bde
* Remove advertising clause from University of California Regent'simp2004-04-071-8/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, italc2004-04-031-1/+1
| | | | | | | should not. Add a new parameter so that the caller can specify which is the case. Reported by: dillon
* Fix a bug with preloaded image -- for some reason [that i don'tluigi2004-03-311-14/+3
| | | | | | | | | completely understand], md_takeroot() runs before md_preloaded(), rendering both useless. As a fix, move the body (effectively one line!) of md_takeroot() into md_preloaded(), and get rid of the stuff that has become useless. Bug and fix reported 10 days ago on -current, no reply.
* - Remove some unused #includes.alc2004-03-191-72/+58
| | | | - Apply some style fixes to mdstart_swap().
* Utilize sf_buf_alloc() and sf_buf_free() to implement the ephemeralalc2004-03-181-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | mappings required by mdstart_swap(). On i386, if the ephemeral mapping is already in the sf_buf mapping cache, a swap-backed md performs similarly to a malloc-backed md. Even if the ephemeral mapping is not cached, this implementation is still faster. On 64-bit platforms, this change has the effect of using the direct virtual-to-physical mapping, avoiding ephemeral mapping overheads, such as TLB shootdowns on SMPs. On a 2.4GHz, 400MHz FSB P4 Xeon configured with 64K sf_bufs and "mdmfs -S -o async -s 128m md /mnt" before: dd if=/dev/md0 of=/dev/null bs=64k 134217728 bytes transferred in 0.430923 secs (311465697 bytes/sec) after with cold sf_buf cache: dd if=/dev/md0 of=/dev/null bs=64k 134217728 bytes transferred in 0.367948 secs (364773576 bytes/sec) after with warm sf_buf cache: dd if=/dev/md0 of=/dev/null bs=64k 134217728 bytes transferred in 0.252826 secs (530870010 bytes/sec) malloc-backed md: dd if=/dev/md0 of=/dev/null bs=64k 134217728 bytes transferred in 0.253126 secs (530240978 bytes/sec)
* Allow swap-backed devices to run without Giant.alc2004-03-141-3/+1
|
* Fix a long-standing deadlock issue with vnode backed md(4) devices:phk2004-03-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* kthread_exit() no longer requires Giant, so don't force callers to acquirejhb2004-03-051-2/+2
| | | | | | Giant just to call kthread_exit(). Requested by: many
* Make swapbacked md(4) devices respect the -x and -y emulation arguments.phk2004-03-021-0/+4
|
* Use DEV_BSIZE byte sectors instead of PAGE_SIZE byte sectors forcperciva2004-02-291-19/+49
| | | | | | | | | | | | | swap-backed memory disks. This reduces filesystem allocation overhead and makes swap-backed memory disks compatible with broken code (dd, for example) which expects to see 512 byte sectors. The size of a swap-backed memory disk must still be a multiple of the page size. When performing page-aligned operations, this change has zero performance impact. Reviewed by: phk Approved by: rwatson (mentor)
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Allow specification of a geometry for vnode backed devices as well asphk2004-01-121-0/+4
| | | | for malloc backed devices.
* Fix a locking problem with MD_ROOT_SIZE.phk2003-12-131-6/+3
| | | | Retire md(4)'s static major number.
* Use the class->init() to hitch up preload devices, rather than rely onphk2003-11-181-2/+6
| | | | | | | | | the "old" SYSINIT. This makes sure things happen in the right order. XXX: md(4) needs to be fully geom-ified and in particluar /dev/md.ctl should be abandonded for the GEOM OaM api. Approved by: re@
* Don't initialize unused bio_blkno field.phk2003-10-181-1/+0
|
* The present defaults for the open and close for device drivers whichphk2003-09-271-2/+0
| | | | | | | | | | | | | | provide no methods does not make any sense, and is not used by any driver. It is a pretty hard to come up with even a theoretical concept of a device driver which would always fail open and close with ENODEV. Change the defaults to be nullopen() and nullclose() which simply does nothing. Remove explicit initializations to these from the drivers which already used them.
* Consistently use the BSD u_int and u_short instead of the SYSV uint andjhb2003-08-071-4/+4
| | | | | | | ushort. In most of these files, there was a mixture of both styles and this change just makes them self-consistent. Requested by: bde (kern_ktrace.c)
* Change the implementation of swap backing to use the VM system in normalphk2003-08-051-23/+59
| | | | ways, and drop the need for vm_pager_strategy().
OpenPOWER on IntegriCloud