Commit Graph

788 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
f5a2f7feac Implement new reading algorithm, which will use parity component for reading
as well, even if device is in complete state.
I observe 40% of speed-up with this option for random read operations,
but slowdown for sequential reads.
Basically, without this option reading from a RAID3 device built from 5
components (c0-c4) looks like this:

	Request no.	Used components
	1		c0+c1+c2+c3
	2		c0+c1+c2+c3
	3		c0+c1+c2+c3

With the new feature:

	Request no.	Used components
	1		c0+c1+c2+c3
	2		(c1^c2^c3^c4)+c1+c2+c3
	3		c0+(c0^c2^c3^c4)+c2+c3
	4		c0+c1+(c0^c1^c3^c4)+c3
	5		c0+c1+c2+(c0^c1^c2^c4)
	6		c0+c1+c2+c3
	[...]
2004-08-21 18:11:46 +00:00
Lukas Ertl
83bfcb1092 A volume can be up if it has a degraded RAID5 plex. 2004-08-19 12:03:27 +00:00
Pawel Jakub Dawidek
d86bc96cab We really don't want to receive spoil event for synchroniztion consumers. 2004-08-18 23:33:37 +00:00
Poul-Henning Kamp
a9654c8c58 Do not override the class provided dumpconf function. 2004-08-18 21:42:08 +00:00
Lukas Ertl
9a8bd51965 Pretty print some informational messages. 2004-08-18 20:43:56 +00:00
Lukas Ertl
d30f29867e Fix a stupid bug in the drive taste function: when checking if a
drive is known to the configuration check also if it already has a geom.
Without this check several needless geoms are created and valid
configuration data was overwritten.

This change obsoletes the need for a separate geom to taste an
offered provider and the consumer doesn't need to be opened with the
exclusive bit set.
2004-08-18 20:34:45 +00:00
Pawel Jakub Dawidek
b25aec32ff NOP class doesn't operate on metadata, so the spoil event can be safely
ignored.
2004-08-18 16:58:42 +00:00
Pawel Jakub Dawidek
28b31df727 Dump device status on 'list' command. 2004-08-18 16:46:51 +00:00
Pawel Jakub Dawidek
f1ad62a4d8 Bump synchronization ID if we are sure, that we have ACTIVE components. 2004-08-18 07:28:48 +00:00
David E. O'Brien
fa6a78376f Minor style.9 cleanup. 2004-08-16 10:33:35 +00:00
Pawel Jakub Dawidek
809a9dc601 Decrease debug level to 0. 2004-08-16 08:33:04 +00:00
Pawel Jakub Dawidek
5e6db16cd6 Fix warning. 2004-08-16 08:21:31 +00:00
Pawel Jakub Dawidek
2d1661a5b6 Introduce GEOM RAID3 class, i.e. kernel module, which implements RAID3
transformation and graid3(8) userland utility, which can be used for
configuration. No manual page yet, sorry.

Hardware provided by:	Daniel Seuffert
2004-08-16 06:23:14 +00:00
Pawel Jakub Dawidek
f62d59df32 Avoid code duplication by introducing g_mirror_write_metadata() function,
which is used now by g_mirror_clear_metadata() function and
g_mirror_update_metadata() function.
2004-08-15 13:58:29 +00:00
Lukas Ertl
71fd4f60da Make informational output look less like an accident. 2004-08-14 09:56:17 +00:00
Max Khon
75261008d7 Add geom_uzip -- geom class that implements read-only compressed disks.
Currently supports cloop V2.0 disk compression format.
May support more formats in future.
2004-08-13 09:40:58 +00:00
Pawel Jakub Dawidek
887c9fd564 MFp4: Simplify code a bit:
- Remove kern.geom.mirror.sync_block_size sysctl. It is quite obvious that we
  want to use the biggest size possible.
- Do not use UMA zone for sync data allocations. There could be only one
  synchronization request per synchronized disk at a time, so allocate memory
  for one request on whole synchronization process related to one disk.

