summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* zero random buf for sysctl too, just in casetedu2014-07-171-1/+2
|
* Introduce PS_NOBROADCASTKILL a process flag that excludes processes fromclaudio2014-07-131-1/+48
| | | | | | | receiving broadcast signals (kill -1). The flag can be set via a new sysctl KERN_PROC_NOBROADCASTKILL. This will be used by iscsid to survive the mass killing by init(8) when terminating multi-user operations. With and OK guenther@
* use mallocarray where arguments are multipled. ok deraadttedu2014-07-131-2/+2
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-10/+10
| | | | after discussions with beck deraadt kettenis.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-2/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* pull the rx ring accounting out of the mbuf layer now that its all donedlg2014-07-081-3/+3
| | | | | | | | | | via if_rxring things. this effectively deprecates the third argument for MCLGETI and m_clget and makes the mbuf layer no longer care about interfaces and simplifies the allocation paths. the timeout used to measure livelock has been moved to net/if.c. ok mpi@
* Track whether a process is a zombie or not yet fully built via flagsguenther2014-07-041-50/+59
| | | | | | | | | | | PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's thread data. This eliminates the need for the thread-level SDEAD state. Change kvm_getprocs() (both the sysctl() and kvm backends) to report the "most active" scheduler state for the process's threads. tweaks kettenis@ feedback and ok matthew@
* Rather than truncating KERN_ARND requests silently, return EINVALderaadt2014-06-141-2/+2
| | | | ok miod
* temporarily (maybe 3 weeks?) crank KERN_ARND maximum buffer from 256deraadt2014-06-141-2/+2
| | | | | to 512, to make it easier for people to build to -current. ok miod
* Add bounds checks for CTL_DEBUG sysctl variable.matthew2014-06-111-1/+3
|
* When looking at another process, use the data from struct processguenther2014-05-171-21/+21
| | | | | | instead of peeking into the thread level ok tedu@
* Add PS_SYSTEM, the process-level mirror of the thread-level P_SYSTEM,guenther2014-05-041-15/+9
| | | | | | | and FORK_SYSTEM as a flag to set them. This eliminates needing to peek into other processes threads in various places. Inspired by NetBSD ok miod@ matthew@
* If P_ZOMBIE(pr->ps_mainproc) is true, then (pr->ps_flags & PS_EXITING)guenther2014-05-031-8/+8
| | | | | | | | is, so eliminate the check of the former and instead use the EINVAL error for the latter. Also, consistently check for PS_EXITING before check creds. suggestion to split this from another diff miod@
* Eliminates struct pcred by moving the real and saved ugids intoguenther2014-03-301-4/+4
| | | | | | | | | struct ucred; struct process then directly links to the ucred Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too. ok matthew@
* Move p_sigacts from struct proc to struct process.guenther2014-03-221-2/+2
| | | | testing help mpi@
* bzero -> memsettedu2014-01-211-6/+6
|
* Threads can't be zombies, only processes, so change zombproc to zombprocess,guenther2014-01-201-48/+51
| | | | | | | | make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes. ok tedu@
* Move p_textvp from struct proc to struct process so that the exit codeguenther2014-01-201-3/+3
| | | | | | can be further simplified. ok kettenis@
* - add UNIX-domain socket info to struct kinfo_file2guenther2013-10-221-76/+27
| | | | | | | | | | - convert netstat from kvm_getfiles() to kvm_getfile2() using that - delete kvm_getfiles() and KERN_FILE as no longer used (bump libkvm's major) - rename kvm_getfile2() to kvm_getfiles(), kinfo_file2 to kinfo_file and KERN_FILE2 to KERN_FILE. ok deraadt@, millert@ ports scan sthen@
* back out the cache flipper temporarily to work out of tree.beck2013-07-091-8/+5
| | | | | will come back soon. ok deraadt@
* beck would prefer to keep things just as they were for a while longer.tedu2013-06-131-5/+5
| | | | undo style changes.
* sprinkle knf fairy dust over new buf codetedu2013-06-111-5/+5
|
* High memory page flipping for the buffer cache.beck2013-06-111-5/+8
| | | | | | | | | | | | | | This change splits the buffer cache free lists into lists of dma reachable buffers and high memory buffers based on the ranges returned by pmemrange. Buffers move from dma to high memory as they age, but are flipped to dma reachable memory if IO is needed to/from and high mem buffer. The total amount of buffers allocated is now bufcachepercent of both the dma and the high memory region. This change allows the use of large buffer caches on amd64 using more than 4 GB of memory ok tedu@ krw@ - testing by many.
* Constify the mib argument of sysctl().miod2013-06-091-2/+2
| | | | ok matthew@ millert@
* Convert some internal APIs to use timespecs instead of timevalsguenther2013-06-031-8/+10
| | | | ok matthew@ deraadt@
* rthreads are always enabled. remove the sysctl.tedu2013-04-061-6/+1
| | | | ok deraadt guenther kettenis matthew
* pull the suser check for sysctl pointers up higher, out of the loops.tedu2013-03-231-8/+18
| | | | | hide a few more pointery things. ok deraadt
* When non-root asks sysctl for kinfo proc or file requests, do not fill inderaadt2013-03-201-15/+31
| | | | | any kernel addresses information. ok guenther
* When information about threads are not requested sum the '%cpu' ofmpi2013-02-111-2/+11
| | | | | | | | | | all threads in a process instead of returning only the '%cpu' for the main thread. This makes top(1) display the correct percentage of CPU usage for threaded processes when theads are not displayed. ok sthen@, mikeb@
* restrict KERN_PROC_ARGS lookup of KERN_PROC_NENV and KERN_PROC_ENVjcs2013-01-151-1/+7
| | | | | | to process owner and root ok deraadt millert guenther
* In sysctl_proc_cwd(), vref() the target proc's fd_cdir before callingguenther2012-12-301-2/+8
| | | | | | | malloc(), so that it can't exit and be freed if we sleep. (another sparc.p nightmare test case) ok beck@, phessler@
* unifdef -D __HAVE_TIMECOUNTERmiod2012-11-051-7/+1
|
* Remove a useless test for "elem_count < 0", which can never be truematthew2012-08-301-2/+2
| | | | | | because elem_count has an unsigned type (size_t). Noted by Brad/Clang; no binary change on amd64 using GCC either.
* Committed the wrong version (an earlier try) of the KERN_FILE2 vsguenther2012-06-021-3/+3
| | | | rthreads fix. Update to the correct one.
* Oops, when we moved _POSIX_SAVED_IDS from sys/unistd.h to unistd.h, itmatthew2012-05-301-5/+1
| | | | | | silently changed sysctl kern.saved_ids from returning 1 to 0. ok millert
* Change the KERN_FILE_BYPID and KERN_FILE_BYUID modes of the KERN_FILE2guenther2012-05-251-5/+11
| | | | | | | | | sysctl() to be per-process instead of per-thread. This means the filedesc table has to really be per-process instead of per-thread, so make it an error for the linux clone() emulation to try to do otherwise. This removes pointless duplication in fstat's output. requested by jsing@ and deraadt@, ok matthew@ deraadt@
* Oops, previous change had some unrelated changes that shouldn't have beenguenther2012-05-021-11/+5
| | | | committed; roll them back.
* Eliminate the f_usecount ref count in struct file; instead of sleepingguenther2012-05-011-6/+12
| | | | | | | | | at the top of closef() until all in-progress calls finish, just do the advisory locking bits required of close() by POSIX and let whichever thread has the last reference do the call to the file's fo_close() method and the final cleanup. lots of discussion with deraadt@ and others; worked out with and ok krw@
* Make it optional for kvm_getprocs() (and related sysctl) to returnpirofti2012-04-171-1/+9
| | | | | | | | | | | | thread information. Add a KERN_PROC_SHOW_THREADS flag that has to be set in order to get the thread info and make it off by default. This creates backwards compatibility for applications that relied on a given size/number of items to be returned. Modify ps(1) and top(1) accordingly. Okay guenther@.
* Add per thread accounting, mainly for usage & friends.pirofti2012-04-121-4/+16
| | | | | | | | | | | | | | This expands the already bloated FILL_KPROC macro to take an extra parameter that indicates if the callee is a thread or a process. The userland bits are adjusted accordingly and ps(1) and top(1) now display per thread usage times when -H is used. Also pkill(1) had to be adjusted so that duplicates don't pop up. libkvm does basically the same thing as the kernel bits. Okay guenther@.
* Make the KERN_NPROCS and KERN_MAXPROC sysctl()s and the RLIMIT_NPROC rlimitguenther2012-04-101-3/+7
| | | | | | | | count processes instead of threads. New sysctl()s KERN_NTHREADS and KERN_MAXTHREAD count and limit threads. The nprocs and maxproc kernel variables are replaced by nprocess, maxprocess, nthreads, and maxthread. ok tedu@ mikeb@
* The kinfo_file2 structure's f_wbytes member was being filled with theguenther2012-03-281-2/+2
| | | | | | read byte count instead of the written byte count. pointed out by paulm at tetrardus.net, ok dcoppa@
* Make rusage totals, itimers, and profile settings per-process insteadguenther2012-03-231-3/+3
| | | | | | | of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
* 0 is a valid uid for files sysctl, don't skip it. ok guenthertedu2012-03-131-2/+2
|
* Add PS_EXITING to better differentiate between the process exiting andguenther2012-03-101-3/+5
| | | | the main thread exiting. c.f. regress/sys/kern/main-thread-exited/
* First steps for making ptrace work with rthreads:guenther2012-02-201-2/+2
| | | | | | | | | | - move the P_TRACED and P_INEXEC flags, and p_oppid, p_ptmask, and p_ptstat member from struct proc to struct process - sort the PT_* requests into those that take a PID vs those that can also take a TID - stub in PT_GET_THREAD_FIRST and PT_GET_THREAD_NEXT ok kettenis@
* Enable rthreads by defaultguenther2012-02-151-2/+2
| | | | ok deraadt@
* Make the KERN_FILE2 sysctl() report ENOMEM as documented in sysctl(3).guenther2012-01-211-1/+3
| | | | ok millert@
* Add rtable id and thread id to struct kinfo_proc (and fix process id)guenther2012-01-071-2/+11
| | | | | | | | | | | and add an 'rtableid' keyword to ps. Add rtable id, thread id, and socket splice info to struct kinfo_file2 and make fstat display socket splice information. Remove old KVM_PROC2 and kinfo_proc2 interfaces; bump libkvm major Socket splice info and corrections from bluhm@ "Lovely" deraadt@
* Handle rthreads consistently in ktrace by moving the flags and vnode intoguenther2011-12-141-5/+5
| | | | | | | | struct process; KTRFAC_ACTIVE becomes P_INKTR. Also, save the credentials used to open the file in sys_ktrace() and use them for all writes to the vnode. much feedback and ok jsing@