aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/raid3
Commit message (Collapse)AuthorAgeFilesLines
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make g_attach() return ENXIO for orphaned providers; update variousEdward Tomasz Napierala2020-10-181-3/+5
| | | | | | | | | | | | | classes to add missing error checking. Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26658 Notes: svn path=/head/; revision=366811
* geom: clean up empty lines in .c and .h filesMateusz Guzik2020-09-012-3/+0
| | | | Notes: svn path=/head/; revision=365226
* Consistently use gctl_get_provider instead of home-grown variants.Xin LI2020-07-221-13/+2
| | | | | | | | | 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-2/+2
| | | | | | | | | Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25565 Notes: svn path=/head/; revision=363034
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-2/+3
| | | | | | | | | | | | | | | | | | | 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-171-0/+1
| | | | | | | | | | | | | | | 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
* GEOM: Reduce unnecessary log interleaving with sbufsConrad Meyer2019-08-072-22/+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
* Use sbuf_cat() in GEOM confxml generation.Alexander Motin2019-06-191-13/+13
| | | | | | | | | | | When it comes to megabytes of text, difference between sbuf_printf() and sbuf_cat() becomes substantial. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=349195
* 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
* sys/geom: adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-273-0/+6
| | | | | | | | | | | | | | | 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
* Use g_wither_provider() where applicable.Alexander Motin2016-09-231-2/+1
| | | | | | | | It is just a helper function combining G_PF_WITHER setting with g_orphan_provider(). Notes: svn path=/head/; revision=306279
* Removal of Giant droping wrappers for GEOM classes.Konstantin Belousov2016-05-201-2/+0
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=300288
* sys/geom: spelling fixes in comments.Pedro F. Giffuni2016-04-291-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298808
* Bump bio_cmd and bio_*flags from 8 bits to 16.Warner Losh2016-04-141-1/+1
| | | | | | | Differential Revision: https://reviews.freebsd.org/D5784 Notes: svn path=/head/; revision=297955
* Create an API to reset a struct bio (g_reset_bio). This is mandatoryWarner Losh2016-02-171-1/+1
| | | | | | | | | | | | for all struct bio you get back from g_{new,alloc}_bio. Temporary bios that you create on the stack or elsewhere should use this before first use of the bio, and between uses of the bio. At the moment, it is nothing more than a wrapper around bzero, but that may change in the future. The wrapper also removes one place where we encode the size of struct bio in the KBI. Notes: svn path=/head/; revision=295707
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-05-221-1/+1
| | | | | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-17/+7
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-7/+17
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-17/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Allow to insert new component to geom_raid3 without specifying number.Alexander Motin2013-01-151-16/+29
| | | | | | | | PR: kern/160562 MFC after: 2 weeks Notes: svn path=/head/; revision=245456
* Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumesAlexander Motin2013-01-151-9/+12
| | | | | | | | | | | | | | as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. MFC after: 2 weeks Notes: svn path=/head/; revision=245444
* When synchronizing, include in the config dump amount ofGleb Smirnoff2012-09-111-0/+5
| | | | | | | | | | | | | | | | | | bytes syncronized. The rationale behind this is the following: for large disks the percent synchronisation counter ticks too seldom, and monitoring software (as well as human operator) can't tell whether synchronisation goes on or one of disks got stuck. On an idle server one can look into gstat and see whether synchronisation goes on or not, but on a busy server that won't work. Also, new value monitored can be differentiated obtaining the synchronisation speed quite precisely. Submitted by: Konstantin Kukushkin <dark ramtel.ru> Reviewed by: pjd Notes: svn path=/head/; revision=240371
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-2/+3
| | | | | | | | | 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
* Implement relaxed comparision for hardcoded provider names to make itAlexander Motin2011-04-271-1/+2
| | | | | | | | ignore adX/adaY difference in both directions to simplify migration to the CAM-based ATA or back. Notes: svn path=/head/; revision=221101
* Add some FEATURE macros for various GEOM classes.Alexander Leidinger2011-02-251-0/+1
| | | | | | | | | | | | | | No FreeBSD version bump, the userland application to query the features will be committed last and can serve as an indication of the availablility if needed. Sponsored by: Google Summer of Code 2010 Submitted by: kibab Reviewed by: silence on geom@ during 2 weeks X-MFC after: to be determined in last commit with code from this project Notes: svn path=/head/; revision=219029
* Sector size can not be greater than MAXPHYS. Since GRAID3 calculatesAndrey V. Elsukov2011-01-121-0/+4
| | | | | | | | | | | sector size from user-specified block size, report to user about big blocksize. PR: kern/147851 MFC after: 1 week Notes: svn path=/head/; revision=217305
* Move wakeup() out of mutex to reduce contention.Alexander Motin2010-01-051-3/+3
| | | | Notes: svn path=/head/; revision=201567
* Slightly optimize XOR calculation.Alexander Motin2010-01-051-24/+31
| | | | Notes: svn path=/head/; revision=201545
* As soon as geom_raid3 reports it's own stripe as sector size, report largestAlexander Motin2009-12-241-0/+14
| | | | | | | | underlying provider's stripe, multiplied by number of data disks in array, due to transformation done, as array stripe. Notes: svn path=/head/; revision=200940
* Make graid3 fallback to malloc() when component request size is biggerAlexander Motin2009-12-212-9/+15
| | | | | | | then maximal prepared UMA zone size. This fixes crash with MAXPHYS > 128K. Notes: svn path=/head/; revision=200821
* Revert r190676,190677Andrew Thompson2009-04-101-1/+1
| | | | | | | | | | The geom and CAM changes for root_hold are the wrong solution for USB design quirks. Requested by: scottl Notes: svn path=/head/; revision=190878
* Add a how argument to root_mount_hold() so it can be passed NOWAIT and be calledAndrew Thompson2009-04-031-1/+1
| | | | | | | in situations where sleeping isnt allowed. Notes: svn path=/head/; revision=190676
* Rename the kthread_xxx (e.g. kthread_create()) callsJulian Elischer2007-10-201-3/+3
| | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls. Notes: svn path=/head/; revision=172836
* Commit 14/14 of sched_lock decomposition.Jeff Roberson2007-06-051-2/+2
| | | | | | | | | | | | | | - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each) Notes: svn path=/head/; revision=170307
* Now, that we have gjournal in the tree add possibility to configurePawel Jakub Dawidek2006-11-013-8/+49
| | | | | | | | | gmirror and graid3 in a way that it is not resynchronized after a power failure or system crash. It is safe when gjournal is running on top of gmirror/graid3. Notes: svn path=/head/; revision=163888
* Change spaces to tabs where needed.Pawel Jakub Dawidek2006-11-012-24/+24
| | | | Notes: svn path=/head/; revision=163886
* Implement BIO_FLUSH handling by simply passing it down to the components.Pawel Jakub Dawidek2006-10-311-0/+47
| | | | | | | Sponsored by: home.pl Notes: svn path=/head/; revision=163836
* Guard against invalid metadata.Pawel Jakub Dawidek2006-10-101-0/+6
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=163206
* One more white space fix.Pawel Jakub Dawidek2006-09-301-1/+1
| | | | Notes: svn path=/head/; revision=162835
* Remove trailing spaces.Pawel Jakub Dawidek2006-09-301-16/+16
| | | | Notes: svn path=/head/; revision=162832
* Small fixes after adding __printflike() to gctl_error().Pawel Jakub Dawidek2006-09-161-4/+4
| | | | | | | | Approved by: phk MFC after: 3 days Notes: svn path=/head/; revision=162350
* Fix synchronization in gmirror and graid3 which I broken. SynchronizationPawel Jakub Dawidek2006-09-131-2/+5
| | | | | | | | | | | request can still have bio_to set to sc_provider (this is READ part of a synchronization request) and in this case g_{mirror,raid3}_sync() wasn't called as it should be. MFC after: 1 week Notes: svn path=/head/; revision=162282
* move created/detected/activated under debug level 1 to quiet the common case..John-Mark Gurney2006-09-091-5/+7
| | | | | | | | | | | | | add count of active and total components to the launched line so you can see at a glance if your mirror/raid3 is complete... now: GEOM_MIRROR: Device mirror/sam launched (2/2). Reviewed by: pjd Notes: svn path=/head/; revision=162188
* Not only a request from us can be passed to g_{mirror,raid3}_worker()Pawel Jakub Dawidek2006-08-091-5/+11
| | | | | | | | | | function, but also a request to us, in which case checking bio_cflags is wrong, because the class above us is controling it, not we. MFC after: 1 week Notes: svn path=/head/; revision=161116
* Commit the results of the typo hunt by Darren Pilgrim.Yaroslav Tykhiy2006-08-041-1/+1
| | | | | | | | | | | | | This change affects documentation and comments only, no real code involved. PR: misc/101245 Submitted by: Darren Pilgrim <darren pilgrim bitfreak org> Tested by: md5(1) MFC after: 1 week Notes: svn path=/head/; revision=160964
* Don't use f-word in comments. We are gentlemans.Pawel Jakub Dawidek2006-08-011-1/+1
| | | | | | | Pointed out by: Maciej Sobczak Notes: svn path=/head/; revision=160895
* Always allow to specify components with /dev/ prefix.Pawel Jakub Dawidek2006-07-131-0/+4
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=160330
* Use proper defines instead of magic values.Pawel Jakub Dawidek2006-07-101-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=160248