summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sysctl.c
AgeCommit message (Collapse)Author
2013-07-09back out the cache flipper temporarily to work out of tree.Bob Beck
will come back soon. ok deraadt@
2013-06-13beck would prefer to keep things just as they were for a while longer.Ted Unangst
undo style changes.
2013-06-11sprinkle knf fairy dust over new buf codeTed Unangst
2013-06-11High memory page flipping for the buffer cache.Bob Beck
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.
2013-06-09Constify the mib argument of sysctl().Miod Vallat
ok matthew@ millert@
2013-06-03Convert some internal APIs to use timespecs instead of timevalsPhilip Guenther
ok matthew@ deraadt@
2013-04-06rthreads are always enabled. remove the sysctl.Ted Unangst
ok deraadt guenther kettenis matthew
2013-03-23pull the suser check for sysctl pointers up higher, out of the loops.Ted Unangst
hide a few more pointery things. ok deraadt
2013-03-20When non-root asks sysctl for kinfo proc or file requests, do not fill inTheo de Raadt
any kernel addresses information. ok guenther
2013-02-11When information about threads are not requested sum the '%cpu' ofMartin Pieuchot
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@
2013-01-15restrict KERN_PROC_ARGS lookup of KERN_PROC_NENV and KERN_PROC_ENVjoshua stein
to process owner and root ok deraadt millert guenther
2012-12-30In sysctl_proc_cwd(), vref() the target proc's fd_cdir before callingPhilip Guenthe
malloc(), so that it can't exit and be freed if we sleep. (another sparc.p nightmare test case) ok beck@, phessler@
2012-11-05unifdef -D __HAVE_TIMECOUNTERMiod Vallat
2012-08-30Remove a useless test for "elem_count < 0", which can never be trueMatthew Dempsky
because elem_count has an unsigned type (size_t). Noted by Brad/Clang; no binary change on amd64 using GCC either.
2012-06-02Committed the wrong version (an earlier try) of the KERN_FILE2 vsPhilip Guenthe
rthreads fix. Update to the correct one.
2012-05-30Oops, when we moved _POSIX_SAVED_IDS from sys/unistd.h to unistd.h, itMatthew Dempsky
silently changed sysctl kern.saved_ids from returning 1 to 0. ok millert
2012-05-25Change the KERN_FILE_BYPID and KERN_FILE_BYUID modes of the KERN_FILE2Philip Guenthe
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@
2012-05-02Oops, previous change had some unrelated changes that shouldn't have beenPhilip Guenthe
committed; roll them back.
2012-05-01Eliminate the f_usecount ref count in struct file; instead of sleepingPhilip Guenthe
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@
2012-04-17Make it optional for kvm_getprocs() (and related sysctl) to returnPaul Irofti
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@.
2012-04-12Add per thread accounting, mainly for usage & friends.Paul Irofti
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@.
2012-04-10Make the KERN_NPROCS and KERN_MAXPROC sysctl()s and the RLIMIT_NPROC rlimitPhilip Guenthe
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@
2012-03-28The kinfo_file2 structure's f_wbytes member was being filled with thePhilip Guenthe
read byte count instead of the written byte count. pointed out by paulm at tetrardus.net, ok dcoppa@
2012-03-23Make rusage totals, itimers, and profile settings per-process insteadPhilip Guenthe
of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
2012-03-130 is a valid uid for files sysctl, don't skip it. ok guentherTed Unangst
2012-03-10Add PS_EXITING to better differentiate between the process exiting andPhilip Guenthe
the main thread exiting. c.f. regress/sys/kern/main-thread-exited/
2012-02-20First steps for making ptrace work with rthreads:Philip Guenthe
- 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@
2012-02-15Enable rthreads by defaultPhilip Guenthe
ok deraadt@
2012-01-21Make the KERN_FILE2 sysctl() report ENOMEM as documented in sysctl(3).Philip Guenthe
ok millert@
2012-01-07Add rtable id and thread id to struct kinfo_proc (and fix process id)Philip Guenthe
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@
2011-12-14Handle rthreads consistently in ktrace by moving the flags and vnode intoPhilip Guenthe
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@
2011-12-09Add new KERN_PROC_CWD sysctl to get the current working directory of a process.Nicholas Marriott
ok guenther deraadt
2011-09-18Do not use the `hh' modifier in printf format strings, as the kernel printfMiod Vallat
implementation does not support it and handles it as `h'. ok jsing@
2011-09-18Make sysctl__string() handle the truncated output case via twoPhilip Guenthe
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@)
2011-07-05Recommit the reverted sigacts change now that the NFS use-after-freePhilip Guenthe
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@
2011-06-27Make KERN_FILE and KERN_FILE2 behavior consistent: when the caller doesn'tPhilip Guenthe
have the necessary rights, return f_offset=-1 and f_seek=0. ok tedu@, matthew@
2011-06-24machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 andChristian Weisgerber
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@
2011-06-09Don't copy the first octet of the source IPv6 address where the destinationStuart Henderson
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@
2011-04-18Revert the sigacts diff: NFS can apparently retain pointers to processesPhilip Guenthe
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
2011-04-15Correct the sharing of the signal handling state: stuff that shouldPhilip Guenthe
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@
2011-04-04sysctl kern.pool_debug=0 will disable POOL_DEBUG on the fly (still defaultsTheo de Raadt
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
2011-04-02Constrain the buffer cache to use only the dma reachable region of memory.Bob Beck
With this change bufcachepercent will be the percentage of dma reachable memory that the buffer cache will attempt to use. ok deraadt@ thib@ oga@
2011-03-12Replace the old, broken KERN_PROC ABI and its matching functionsPhilip Guenthe
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
2011-02-16allow users to enable access to the /dev/crypto, but keep it turned offMike Belopuhov
by default, adjust comments in sysctl.conf; ok markus, tedu, djm, miod
2010-12-14disable access to the crypto(4) device from userland; ok deraadtMike Belopuhov
2010-11-19Make KERN_CPTIME return an avarage number of ticks across all CPUsMike Belopuhov
tedu agreed with an idea, tested by Luis Useche and me; ok deraadt
2010-11-02export the network livelock counter. part of a diff i committed theDavid Gwynne
userland side of. pointed out by claudio@ after i embarassed myself saying "yes, its there!"
2010-09-23Include the disklabel UID in hw.disknames.Joel Sing
ok deraadt@ krw@
2010-08-19Introduce an MI kern.consdev sysctl that will replace the MDMark Kettenis
machdep.console_device that's only implemented on a few architectures. ok deraadt@, miod@
2010-07-26Correct the links between threads, processes, pgrps, and sessions,Philip Guenthe
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