summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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@
* Add new KERN_PROC_CWD sysctl to get the current working directory of a process.nicm2011-12-091-1/+67
| | | | ok guenther deraadt
* Do not use the `hh' modifier in printf format strings, as the kernel printfmiod2011-09-181-3/+3
| | | | | implementation does not support it and handles it as `h'. ok jsing@
* Make sysctl__string() handle the truncated output case via twoguenther2011-09-181-8/+6
| | | | | | | copyout()s instead of altering the in-use variable, and to also return the full length via oldlenp in that case as documented. ok jsing@ (problem pointed out by matthew@)
* Recommit the reverted sigacts change now that the NFS use-after-freeguenther2011-07-051-2/+3
| | | | | | | | problem has been tracked down. This fixes the sharing of the signal handling state: shared bits go in sigacts, per-rthread bits goes in struct proc. ok deraadt@
* Make KERN_FILE and KERN_FILE2 behavior consistent: when the caller doesn'tguenther2011-06-271-3/+5
| | | | | | have the necessary rights, return f_offset=-1 and f_seek=0. ok tedu@, matthew@
* machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 andnaddy2011-06-241-1/+8
| | | | | | | | | | | | | | | i386. Stop abusing it on other archs for controling a shutdown by pressing the soft power button: * Add a MI sysctl hw.allowpowerdown; if set to 1 (the default) it allows a power button shutdown. * Make acpi(4)/acpibtn(4) honor hw.allowpowerdown. * Switch the various power button intercepts on landisk, sgi, sparc64 and zaurus over to hw.allowpowerdown. * Garbage collect the machdep.kbdreset sysctl on all archs other than amd64 and i386. ok miod@
* Don't copy the first octet of the source IPv6 address where the destinationsthen2011-06-091-2/+2
| | | | | | | address should be, fixes broken fstat output for v6 socket connections. Problem noticed by dhill@, ok todd@, "i have no idea what that diff is touching, but it sure looks ok" halex@
* Revert the sigacts diff: NFS can apparently retain pointers to processesguenther2011-04-181-3/+2
| | | | | | until they're zombies and then send them signals (for intr mounts). Until that is untangled, the sigacts change is unsafe. sthen@ was the victim for this one
* Correct the sharing of the signal handling state: stuff that shouldguenther2011-04-151-2/+3
| | | | | | | | | | | | be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves to struct sigacts, wihle stuff that should be per rthread (ps_oldmask, SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread until our locking around coredumping is better. Oh, and remove the old SunOS-compat ps_usertramp member. "I like the sound of this" tedu@
* sysctl kern.pool_debug=0 will disable POOL_DEBUG on the fly (still defaultsderaadt2011-04-041-1/+11
| | | | | | | | | to on, if POOL_DEBUG is compiled in, so that boot-time pool corruption can be found. When the sysctl is turned off, performance is almost as as good as compiling with POOL_DEBUG compiled out. Not all pool page headers can be purged of the magic checks. performance tests by henning ok ariane kettenis mikeb
* Constrain the buffer cache to use only the dma reachable region of memory.beck2011-04-021-2/+4
| | | | | | With this change bufcachepercent will be the percentage of dma reachable memory that the buffer cache will attempt to use. ok deraadt@ thib@ oga@
* Replace the old, broken KERN_PROC ABI and its matching functionsguenther2011-03-121-125/+34
| | | | | | | | | in libkvm with the stable-ABI versions that are currently named KERN_PROC2, kvm_get{proc,argv,envv}2(). The latter names and symbols will continue to be supported for a few releases. Committing now that they ports people have had a couple releases to update pkgs that usd the old functions
* allow users to enable access to the /dev/crypto, but keep it turned offmikeb2011-02-161-7/+1
| | | | by default, adjust comments in sysctl.conf; ok markus, tedu, djm, miod
* disable access to the crypto(4) device from userland; ok deraadtmikeb2010-12-141-1/+7
|
* Make KERN_CPTIME return an avarage number of ticks across all CPUsmikeb2010-11-191-1/+4
| | | | tedu agreed with an idea, tested by Luis Useche and me; ok deraadt
* export the network livelock counter. part of a diff i committed thedlg2010-11-021-1/+4
| | | | | | userland side of. pointed out by claudio@ after i embarassed myself saying "yes, its there!"
* Include the disklabel UID in hw.disknames.jsing2010-09-231-5/+21
| | | | ok deraadt@ krw@
* Introduce an MI kern.consdev sysctl that will replace the MDkettenis2010-08-191-1/+10
| | | | | | machdep.console_device that's only implemented on a few architectures. ok deraadt@, miod@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-22/+26
| | | | | | | | | so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
* Rollback the allproclk and fileheadlk addition. When grabbing anguenther2010-07-191-26/+5
| | | | | | | | rwlock, the thread will release biglock if it sleeps, means that atomicity from before the rw_enter() to after it is not guaranteed. The change didn't address those, so pulling it until it does. "go for it" tedu@