Commit Graph

904 Commits

Author SHA1 Message Date
msaitoh afa3d2af2b Fix off by one read. 2012-12-10 08:36:03 +00:00
mrg 973b51a234 fix a problem in half-configured raid devices, found when a "raidctl -c"
failed, and a "raidctl -C" was run afterwards, triggering mutex locking
issues.  fix this by moving alloc and destroy of mutex/condvar for a
raid device into separate functions, and call the destroy function from
the DO_RAID_FAIL() macro.

probably needs a netbsd-6 pullup.  sigh.
2012-10-30 00:33:11 +00:00
buhrow 60b3c1baa9 Implement DIOCGSTRATEGY and DIOCSSTRATEGY to allow raidframe to use
different buffer queue strategies.
Initialize raid sets to use the default buffer queue strategy for the given
architecture, rather than forcing raidframe to use  fcfs in all cases.
This should cause raidframe to use the same buffer queue strategy as the
underlying disks.
On I386, I see performance enhancements of between 14 and 16% with raid5
sets with no other change.
See http://mail-index.NetBSD.org/tech-kern/2012/08/08/msg013758.html
for a discussion of this issue.
2012-08-09 23:53:25 +00:00
pooka fba658ace5 Initialize values to squelch gcc.
from Greg Oster
2012-07-19 22:47:52 +00:00
christos 7cb5dc5826 If our raid is now accessed from wedges, adjust the root to be the wedge
that corresponds to partition a. Is there a better way?
2012-04-07 01:39:38 +00:00
oster cebdda608a Add logic to the main reconstruction loop to handle RAID5 with rotated
spares.  While here, observe that we were actually doing one more
stripe than we thought we were, and correct that too (it didn't matter
for non-RAID5_RS, but it definitely does for RAID5_RS).  Add some
bounds-checking at the beginning to handle the case where the number
of stripes in the set is smaller than the sliding reconstruction window.

XXX: this problem likely needs to be fixed for PARITY_DECLUSTERING too.
2012-02-20 22:42:52 +00:00
oster e8dd466041 comment, and effectively remove, a DIAGNOSTIC check that
is invalid for RAID5_RS.
2012-02-20 22:42:05 +00:00
buhrow f4468b5b33 Add the ability to autoconfigure raid components on raw disks.
This change causes components on raw disks, as opposed to components inside
partitions or wedges, to be autoconfigured if the raid set is configured
for autoconfiguration.

Approved by oster@ and mrg@ for submission after the NetBSD-6 tag.  I've
been running these changes in production at my day job for over a year
without a problem.

See http://mail-index.NetBSD.org/tech-kern/2010/11/09/msg009167.html
for the original discussion of this patch and for a version of this patch
that works with NetBSD-5.x systems.
2012-02-16 06:52:03 +00:00
erh e2e97e1dc7 Statically initialize the raidautoconfig variable when RAID_AUTOCONFIG is set,
instead of setting it in code, so it can easily be checked and changed in an
on-disk kernel with gdb.  Use a separate raidautoconfigdone variable to keep
track of whether raid configuration has actually occurred.
2011-11-05 16:40:35 +00:00
hannken 2cc7a01f10 Change the vnode locking protocol of VOP_GETATTR() to request at least
a shared lock.  Make all calls outside of file systems respect it.

The calls from file systems need review.

No objections from tech-kern.
2011-10-14 09:23:28 +00:00
mbalmer 5ff9b946b6 Newline is \n, not /n. 2011-09-07 07:43:05 +00:00
plunky 7f3d4048d7 NULL does not need a cast 2011-08-31 18:31:02 +00:00
oster 28c3372a95 Address part of PR kern/44972. From YAMAMOTO Takashi. Thanks! 2011-08-03 15:00:29 +00:00
oster 6f6c76259e Remove unused 'struct lwp *' from rf_getdisksize. No functional changes. 2011-08-03 14:44:38 +00:00
mbalmer 631d5867a0 According to the Oxford Dictionary of Etymology, a wether is a male sheep
or ram.
2011-08-01 12:28:53 +00:00
jmcneill d2b1c474ba Add an FSILENT flag and use it to suppress "Medium Not Present" scsipi
spam when trying to access offline drives at boot.
2011-07-30 12:08:36 +00:00
oster d1aa4a0857 In rf_disks.c make sure ser_values and ser_count arrays are
initialized before use.

Validate the component label before considering a component for use,
and make sure we only consider components that are optimal.

Fixes PR#44251.  All atf RAIDframe tests now pass.
2011-07-29 19:55:50 +00:00
yamt 33d93c8dcc rf_ReconstructInPlace: don't leave a vnode open on errors.
fixes a part of PR/44972.
2011-05-28 00:53:04 +00:00
yamt c44faaeacb don't forget to destroy mutex. 2011-05-27 22:48:24 +00:00
buhrow 463102d28a Suggested to oster@ and approved via private e-mail as a help to
people who are getting reconstruction failures.
2011-05-24 07:33:41 +00:00
joerg f62ac60184 rf_panicbuf is already format, so don't pass it as format string to
panic()
2011-05-23 21:49:35 +00:00
mrg 8c36bb4b69 convert the main raidPtr mutex to a kmutex, and add a couple of cv's to
cover the old sleep/wakeup points for adding_hot_spare and waitForReconCond.
convert all remaining simple_lock's to kmutexes (they're not used or compiled
right now... even with all options enabled) and remove the support for them.

