summaryrefslogtreecommitdiffstats
path: root/sys/kern/sysv_shm.c
Commit message (Collapse)AuthorAgeFilesLines
* This is a cleanup patch to Peter's new OBJT_PHYS VM object typedillon2000-05-291-7/+10
| | | | | | | | | | | | | | | | | and sysv shared memory support for it. It implements a new PG_UNMANAGED flag that has slightly different characteristics from PG_FICTICIOUS. A new sysctl, kern.ipc.shm_use_phys has been added to enable the use of physically-backed sysv shared memory rather then swap-backed. Physically backed shm segments are not tracked with PV entries, allowing programs which use a large shm segment as a rendezvous point to operate without eating an insane amount of KVM in the PV entry management. Read: Oracle. Peter's OBJT_PHYS object will also allow us to eventually implement page-table sharing and/or 4MB physical page support for such segments. We're half way there.
* Provide a temporary undocumented option: SHM_PHYS_BACKED. This willpeter2000-05-211-0/+5
| | | | | become sysctl and/or flags controlled later. It's mainly here for an easy place to test the physical memory backed objects.
* Make sysv-style shared memory tuneable params fully runtime adjustablepeter2000-03-301-23/+81
| | | | | | | | via sysctl. It's done pretty simply but it should be quite adequate. Also move SHMMAXPGS from $machine/include/vmparam.h as the comments that went with it were wrong... we don't allocate KVM space for the pages so that comment is bogus.. The only practical limit is how much physical ram you want to lock up as this stuff isn't paged out or swap backed.
* shmat: If VM_PROT_READ_IS_EXEC is defined and prot includes VM_PROT_READ,alc2000-03-101-0/+4
| | | | | | | | | | | VM_PROT_EXECUTE must be added to prot before calling vm_map_find. Without this change, an mprotect on a shmat'ed region fails (when it shouldn't). This bug was reported Feb 28 by Brooks Davis <brooks@one-eyed-alien.net> on -hackers. Reviewed by: bde Approved by: jkh
* useracc() the prequel:phk1999-10-291-2/+0
| | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* For consistency with other implementations, check for the existencealc1999-06-191-3/+3
| | | | | | | of the segment before checking its permissions. PR: kern/11999 Submitted by: Brooks Davis <brooks@one-eyed-alien.net>
* Change suser_xxx() to suser() where it applies.phk1999-04-271-11/+7
|
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-1/+2
| | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
* Fixed two potentially serious classes of bugs:dg1998-10-131-4/+3
| | | | | | | | | | | | | | | | 1) The vnode pager wasn't properly tracking the file size due to "size" being page rounded in some cases and not in others. This sometimes resulted in corrupted files. First noticed by Terry Lambert. Fixed by changing the "size" pager_alloc parameter to be a 64bit byte value (as opposed to a 32bit page index) and changing the pagers and their callers to deal with this properly. 2) Fixed a bogus type cast in round_page() and trunc_page() that caused some 64bit offsets and sizes to be scrambled. Removing the cast required adding casts at a few dozen callers. There may be problems with other bogus casts in close-by macros. A quick check seemed to indicate that those were okay, however.
* Change various syscalls to use size_t arguments instead of u_int.dfr1998-08-241-3/+3
| | | | | | | | | | Add some overflow checks to read/write (from bde). Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags and vm_object::paging_in_progress to use operations which are not interruptable. Reviewed by: Bruce Evans <bde@zeta.org.au>
* Fix the shm panic. I mistakenly used the shadow_count to keep the objectdyson1998-05-041-3/+2
| | | | from being split, and instead added an OBJ_NOSPLIT.
* Work around some VM bugs, the worst being an overly aggressivedyson1998-05-041-1/+5
| | | | | swap space free calculation. More complete fixes will be forthcoming, in a week.
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Staticize.eivind1998-02-091-2/+2
|
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+2
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-31/+23
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-2/+2
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Removed unused #includes.bde1997-08-021-4/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-1/+1
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Make DFLDSIZ and MAXDSIZ fully-supported options.joerg1996-12-221-1/+2
| | | | "Don't forget to do a ``make depend''" :-)
* Fix a problem with child inheritance of sysv shm. Problem broughtdyson1996-09-101-0/+4
| | | | to my attention by Brad Lineberger <bil@mpgn.com> and Rob Miracle.
* Make sure that the pager is allocated before it is needed. Hangsdyson1996-09-101-2/+8
| | | | can occur if the pager is not allocated in time.
* Corrected an error where precious kernel virtual space was being allocateddyson1996-09-071-26/+21
| | | | | | for entire SYS5 SHM segments. This is totally unnecessary, and so the correct allocation of VM objects has been substituted. (The vm_mmap was misused -- vm_object_allocate is more appropriate.)
* uninitialized auto variable shmseg is used in ...joerg1996-05-051-2/+2
| | | | | | Closes PR #kern/1174 Submitted by: enami@ba2.so-net.or.jp
* Another sweep over the pmap/vm macros, this time with more focus onphk1996-05-031-5/+5
| | | | | the usage. I'm not satisfied with the naming, but now at least there is less bogus stuff around.
* removed:phk1996-05-021-6/+6
| | | | | | | | | CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei() ptei() kvtopte() ptetov() ispt() ptetoav() &c &c new: NPDEPG Major macro cleanup.
* kern_descrip.c: add fdshare()/fdcopy()peter1996-02-231-3/+2
| | | | | | | | | | | | | | | | | | | | kern_fork.c: add the tiny bit of code for rfork operation. kern/sysv_*: shmfork() takes one less arg, it was never used. sys/shm.h: drop "isvfork" arg from shmfork() prototype sys/param.h: declare rfork args.. (this is where OpenBSD put it..) sys/filedesc.h: protos for fdshare/fdcopy. vm/vm_mmap.c: add minherit code, add rounding to mmap() type args where it makes sense. vm/*: drop unused isvfork arg. Note: this rfork() implementation copies the address space mappings, it does not connect the mappings together. ie: once the two processes have split, the pages may be shared, but the address space is not. If one does a mmap() etc, it does not appear in the other. This makes it not useful for pthreads, but it is useful in it's own right for having light-weight threads in a static shared address space. Obtained from: Original by Ron Minnich, extended by OpenBSD
* Somehow managed to miss these four files when converting the SYSV IPCwollman1996-01-051-1/+3
| | | | options over to the new style.
* I report a problem about shmget(). (I'm using FreeBSD-2.1.0R)joerg1995-12-261-2/+2
| | | | | | | | | int shmget(key_t key, int size, int shmflg); If the 'key' has already existed in the system and set 'shmflg' as '(IPC_CREAT|IPC_EXC)', then shmget() must return the error 'EEXIST'. Submitted by: m_tanaka@pa.yokogawa.co.jp (Mihoko Tanaka)
* Update sysv_*.c to get their argument definitions from sysproto.hpeter1995-12-151-4/+18
|
* A Major staticize sweep. Generates a couple of warnings that I'll dealphk1995-12-141-5/+5
| | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+6
|
* Close PR: kern/865jkh1995-12-041-1/+3
| | | | Submitted by: Juergen Lock <nox@jelal.hb.north.de>
* Submitted by: jb@cimlogic.com.au (John Birrell)julian1995-11-301-2/+2
| | | | | | | Obtained from: NetBSD as well (He submitted it there too) make sure that teh shm region is beyond the sum of the text and data segs as it was big progs could collide with the shm region.
* Start including <sys/sysproto.h> to get the correct args structs andbde1995-10-211-17/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prototypes for all syscalls. The args structs are still declared in comments as in VOP implementation functions. I don't like the duplication for this, but several more layers of changes are required to get it right. First we need to catch up with 4.4lite2, which uses macros to handle struct padding. Then we need to catch up with NetBSD, which passes the args correctly (as void *). Then we need to handle varargs functions and struct padding better. I think all the details can be hidden in machine-generated functions so that the args structs and verbose macros to reference them don't have to appear in the core sources. Add prototypes. Add bogus casts to hide the evil type puns exposed by the previous steps. &uap[1] was used to get at the args after the first. This worked because only the first arg in *uap was declared. This broke when the machine- genenerated args struct declared all the args (actually it declares extra args in some cases and depends on the user stack having some accessible junk after the last arg, not to mention the user args being on the stack. It isn't possible to declare a correct args struct for a varargs syscall). The msgsys(), semsys() and shmsys() syscall interfaces are BAD because they multiplex several syscalls that have different types of args. There was no reason to duplicate this sysv braindamage but now we're stuck with it. NetBSD has reimplemented the syscalls properly as separate syscalls #220-231. Declare static functions as static in both their prototype and their implementation (the latter is optional, and this misfeature was used). Remove gratuitous #includes. Continue cleaning up new init stuff.
* Fixed init functions argument type - caddr_t -> void *. Fixed a couple ofdg1995-09-091-3/+3
| | | | compiler warnings.
* Fix several sysinit functions that had the wrong type and unnecessarilybde1995-08-301-20/+4
| | | | | | | | | external linkage. Remove useless comments saying that SYSINIT() does system initialization. shm.c: Remove nearly useless comment that gave wrong pseudo-prototypes.
* Reviewed by: julian with quick glances by bruce and othersjulian1995-08-281-1/+8
| | | | | | | | | | | | | | | | | | | | | | Submitted by: terry (terry lambert) This is a composite of 3 patch sets submitted by terry. they are: New low-level init code that supports loadbal modules better some cleanups in the namei code to help terry in 16-bit character support some changes to the mount-root code to make it a little more modular.. NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able to test those cases.. certainly mounting root of disk still works just fine.. mfs should work but is untested. (tomorrows task) The low level init stuff includes a total rewrite of init_main.c to make it possible for new modules to have an init phase by simply adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can be added to the kernel without editing any other files other than the 'files' file.
* Eliminate sloppy common-style declarations. There should be none left forbde1995-07-291-1/+2
| | | | the LINT configuation.
* Remove trailing whitespace.rgrimes1995-05-301-7/+7
|
* Use of vm_allocate() and vm_deallocate() has been deprecated.dg1995-02-201-3/+3
|
* All of this is cosmetic. prototypes, #includes, printfs and so on. Makesphk1994-10-021-17/+24
| | | | GCC a lot more silent.
* Added code for FreeBSD-1.1.5 backwards compatibility.dfr1994-09-161-3/+62
|
* Added SYSV ipcs.dfr1994-09-131-0/+517
Obtained from: NetBSD and FreeBSD-1.1.5
OpenPOWER on IntegriCloud