aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/nop
Commit message (Collapse)AuthorAgeFilesLines
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* geom: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365226
* Consistently use gctl_get_provider instead of home-grown variants.Xin LI2020-07-221-35/+13
| | | | | | | | | Reviewed by: cem, imp MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D25739 Notes: svn path=/head/; revision=363411
* sys/geom: consistently use _PATH_DEV instead of hardcoding "/dev/".Xin LI2020-07-091-8/+8
| | | | | | | | | Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25565 Notes: svn path=/head/; revision=363034
* Reimplement aliases in geomWarner Losh2020-05-131-0/+3
| | | | | | | | | | | | | | The alias needs to be part of the provider instead of the geom to work properly. To bind the DEV geom, we need to look at the provider's names and aliases and create the dev entries from there. If this lives in the GEOM, then it won't propigate down the tree properly. Remove it from geom, add it provider. Update geli, gmountver, gnop, gpart, and guzip to use it, which handles the bulk of the uses in FreeBSD. I think this is all the providers that create a new name based on their parent's name. Notes: svn path=/head/; revision=361015
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Pass BIO_SPEEDUP through all the geom layersWarner Losh2020-01-172-0/+7
| | | | | | | | | | | | | | | While some geom layers pass unknown commands down, not all do. For the ones that don't, pass BIO_SPEEDUP down to the providers that constittue the geom, as applicable. No changes to vinum or virstor because I was unsure how to add this support, and I'm also unsure how to test these. gvinum doesn't implement BIO_FLUSH either, so it may just be poorly maintained. gvirstor is for testing and not supportig BIO_SPEEDUP is fine. Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D23183 Notes: svn path=/head/; revision=356818
* gnop: change the "count until fail" optionMariusz Zaborski2019-12-291-11/+16
| | | | | | | | | | | | | | | | | | | | | | Change the "count_until_fail" option of gnop, now it enables the failing rating instead of setting them to 100%. The original patch introduced the new flag, which sets the fail/rate to 100% after N requests. In some cases, we don't want to have 100% of failure probabilities. We want to start failing at some point. For example, on the early stage, we may like to allow some read/writes requests before having some requests delayed - when we try to mount the partition, or when we are trying to import the pool. Another case may be to check how scrub in ZFS will behave on different stages. This allows us to cover more cases. The previous behavior still may be configured. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22632 Notes: svn path=/head/; revision=356176
* gnop: allow to change the name of created deviceMariusz Zaborski2019-12-291-7/+40
| | | | | | | | | | | | Thanks to this option we can create more then one gnop provider from single provider. This may be useful for temporary labeling some data on the disk. Reviewed by: markj, allanjude, bcr Differential Revision: https://reviews.freebsd.org/D22304 Notes: svn path=/head/; revision=356174
* Make all the gnop parameters optional in the request from userland,Chuck Silvers2019-10-161-171/+172
| | | | | | | | | | | | | filling in the same defaults that the current userland module uses. This allows an old geom_nop.so userland module to work with a new kernel. Approved by: imp (mentor) Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21972 Notes: svn path=/head/; revision=353668
* Add a "count_until_fail" option to gnop, which says to start failingChuck Silvers2019-09-132-6/+36
| | | | | | | | | | | | I/O requests after the given number have been allowed though. Approved by: imp (mentor) Reviewed by: rpokala kib 0mp mckusick Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21593 Notes: svn path=/head/; revision=352312
* GEOM: Reduce unnecessary log interleaving with sbufsConrad Meyer2019-08-072-19/+5
| | | | | | | | | | | | | | | Similar to what was done for device_printfs in r347229. Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an sbuf; documented in g_bio.9. Reviewed by: markj Discussed with: rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21165 Notes: svn path=/head/; revision=350694
* gnop: style nitsMariusz Zaborski2019-07-311-1/+2
| | | | Notes: svn path=/head/; revision=350472
* gnop: Introduce requests delay.Mariusz Zaborski2019-07-312-26/+180
| | | | | | | | | | This allows to simulated disk that is responding slowly to the IO requests. Reviewed by: markj, bcr, pjd (previous version) Differential Revision: https://reviews.freebsd.org/D21052 Notes: svn path=/head/; revision=350471
* When using the destroy option to shut down a nop GEOM module, I/OKirk McKusick2019-05-251-13/+25
| | | | | | | | | | | | | | | | | operations already in its queue were not being properly drained. The GEOM framework does the queue draining, but the module needs to wait for the draining to happen. The waiting is done by adding a g_nop_providergone() function to wait for the I/O operations to finish up. This change is similar to change -r345758 made to the memory-disk driver. Submitted by: Chuck Silvers Tested by: Chuck Silvers MFC after: 1 week Sponsored by: Netflix Notes: svn path=/head/; revision=348259
* gnop(8): Nopify configuration as a kernel dump deviceConrad Meyer2019-04-221-5/+48
| | | | | | | | | | As a dummy / no-op dump device, to facilitate dumpon(8) testing. Reviewed by: markj (earlier version) Differential Revision: https://reviews.freebsd.org/D19991 Notes: svn path=/head/; revision=346516
* Extend stripeoffset and stripesize of GEOMs from u_int to off_tEugene Grosbein2018-10-271-2/+2
| | | | | | | | | | | | | | GEOM's stripeoffset overflows at 4 gigabyte margin (2^32) because of its u_int type. This leads to incorrect data in the output generated by "sysctl kern.geom.confxml" command, "graid list" etc. when GEOM array has volumes larger than 4G, for example. This change does not affect ABI but changes KBI. No MFC planned. Differential Revision: https://reviews.freebsd.org/D13426 Notes: svn path=/head/; revision=339815
* Annotate geom modules with MODULE_VERSIONKyle Evans2018-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | GEOM ELI may double ask the password during boot. Once at loader time, and once at init time. This happens due a module loading bug. By default GEOM ELI caches the password in the kernel, but without the MODULE_VERSION annotation, the kernel loads over the kernel module, even if the GEOM ELI was compiled into the kernel. In this case, the newly loaded module purges/invalidates/overwrites the GEOM ELI's password cache, which causes the double asking. MFC Note: There's a pc98 component to the original submission that is omitted here due to pc98 removal in head. This part will need to be revived upon MFC. Reviewed by: imp Submitted by: op Obtained from: opBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14992 Notes: svn path=/head/; revision=332387
* gnop(8): add the ability to set a nop provider's physical pathAlan Somers2018-01-182-3/+22
| | | | | | | | | | While I'm here, expand the existing tests a bit. MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13579 Notes: svn path=/head/; revision=328108
* sys/geom: adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326270
* Make geom_nop(4) collect statistics on all types of BIOs, not justEdward Tomasz Napierala2015-10-102-0/+42
| | | | | | | | | | | | | reads and writes. PR: kern/198405 Submitted by: Matthew D. Fuller <fullermd at over-yonder dot net> MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3679 Notes: svn path=/head/; revision=289110
* Add a way to specify stripesize and stripeoffset to gnop(8). This makesEdward Tomasz Napierala2015-09-152-3/+41
| | | | | | | | | | | | it possible to "simulate" 4K media, to eg test alignment handling. Reviewed by: mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3664 Notes: svn path=/head/; revision=287827
* gnop: make sure that newly allocated memory for softc is zeroedMateusz Guzik2013-10-231-1/+1
| | | | | | | | | | This prevents mtx_init from encountering non-zeros and panicking the kernel as a result. Reported by: Keith White <kwhite site.uottawa.ca> Notes: svn path=/head/; revision=256951
* Merge GEOM direct dispatch changes from the projects/camlock branch.Alexander Motin2013-10-222-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=256880
* move the error report to a lower log level... Now you can see when itJohn-Mark Gurney2013-04-132-4/+5
| | | | | | | | | returns an error without getting every single io that went through it.. MFC after: 1 week Notes: svn path=/head/; revision=249440
* GEOM NOP does not touch the data, so pass G_PF_ACCEPT_UNMAPPED flag through.Alexander Motin2013-03-261-0/+1
| | | | Notes: svn path=/head/; revision=248721
* Remove extra bio_data and bio_length copying to child request after callingAlexander Motin2013-03-261-2/+0
| | | | | | | g_clone_bio(), that already copied them. Notes: svn path=/head/; revision=248720
* - Don't pass geom and provider names as format strings.Jaakko Heinonen2012-11-201-2/+2
| | | | | | | | | | - Add __printflike() attributes. - Remove an extra argument for the g_new_geomf() call in swapongeom_ev(). Reviewed by: pjd Notes: svn path=/head/; revision=243333
* Add trivial resize handling to gnop(8).Edward Tomasz Napierala2012-07-072-0/+29
| | | | | | | | Reviewed by: mav Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=238219
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+1
| | | | | | | | | 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. Notes: svn path=/head/; revision=227309
* Include sys/sbuf.h directly.Andrey V. Elsukov2011-07-111-0/+1
| | | | | | | Reviewed by: pjd Notes: svn path=/head/; revision=223921
* Remove unneeded checks, g_new_xxx functions can not return NULL.Andrey V. Elsukov2011-03-311-26/+6
| | | | | | | | Reviewed by: pjd MFC after: 1 week Notes: svn path=/head/; revision=220184
* Sector size can not be greater than MAXPHYS.Andrey V. Elsukov2011-01-121-0/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=217303
* Remove redundant check.Andrey V. Elsukov2011-01-111-2/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=217263
* Round GNOP provider's mediasize to its sectorsize. This prevents KASSERTAndrey V. Elsukov2011-01-111-0/+2
| | | | | | | | | | in g_io_request when geom classes doing tasting. PR: kern/147852 MFC after: 1 week Notes: svn path=/head/; revision=217262
* Remove trailing spaces.Pawel Jakub Dawidek2006-09-301-1/+1
| | | | Notes: svn path=/head/; revision=162834
* Fix format character.Pawel Jakub Dawidek2006-09-081-1/+1
| | | | | | | Reported by: andre Notes: svn path=/head/; revision=162153
* - Split failure probability configuration into read failure probability andPawel Jakub Dawidek2006-09-082-26/+74
| | | | | | | | | | write failure probability. - Allow to specify an error number to return of failure. MFC after: 3 days Notes: svn path=/head/; revision=162142
* Remove trailing spaces.Pawel Jakub Dawidek2006-02-011-9/+9
| | | | Notes: svn path=/head/; revision=155174
* Log situation when EIO is returned.Pawel Jakub Dawidek2006-01-171-0/+1
| | | | Notes: svn path=/head/; revision=154459
* Remove bio leak when EIO error is emulated.Pawel Jakub Dawidek2006-01-171-5/+5
| | | | | | | | Found by: Coverity Prevent(tm) MFC after: 3 days Notes: svn path=/head/; revision=154458
* MFp4: Typo fix (without it the XML GEOM tree wasn't consistent).Pawel Jakub Dawidek2005-12-191-1/+1
| | | | | | | Reported by: Eric Anderson <anderson@centtech.com> Notes: svn path=/head/; revision=153532
* Fix build breakage by fixing typo.Pawel Jakub Dawidek2005-12-091-1/+1
| | | | | | | Reported by: glebius Notes: svn path=/head/; revision=153265
* Teach NOP GEOM class how to gather the following statistics:Pawel Jakub Dawidek2005-12-082-3/+74
| | | | | | | | | | | - 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. Notes: svn path=/head/; revision=153250
* g_nop_create: destroy newly created provider in case of errors.Max Khon2004-09-161-1/+1
| | | | Notes: svn path=/head/; revision=135302
* NOP class doesn't operate on metadata, so the spoil event can be safelyPawel Jakub Dawidek2004-08-181-1/+0
| | | | | | | ignored. Notes: svn path=/head/; revision=133981
* Tag all geom classes in the tree with a version number.Poul-Henning Kamp2004-08-081-0/+1
| | | | Notes: svn path=/head/; revision=133318
* - Fix unloading by the same way it is done in my other classes:Pawel Jakub Dawidek2004-08-021-3/+5
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=132988
* - Add '-S' option, which allow to specify sector size for transparentPawel Jakub Dawidek2004-07-302-5/+20
| | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=132877
* Improve geom(8)'s 'list' command to show geoms and their providers andPawel Jakub Dawidek2004-07-261-3/+3
| | | | | | | consumers. Teach STRIPE, CONCAT and NOP classes about this improvement. Notes: svn path=/head/; revision=132665