this leaves just a pair of tsleep()/wakeup() calls using old scheduling APIs.
2011-05-11 18:13:12 +00:00
mrg 30308cb715 convert regionBufferPool.mutex/cond and parityBufferPool.mutex/cond
to kmutex/cv.
2011-05-11 06:20:33 +00:00
mrg c57ca1d4fb convert parityLogPool.mutex to a kmutex. 2011-05-11 06:03:06 +00:00
mrg 662e58c786 convert regionInfo[regionID].mutex to a kmutex. 2011-05-11 05:14:07 +00:00
mrg 3dd617695f convert reintMutex to a kmutex. 2011-05-11 03:38:32 +00:00
mrg 32ab76b94a convert parityLogDiskQueue.mutex to a kmutex/cv.
XXX: some splbio() usage to clean up here
2011-05-11 03:23:26 +00:00
mrg 1c0dbcb69c convert RF_CommonLogData_s/RF_ReconMap_s mutex to a kmutex/cv. 2011-05-10 07:04:17 +00:00
mrg de9a772ed6 print "raidN: detached" when unconfiguring a raid device. 2011-05-10 05:08:51 +00:00
mrg a8b7159c16 convert stripelocks to kmutex. 2011-05-05 08:21:29 +00:00
mrg c4fdb0522f RF_BROADCAST_COND() is no more. 2011-05-05 08:21:09 +00:00
mrg 710e439b0e convert access_suspend_mutex to a kmutex/cv. 2011-05-05 07:12:58 +00:00
mrg ec1c557b57 convert the diskqueue mutex into a kmutex 2011-05-05 06:04:09 +00:00
mrg 50fe584a38 finish porting mcpair users to kmutex, and fix a couple of declarations
in rf_netbsdkintf.c.  fixes i386/conf/ALL build.
2011-05-05 04:20:51 +00:00
mrg 15d13d88fa convert the pssTable mutex into a kmutex/cv. 2011-05-03 08:18:43 +00:00
mrg 02d186e1e2 convert rb_mutex to a kmutex/cv. 2011-05-02 07:29:18 +00:00
mrg 05ec7078b4 use a unique wchan identifier for node_queue_cv than the old default. 2011-05-02 01:14:06 +00:00
mrg 70f1be105d re-apply the reverted previous, after fixing the missed wakeup:
convert eq_mutex to a kmutex/cv.
convert ltsleep() used for plain timeout into kpause().
2011-05-02 01:07:24 +00:00
mrg a0ccbf8109 rever the previous for now; it hangs reconstruction. 2011-05-02 00:39:37 +00:00
mrg 393bf63659 convert eq_mutex to a kmutex.
convert ltsleep() used for plain timeout into kpause().
2011-05-01 10:01:01 +00:00
mrg 44be382b63 convert rf_debug_mem_mutex to a kmutex, and fix RF_DEBUG_MEM option. 2011-05-01 06:49:43 +00:00
mrg 14b1a44c1b convert rf_tracing_mutex to a kmutex. 2011-05-01 06:22:54 +00:00
mrg 480f8c7b98 convert the (unused) rf_sparet_wait_mutex to a real mutex/cv. 2011-05-01 05:44:47 +00:00
mrg 14a4134463 convert mcpair to kmutex. 2011-05-01 01:09:05 +00:00
mrg 2b448af86b - convert rf_printf_mutex to a kmutex
- convert rf_rad_lock and the per-raid "cv" to per-raid kmutex/and real cv
- use rf_mutex_init() in places, and move it with the similar definitions
2011-04-30 01:44:36 +00:00
mrg 4f6a431a93 prepare to convert more raidframe old lock/sleep APIs to mutex/condvar:
- remove RF_DECLARE_EXTERN_MUTEX and RF_DECLARE_STATIC_MUTEX, the qualifier
  can be provided at the use point with the normal define
- rename the *LGMGR_MUTEX() macros to *mutex2() names, and add some more
  defines for use:
	rf_declare_mutex2()
	rf_declare_cond2()
	rf_lock_mutex2()
	rf_unlock_mutex2()
	rf_init_mutex2()
	rf_destroy_mutex2()
	rf_init_cond2()
	rf_destroy_cond2()
	rf_wait_cond2()
	rf_signal_cond2()
	rf_broadcast_cond2()
- use the new names for the configureMutex(), which previous used some combo
  of direct mutex* calls and macros
- convert the node_queue to use a mutex/cv combo
- in rf_ShutdownEngine() and DAGExecutionThread(), also signal the former from
  the latter when it is done and about to exit
- convert iodone_lock to use the new macros
2011-04-27 07:55:14 +00:00
mrg d9a6814d47 move the iodone setup and tear down into rf_engine.c. this fixes
"raidctl -u" and should also help the case where we fail to setup
a device part of the way through.
2011-04-23 22:22:46 +00:00
mrg b19ce40796 convert the iodone_lock to a mutex, and use a condvar for signalling.
this only handles the smallest use of old simple_lock/tsleep/wakeup
APIs inside raidframe, and it points out that cv(9)'s have only one
wait channel per cv, whereas each tsleep() caller can specify a
different wait channel.  this change removes the difference between
normal raidio and waiting for IO during shutdown.

i've tested this one 3 systems, ran atf, and had mlelstv and rmind
review the change.
2011-04-23 06:29:05 +00:00
mrg d85d9a6541 apply the fix_label hack to partitionSizeHi as well. it's needed there.
to do so, move the call to fix the label inside of rf_reasonable_label()
itself, so we can fix the partition sizes before calling
rf_component_label_partitionsize() itself.

fixes the failure mode where i had garbage not in numBlocksHi but in
partitionSizeHi, and the check against rf_component_label_partitionsize()
would fail and my raid would not auto-configure.
2011-03-18 23:53:26 +00:00
oster 01b117db0c Remove bogus RF_ASSERT that must have crept in by accident.
Thanks to Jan-Hinrich Fessel for reporting the issue.
2011-03-04 17:45:17 +00:00