Commit Graph

33 Commits

Author SHA1 Message Date
mjg
c2c7122a9a gnop: make sure that newly allocated memory for softc is zeroed
This prevents mtx_init from encountering non-zeros and panicking
the kernel as a result.

Reported by:	Keith White <kwhite site.uottawa.ca>
2013-10-23 01:34:18 +00:00
mav
4219fc0074 Merge GEOM direct dispatch changes from the projects/camlock branch.
When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

The defined now safety requirements are:
 - caller should not hold any locks and should be reenterable;
 - callee should not depend on GEOM dual-threaded concurency semantics;
 - on the way down, if request is unmapped while callee doesn't support it,
   the context should be sleepable;
 - kernel thread stack usage should be below 50%.

To keep compatibility with GEOM classes not meeting above requirements
new provider and consumer flags added:
 - G_CF_DIRECT_SEND -- consumer code meets caller requirements (request);
 - G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done);
 - G_PF_DIRECT_SEND -- provider code meets caller requirements (done);
 - G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request).
Capable GEOM class can set them, allowing direct dispatch in cases where
it is safe.  If any of requirements are not met, request is queued to
g_up or g_down thread same as before.

Such GEOM classes were reviewed and updated to support direct dispatch:
CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE,
VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL,
MAP, FLASHMAP, etc).

To declare direct completion capability disk(9) KPI got new flag equivalent
to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION.  da(4) and ada(4) disk
drivers got it set now thanks to earlier CAM locking work.

This change more then twice increases peak block storage performance on
systems with manu CPUs, together with earlier CAM locking changes reaching
more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to
256 user-level threads).

Sponsored by:	iXsystems, Inc.
MFC after:	2 months
2013-10-22 08:22:19 +00:00
jmg
b9f17d62db move the error report to a lower log level... Now you can see when it
returns an error without getting every single io that went through it..

MFC after:	1 week
2013-04-13 19:02:58 +00:00
mav
9856e08103 GEOM NOP does not touch the data, so pass G_PF_ACCEPT_UNMAPPED flag through. 2013-03-26 05:58:49 +00:00
mav
7997002b4f Remove extra bio_data and bio_length copying to child request after calling
g_clone_bio(), that already copied them.
2013-03-26 05:42:12 +00:00
jh
25dd09b996 - Don't pass geom and provider names as format strings.
- Add __printflike() attributes.
- Remove an extra argument for the g_new_geomf() call in swapongeom_ev().

Reviewed by:	pjd
2012-11-20 12:32:18 +00:00
trasz
b9655c9adb Add trivial resize handling to gnop(8).
Reviewed by:	mav
Sponsored by:	FreeBSD Foundation
2012-07-07 22:22:13 +00:00
ed
0c56cf839d Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.
The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.
2011-11-07 15:43:11 +00:00
ae
972deb0b1f Include sys/sbuf.h directly.
Reviewed by:	pjd
2011-07-11 05:22:31 +00:00
ae
fa6777f630 Remove unneeded checks, g_new_xxx functions can not return NULL.
Reviewed by:	pjd
MFC after:	1 week
2011-03-31 06:30:59 +00:00
ae
e2bf490883 Sector size can not be greater than MAXPHYS.
MFC after:	1 week
2011-01-12 12:26:10 +00:00
ae
73f08c7ac5 Remove redundant check.
MFC after:	1 week
2011-01-11 13:22:20 +00:00
ae
0827d66d68 Round GNOP provider's mediasize to its sectorsize. This prevents KASSERT
in g_io_request when geom classes doing tasting.

PR:		kern/147852
MFC after:	1 week
2011-01-11 11:42:22 +00:00
pjd
cb0554d5cc Remove trailing spaces. 2006-09-30 08:16:49 +00:00
pjd
dd3e975df2 Fix format character.
Reported by:	andre
2006-09-08 13:46:18 +00:00
pjd
40cda51553 - Split failure probability configuration into read failure probability and
write failure probability.
- Allow to specify an error number to return of failure.

MFC after:	3 days
2006-09-08 09:21:21 +00:00
pjd
6f074b6d64 Remove trailing spaces. 2006-02-01 12:06:01 +00:00
pjd
be5920e329 Log situation when EIO is returned. 2006-01-17 07:23:36 +00:00
pjd
a80ec2a9b9 Remove bio leak when EIO error is emulated.
Found by:	Coverity Prevent(tm)
MFC after:	3 days
2006-01-17 07:22:44 +00:00
pjd
684d795581 MFp4: Typo fix (without it the XML GEOM tree wasn't consistent).
Reported by:	Eric Anderson <anderson@centtech.com>
2005-12-19 06:05:40 +00:00
pjd
8848f7ef86 Fix build breakage by fixing typo.
Reported by:	glebius
2005-12-09 11:38:02 +00:00
pjd
7ea810fefd Teach NOP GEOM class how to gather the following statistics:
- number of read I/O requests,
- number of write I/O requests,
- number of read bytes,
- number of written bytes.
Add 'reset' subcommand for resetting statistics.
2005-12-08 23:00:31 +00:00
fjoe
76d2723d97 g_nop_create: destroy newly created provider in case of errors. 2004-09-16 15:28:48 +00:00
pjd
596d3e1549 NOP class doesn't operate on metadata, so the spoil event can be safely
ignored.
2004-08-18 16:58:42 +00:00
phk
d8d2b01380 Tag all geom classes in the tree with a version number. 2004-08-08 07:57:53 +00:00
pjd
889eca7e19 - 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
pjd
7a7cae7b30 - Add '-S' option, which allow to specify sector size for transparent
provider.
- Bump version number.

This allows for a quite interesting trick. One can setup a stripe with
stripe size of 512 bytes and create transparent provider on top of it
with sector size equal to <ndisks> * 512. The result will be something
like RAID3 without parity disk (every access will touch all disks).
2004-07-30 08:19:22 +00:00
pjd
73a684d587 Improve geom(8)'s 'list' command to show geoms and their providers and
consumers. Teach STRIPE, CONCAT and NOP classes about this improvement.
2004-07-26 17:14:47 +00:00
pjd
67d8cb396e MFp4: Add two options for gnop(8)'s 'create' command:
-o offset - specifies where to start on the original provider
	-s size - specifies size of the transparent provider
2004-07-19 07:52:56 +00:00
pjd
cffa6fd685 Fix format string. 2004-06-07 13:40:40 +00:00
pjd
3b62f6e040 Don't allow for duplicated entries creation. 2004-06-07 13:33:09 +00:00
pjd
b400b04c05 - Change command name from 'config' to 'configure'.
- Bump version number.
2004-05-21 15:23:48 +00:00
pjd
90c2eca016 Introduce NOP GEOM class. This is totally transparent GEOM class, but
it is very useful for tests. One is able to destroy its provider
forcibly if wants to test how other class handle such events.
One is also able to specify failure probability to check how other
classes handle I/O errors.

Supported by:	Wheel - Open Technologies - http://www.wheel.pl
2004-05-20 10:15:53 +00:00