Tested by synchronizing one component (out of three) and by synchronizing
two components (out of three) in parallel.
2004-08-11 23:41:53 +00:00
Pawel Jakub Dawidek
445a4b68f2 Actually, HARDCODED flag isn't stored in metadata, so don't bother
dumping it.
2004-08-11 22:16:42 +00:00
Pawel Jakub Dawidek
2def749bb1 - Fix typo.
- Dump HARDCODED flag.
2004-08-11 22:12:44 +00:00
Pawel Jakub Dawidek
a5ef629f10 Increase default kern.geom.stripe.maxmem to 50 elements. 2004-08-11 12:57:17 +00:00
Pawel Jakub Dawidek
1b949c05a3 When sending request once again because of ENOMEM, reset bio_children
and bio_inbed fields to 0. Without this change we can end up with
I/O leakage in some rare situations.
I tested this change by putting failure probability mechanism simlar
to this used in NOP class into g_clone_bio(9) function, so it was
able to return NULL with the given probability.

Discussed with:	phk
2004-08-11 12:04:35 +00:00
Pawel Jakub Dawidek
6d8fb92d78 Try harder to not panic on 'stop -f'.
After the commit, this command should be really safe to use.
2004-08-11 11:10:46 +00:00
Lukas Ertl
92f49a969d If we kill the worklist thread of a RAID5 plex we can destroy
the worklist mutex at the same time, so move the mtx_destroy() call
to gv_kill_thread().
2004-08-10 20:51:48 +00:00
Lukas Ertl
ecffb8e64b Lock the topology before calling gv_parse_config, not afterwards. 2004-08-10 20:15:12 +00:00
Pawel Jakub Dawidek
6b2b3e8745 - Recognize HARDCODED flag when dumping consumer configuration.
- Improve code readabilty a bit.
2004-08-10 19:53:31 +00:00
Pawel Jakub Dawidek
c38d2f4eca Forgot to commit those: introduce hardcoded provider functionality,
which allow to store provider's name in the metadata and avoid
problems when few providers share the same last sector.
2004-08-10 19:52:12 +00:00
Pawel Jakub Dawidek
4ffa3fef69 Fix one of the lastest commit. This bio_caller1 should also be changed to
bio_driver1 (as all the rest).
This introduced a small memory leak, but it wasn't really critical,
because maximum memory for g_stripe_zone is always set, so after few
requests gstripe was working in "economic" mode.
2004-08-10 19:07:55 +00:00
Pawel Jakub Dawidek
6c74f5177c - Introduce option for hardcoding providers' names into metadata.
It allows to fix problems when last provider's sector is shared between few
  providers.
- Bump version number for CONCAT and STRIPE and add code for backward
  compatibility.
- Do not bump version number of MIRROR, as it wasn't officially introduced yet.
  Even if someone started to play with it, there is no big deal, because
  wrong MD5 sum of metadata will deny those providers.
- Update manual pages.
- Add version history to g_(stripe|concat).h files.
2004-08-09 11:29:42 +00:00
Pawel Jakub Dawidek
7e72a70863 Do not use g_wither_geom(9). I doesn't work in the way which is expected
here anymore (after g_wither_washer() was introduced), i.e. geom and consumer
will not be immediately destroyed if possible.
2004-08-09 11:14:25 +00:00
Poul-Henning Kamp
157b106eae Too many versions.
Spotted by:	pjd
2004-08-09 06:04:00 +00:00
Poul-Henning Kamp
07f076fe7a OK, now check geom class version numbers. 2004-08-08 08:34:46 +00:00
Poul-Henning Kamp
5721c9c76a Tag all geom classes in the tree with a version number. 2004-08-08 07:57:53 +00:00
Poul-Henning Kamp
e232f70a75 OOps, that check was a bit premature. Allow zero versions as well. 2004-08-08 07:30:47 +00:00
Poul-Henning Kamp
650ee351b3 Use default method initialization on geoms. 2004-08-08 06:49:07 +00:00
Poul-Henning Kamp
dd66958e28 Give classes a version number and refuse to touch classes which are not
understood.  This makes room for additional binary compatibility in the
future.

