summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Added support for non-blocking sockets to sendfile(2).dg1998-11-061-1/+20
|
* Don't put aggregate structs 4K large on the kernel stack, especially whenpeter1998-11-062-46/+60
| | | | | | | | | | we can recurse when loading dependencies and that the kstack is limited to something like 6 or 7KB. Having a single dependency caused an instant double panic, and I stronly suspect some of the other strange "events" that I have seen are possibly as a result of taking a couple of interrupts with a large chunk of the stack already in use. While here, fix a minor logic hiccup in a sanity check.
* Define the kld_debug variable if KLD_DEBUG is enabledpeter1998-11-061-1/+5
|
* put a \n on an error message printfpeter1998-11-061-2/+2
|
* Implemented zero-copy TCP/IP extensions via sendfile(2) - send adg1998-11-055-3/+415
| | | | | | | | | | | file to a stream socket. sendfile(2) is similar to implementations in HP-UX, Linux, and other systems, but the API is more extensive and addresses many of the complaints that the Apache Group and others have had with those other implementations. Thanks to Marc Slemko of the Apache Group for helping me work out the best API for this. Anyway, this has the "net" result of speeding up sends of files over TCP/IP sockets by about 10X (that is to say, uses 1/10th of the CPU cycles) when compared to a traditional read/write loop.
* Fix sbcheck() to check all packets on socket buffer.fenner1998-11-042-18/+22
| | | | | | | | | | Also fix data types and printf formats while I'm here. PR: misc/8494 Panic instead of looping forever in sbflush(). If sb_mbcnt counts more mbufs than sb_cc counts bytes, the original code can turn into an infinite loop of removing 0 bytes from the socket buffer until it's empty.
* The handle for the kernel is common. With this fix, ELF kernels can loadpeter1998-11-044-33/+17
| | | | a.out kld modules, and a.out kernels can load ELF kld modules.
* General tidy up: remove more unused code, update comments, simplify somepeter1998-11-041-34/+16
| | | | routines a little.
* make mount(2) automatically kldload modules if the requested filesystempeter1998-11-032-6/+64
| | | | isn't present.
* Have the in-kernel linker try a default extension of .ko. This means thatpeter1998-11-031-3/+30
| | | | | "kldload nfs" works. We use the same default extension in the /boot/loader system.
* Initialize the a.out kld loader after elf, so that elf gets first shot atpeter1998-11-031-2/+2
| | | | a kldload attempt.
* Use the kvm space pathname that we copied in, not the one in user space.peter1998-11-031-2/+2
|
* Change the #ifdef UNION code into a callable hook. Arrange to have thispeter1998-11-032-228/+30
| | | | set up when unionfs is present, either statically or as a kld module.
* Only do one VOP_ACCESS() per open() instead of two. This should reducepeter1998-11-021-8/+9
| | | | | | | | | | | the NFSv3 ACCESS RPC problems a little for busy clients that do a lot of open/close. The nfs code could probably cache the results, but I'm not sure whether this would be legal or useful. The problem is that with a CPU farm, on each open there would be a lookup, getattr then access RPC then the read/write RPC activity. Caching the access results probably isn't going to help much if the clients access lots of files. Having the nfs_access() routine interpret the getattr results is a bit of a hack, but it's how NFSv2 is done and it might be OK for a mount attribute for v3.
* Use TAILQ macros for clean/dirty block list processing. Set b_xflagspeter1998-10-311-3/+3
| | | | rather than abusing the list next pointer with a magic number.
* Convert lists for bufs attached to vnodes from a LIST to a TAILQ.peter1998-10-312-102/+116
| | | | | | | | | | | | | | | | | | | | | | - Use TAILQ_* macros extensively instead of internal names - use b_xflags instead of the NOLIST magic number hack in the next pointer - clean bufs are inserted at the tail rather than the head. - redo dirty buffer insert so that metadata (negative lbn) goes to the tail directly rather than at the HEAD. This makes a difference when inserting dirty data blocks in lbn sorted order since data block insertion will not have to bypass all the metadata cruft. data is lbn sorted since it makes sense for clustering and writeback ordering, while metadata sorting doesn't help much since the lbn's are meaningless when walking the list for writebacks. Small systems will not notice much (if any) benefit from this, but really busy systems with large dirty block lists should get a lot more. I've tested this with softdep, and it doesn't seem to mind the change of queueing of metadata. Reviewed (in princible) by: dg Obtained from: partly from John Dyson's work-in-progress patches in June.
* The last argument to vm_object_page_clean() are now bit flags, rather thanpeter1998-10-314-8/+8
| | | | | | | | | | | | the old true/false. While here, have vfs_msync() only call vm_object_page_clean() with OBJPC_SYNC if called with MNT_WAIT flags. vfs_msync() is called at unmount time (with MNT_WAIT) and from the syncer process (formerly update). This should make dirty mmap writebacks a little less nasty. I have tested this a little with SOFTUPDATES enabled, but I don't normally use it since I've been badly burned too many times.
* Unwire everything to the inactive queue in order to preserve LRU ordering.dg1998-10-301-37/+12
|
* Add the ability to specify where on the at_shutdown queue a handler ismsmith1998-10-301-5/+33
| | | | | | | | | installed. Remove cpu_power_down, and replace it with an entry at the end of the SHUTDOWN_FINAL queue in the only place it's used (APM). Submitted by: Some ideas from Bruce Walter <walter@fortean.com>
* Oops, rev.1.167 made the device number checking in bdevvp() too strictbde1998-10-292-6/+8
| | | | for mfs root mounts. Don't require major 255 to be in bdevsw[].
* Fixed editing error. Pointed out by bde.dg1998-10-291-2/+1
|
* Remove the V_SAVEMETA flag, nothing uses it any more now that msdosfs andpeter1998-10-292-36/+14
| | | | | ext2fs call vtruncbuf() directly. This simplifies and cleans up vinvalbuf() a little.
* A Perl5 version of makedevops.sh. Fixes a bug in the sh/awk versionwollman1998-10-291-0/+221
| | | | | which really annoyed me at the time but I don't think bites me any more.
* The new resource manager, hopefully in a reasonably stable form.wollman1998-10-291-0/+589
|
* Added a second argument, "activate" to the vm_page_unwire() call so thatdg1998-10-283-13/+11
| | | | the caller can select either inactive or active queue to put the page on.
* Lots of debugging code and some bugfixes.dfr1998-10-271-25/+338
| | | | Submitted by: Nick Hibma <nick.hibma@jrc.it>
* Updated the major number check in vfs_object_create(). It's notbde1998-10-262-4/+6
| | | | | | clear if the check is necessary, but vfs_object_create() is called for all vnodes and it was silly to create objects for VBLK vnodes that don't even have a driver.
* Fixed breakage of the GPROF case of statclock() in the previous commit.bde1998-10-262-2/+4
|
* Oops, back out some local changes that shouldn't have been in thebde1998-10-251-5/+5
| | | | previous commit.
* Fixed breakage of the !SMP case of roundrobin() in the previous commit.bde1998-10-251-5/+8
|
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-2521-134/+43
| | | | about unused variables, labels and other lint.
* Fixed device number checking in bdevvp():bde1998-10-252-12/+20
| | | | | | | | | | | | | | | - dev != NODEV was checked for, but 0 was returned on failure. This was fixed in Lite2 (except the return code was still slightly wrong (ENODEV instead of ENXIO)) but the changes were not merged. This case probably doesn't actually occur under FreeBSD. - major(dev) was not checked to have a valid non-NULL bdevsw entry. This caused panics when the driver for the root device didn't exist. Fixed minor misformattings in bdevvp(). Rev.1.14 consisted mainly of gratuitous reformattings that seem to have caused many Lite2 merge errors. PR: 8417
* Fixed sysctl attachment for statically configured vfs's.bde1998-10-251-16/+25
| | | | Broken in: previous commit
* Don't put 0x in front of %p, it does it already.msmith1998-10-241-4/+4
| | | | Submitted by: Brian Feldman <green@janus.syracuse.net>
* Change the way we simulate stable storage for timecounters.phk1998-10-232-114/+104
| | | | | | If you have problems with the "calcru" messages and processes being killed for excessive cpu time, try to increase the NTIMECOUNTER #define and report your findings.
* Eliminate a superfluous comment.jdp1998-10-211-5/+1
|
* Some cleanups and optimizations:peter1998-10-181-163/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Use the system headers method for Elf32/Elf64 symbol compatability - get rid of the UPRINTF debugging. - check the ELF header for compatability much more completely - optimize the section mapper. Use the same direct VM interfaces that imgact_aout.c and kern_exec.c use. - Check the return codes from the vm_* functions better. Some return KERN_* results, not an errno. - prefault the page tables to reduce startup faults on page tables like a.out does. - reset the segment protection to zero for each loop, otherwise each segment could get progressively more privs. (eg: if the first was read/write/execute, and the second was meant to be read/execute, the bug would make the second r/w/x too. In practice this was not a problem because executables are normally laid out with text first.) - Don't impose arbitary limits. Use the limits on headers imposed by the need to fit them into one page. - Remove unused switch() cases now that the verbose debugging is gone. I've been using an earlier version of this for a month or so. This sped up ELF exec speed a bit for me but I found it hard to get consistant benchmarks when I tested it last (a few weeks ago). I'm still bothered by the page read out of order caused by the transition from data to bss. This which requires either part filling the transition page or clearing the remainder.
* Overload the correct errno for attempts to set an in-core label withbde1998-10-171-2/+2
| | | | | | | | | | | | | | | a raw partition at a nonzero offset (EINVAL should have been EXDEV; DIOCSDINFO was broken, and DIOCWDINFO was broken because it depended on DIOCSDINFO). A zero offset for the raw partition should probably be enforced in setdisklabel(), and DIOCWDINFO should probably always be handled by first calling setdisklabel() so that writedisklabel() doesn't need to enforce it, but this has never been done; dsioctl() has a special check. Changes in this commit are limited to dsioctl() to preserve bug for bug compatibility in drivers that don't use the slice code (notably the ccd driver, which allows setting a bogus label in DIOCWDINFO and doesn't undo the setting when writedisklabel() fails).
* Use only the correct raw partition for writing labels. Don't use thebde1998-10-171-9/+4
| | | | | | | | | | | | | | | | | | | | | partition that the label ioctl is being done on just because it has offset 0, since there is no guarantee that such a partition is large enough to contain the label. Don't use the wrong raw partition (0 instead of RAW_PART). This fixes problems rewriting bizarre labels (with a nonzero offset for the 'a' partition) in newfs(8). Such labels shouldn't normally be used, but creating them was allowed if the ioctl was done on the raw partition, and sysinstall creates them if the root partition isn't allocated first. Note that allowing write access to a partition other than the one that has been checked for write access doesn't increase security holes significantly, since write access to any partition already allows changing the in-core label. This fix should be in 3.0R. Rev.1.26 of newfs/newfs.c shouldn't be in 3.0R.
* fixup for alpha.jkh1998-10-161-1/+4
|
* *gulp*. Jordan specifically OK'ed this..peter1998-10-1611-191/+367
| | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's.
* Fix some bugs in link_aout.c caused by using uninitialized malloc space.peter1998-10-161-1/+4
| | | | Pre-Approved by: jkh
* - bzero() after malloc() bug fixpeter1998-10-152-12/+14
| | | | | - look up relocation symbol names in correct table bugfix. - remove unused (initialized to 0) variable and conditional free() of it.
* - bzero() after malloc(). This is especially obvious when kern_malloc ispeter1998-10-151-3/+5
| | | | | compiled with DIAGNOSTIC. - Don't break from the preload module processing loop prematurely.
* Fix sysinit_add().peter1998-10-151-13/+17
| | | | | - Don't include multiple copies of the previous sysinit in the new one. - Leave space for and explicitly null terminate the new list.
* Don't frob the user stack directly, use suword instead. This fixes thedfr1998-10-151-2/+2
| | | | elf_freebsd_fixup() panic which many people have noticed on the alpha.
* Use the interface name as well as the method name when creating the methoddfr1998-10-151-2/+2
| | | | | | description. Submitted by: Nick Hibma <nick.hibma@jrc.it>
* Disable the 'devstat_end_transaction' busy count printf until after 3.0ken1998-10-141-2/+10
| | | | | | | | | | release goes out the door. We know there's a bug in the devstat implementation in the wd driver, but bde and msmith haven't been able to fix it yet. So, disable the printf to avoid confusing/worrying people. Suggested by: msmith
* Backed out rev. 1.164. It caused problems on SMP.dt1998-10-142-26/+2
| | | | PR: 8309
* Align to sizeof(long) rather than sizeof(int32_t). It needs to bepeter1998-10-141-8/+8
| | | | | long because this code is shared with the alpha. I hope the alpha can read 32 bit ints at 32 bit alignment (vs. 64 bit alignment).
OpenPOWER on IntegriCloud