Put fields in the class for the geom's methods and initialize the methods
of a new geom from these fields.  This saves some code in all classes.
2004-08-08 06:46:27 +00:00
Pawel Jakub Dawidek
cea363682f Add and document kern.geom.stripe.fast_failed sysctl, which shows how
many times "fast" mode failed.
2004-08-06 10:19:34 +00:00
Pawel Jakub Dawidek
ec70430134 Fields bio_caller[12] should be used by the consumer and fields
bio_driver[12] should be used by the provider!
2004-08-06 10:07:03 +00:00
Pawel Jakub Dawidek
37abacd4ff Fix I/O leakage. We're cloning bios in g_stripe_start_fast(), but when
something goes wrong while running in "fast" mode, we free all bios and
falling back to "economic" mode. Freeing bios, doesn't mean decrease
bio_children, so bio_inbed couldn't be equal to bio_children and request
was never finished.
Decrease bio_children manually when destroying bios.

Reported by:	Sam Lawrance <boris@brooknet.com.au>, simon
2004-08-06 09:55:40 +00:00
Pawel Jakub Dawidek
db332970e7 Don't use 'bp' after its destruction! 2004-08-05 14:07:21 +00:00
Pawel Jakub Dawidek
a4fa09ec93 Simplify a bit - we could use 'sc' here as it was initialized properly. 2004-08-05 13:22:17 +00:00
Pawel Jakub Dawidek
51385a3c00 - Add two fields to bio structure: 'bio_cflags' which can be used by
consumer and 'bio_pflags' which can be used by provider.
- Remove BIO_FLAG1 and BIO_FLAG2 flags. From now on new fields should be
  used for internal flags.
- Update g_bio(9) manual page.
- Update some comments.
- Update GEOM_MIRROR, which was the only one using BIO_FLAGs.

Idea from:	phk
Reviewed by:	phk
2004-08-04 21:35:05 +00:00
Pawel Jakub Dawidek
fe7c3780c8 - Add "prefer" balance algorithm. When used, only disk with the biggest
priority will be used for reading.
- Bump version number.
2004-08-04 12:09:53 +00:00
Pawel Jakub Dawidek
e1efe7edcd MFp4: We don't really need g_mirror_free_disk() function. 2004-08-04 10:02:06 +00:00
Pawel Jakub Dawidek
7d01f1820a Fix comment. 2004-08-03 15:41:33 +00:00
Pawel Jakub Dawidek
969ff54d70 - Fix unloading by the same way it is done in my other classes:
set gp->softc to NULL and return ENXIO when it is NULL, so GEOM
  will not panic or hang, but unload one device on every 'unload'.
  This make 'unload' command usable, but it have to be executed
  <number of devices> + 1 times.
- Made use of 'pp' variable.
2004-08-02 00:37:40 +00:00
Pawel Jakub Dawidek
6b1c71eef8 Typo. 2004-08-01 20:41:58 +00:00
Pawel Jakub Dawidek
4084e6aad2 - Launch main provider when there are no more disks in NEW state.
- Log syncid bump at debug level 1.
2004-08-01 09:01:50 +00:00
Pawel Jakub Dawidek
959521ff1f If there are no valid components after the timeout, just destroy device.
There is probably nothing to wait for.
2004-07-31 22:10:51 +00:00
Lukas Ertl
4b017d0d93 Propagate size changes upwards. 2004-07-31 21:34:21 +00:00
Pawel Jakub Dawidek
4b2e596e38 Handle spoil event in dedicated function: g_mirror_spoiled().
The different between the new function and g_mirror_orphan() (which was
used previously) is that syncid is bumped immediately, instead of on
first write, because when consumer was spoiled, it means, that its
provider was opened for writing, so we can't trust that its data
will be valid when it will be connected again.
2004-07-31 21:08:17 +00:00