summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sysctl.c
AgeCommit message (Collapse)Author
2007-06-01decouple the allocated number of vnodes from the "desiredvnodes" variableBob Beck
which is used to size a zillion other things that increasing excessively has been shown to cause problems - so that we may incrementally look at increasing those other things without making the kernel unusable. This diff effectivly increases the number of vnodes back to the number of buffers, as in the earlier dynamic buffer cache commits, without increasing anything else (namecache, softdeps, etc. etc.) ok pedro@ tedu@ art@ thib@
2007-05-29Add a name argument to the RWLOCK_INITIALIZER macro.Thordur I. Bjornsson
Pick reasonble names for the locks involved.. ok tedu@, art@
2007-05-16The world of __HAVEs and __HAVE_NOTs is reducing. All architecturesArtur Grabowski
have cpu_info now, so kill the option. eyeballed by jsg@ and grange@
2007-04-18When vslocking memory for the sysctl make sure that we aren't tryingArtur Grabowski
to wire more memory than we are allowed to. miod@ ok
2007-04-12move p_limit and p_cred into struct processTed Unangst
leave macros behind for now to keep the commit small ok art beck miod pedro
2007-03-22split userland & kernel struct sensor/sensordev so that the additionTheo de Raadt
of new fields in the future is less disruptive. This is done similar to how struct proc is handled for ps(1). ok jmc (man page changes) tested fkr simon, and more suggestions from millert
2007-02-20for sensors do not leak kernel pointers when copying out to userland;Theo de Raadt
spotted by art, ok dlg art
2007-01-12Switch some lockmgr locks to rwlocks.Artur Grabowski
In this commit: - gdt lock on amd64 - sysctl lock - malloc sysctl lock - disk sysctl lock - swap syscall lock miod@, pedro@ ok (and "looks good" others@)
2006-12-23kernel code implimemting the new two-level sensor api; written byTheo de Raadt
Constantine A. Murenin
2006-12-12Complete gwk's previous patch to stop setperf methods from returningDimitry Andric
errors to userland: make all cpu_setperf functions return void. Tested by many, ok gwk@
2006-12-08A more permanent solution to setperf methods returning error values andGordon Willem Klok
the higher level sysctl code passing them to userland. Distinct diff from the one I passed around internally with less crazy semantics. Also nuke some trailing spaces in a few places. "just go ahead" deraadt@
2006-11-29Kernel stack can be swapped. This means that stuff that's on the stackMiod Vallat
should never be referenced outside the context of the process to which this stack belongs unless we do the PHOLD/PRELE dance. Loads of code doesn't follow the rules here. Instead of trying to track down all offenders and fix this hairy situation, it makes much more sense to not swap kernel stacks. From art@, tested by many some time ago.
2006-05-28back out my last commit. art pointed out that sysctl cannot sleep whenDavid Gwynne
copying out to userland, so my fix was useless bloat that didnt really do anything. the problem instead appears to be a use after free in a driver rather than bad interactions with sysctl.
2006-05-20It is possible for a sensor to be detached and freed while it is beingDavid Gwynne
copied out to userland. If this happens we get a use after free and things blow up. Prevent this by making a local copy of the sensor that cannot be freed elsewhere in the kernel and copying that out instead. found by mbalmer@ ok deraadt@ krw@
2006-05-08Add smbios support for i386 and amd64, fix ipmi to use this new functionallity,Gordon Willem Klok
hook up some sysctls to add system vendor/product/version and UUID reporting. "get it in" deraadt@
2006-03-15add sysctl_int_lower(). This can read, but can only write to a kernelTheo de Raadt
variable if the result is a lowering of the value; tested matthieu
2006-01-28get rid of the sensors globals. theyre were only used by sysctl forDavid Gwynne
locating and finding the correct sensor to spit out. instead provide a a sensor_get function that wraps up the access to the vars. theyre now safe inside kern_sensors.c. theres also a touch of whitespace tweaking ok grange@
2006-01-19Replace SENSOR_ADD() macro with a pair of functionsAlexander Yurchenko
sensor_add()/sensor_del() so that sensors can be attached and detached dynamicaly. ok kettenis@ deraadt@ dlg@
2005-11-28ansi/deregister.Jonathan Gray
'go for it' deraadt@
2005-11-21rename the sensor globals to names that are not obvious to avoidDavid Gwynne
collisions with local variable names someone might make. this has bitten me twice now and caused me to lose about 4 hours scratching my head when nsensors just magically corrupts and gets bigger. at least my ram isnt screwed. ok marco@
2005-11-19Remove unnecessary lockmgr() archaism that was costing too much in termsPedro Martelletto
of panics and bugfixes. Access curproc directly, do not expect a process pointer as an argument. Should fix many "process context required" bugs. Incentive and okay millert@, okay marc@. Various testing, thanks.
2005-11-10split the sensors stuff out into a source file of its own.David Gwynne
tested on GENERIC and RAMDISK_CD to see if the small_kernel stuff stays happy
2005-11-04Add an extra flags argument to uvm_io(), to specify whether we want to fixMiod Vallat
the protection of the memory mapping we're doing I/O on, or if we want to leave them as they are. This should only be necessary for breakpoint insertion in code, so we'll only use it for ptrace requests. Initially from art@ after discussion with kettenis@ millert@ and I, tested by many.
2005-09-25Turn CPU_INFO_FOREACH into a real construct, like all queue(3) iterators,Miod Vallat
instead of the contents of a for() loop. No functional change. From the m88k SMP tree; ok art@ deraadt@ [complete diff this time]
2005-09-20unbreak tree, how did you do that miodTheo de Raadt
2005-09-20Turn CPU_INFO_FOREACH into a real construct, like all queue(3) iterators,Miod Vallat
instead of the contents of a for() loop. No functional change. From the m88k SMP tree; ok art@ deraadt@
2005-07-31do not allocate huge kinfo_proc2 and eproc structures on the stack.Theo de Raadt
allocate them on startup if needed, and free them when done. discussion with pascoe, tested by dlg
2005-06-08Add KERN_CPTIME2 on systems where __HAVE_CPUINFO is defined, exposesTodd C. Miller
spc_cp_time member of struct schedstate_percpu (per-cpu stats). From art@ during the hackathon.
2005-06-04let the arc4random sysctl write out up to 256 bytes at once.Ted Unangst
ok + input deraadt miod
2005-05-24add a new field to vm_space and use it to track the number of anonTed Unangst
pages a process uses. this is now the userland "data size" value. ok art deraadt tdeval. thanks testers.
2005-03-10split out uidinfo from kern_proc.c private, use it to store lock count,Ted Unangst
restrict lock count per uid to a global limit, add sysctl to adjust limit. this prevents a user from creating too many locks. problem noticed by devon o'dell. ok deraadt miod pedro
2004-12-24Do not provide the KERN_EMUL, KERN_EVCOUNT, KERN_INTRCNT, KERN_PROC* andMiod Vallat
HW_SENSORS sysctl trees if option SMALL_KERNEL. ok deraadt@
2004-11-26Kill __HAVE_EVCOUNT, now that all architectures provide them.Miod Vallat
2004-10-14a more reasonable limit for the stackgap_random; found by openbsd@hunger.huMichael Shalayeff
2004-09-23change KERN_INTRCNT_CNT to return a quad; ok teduTheo de Raadt
2004-09-15Check for num < 0 in sysctl_sensors(); from Patrick Latifi.Alexander Yurchenko
ok millert@
2004-07-28This touches only MI code, and adds new time keeping code. TheThorsten Lockert
code is all conditionalized on __HAVE_TIMECOUNTER, and not enabled on any platforms. adjtime(2) support exists, courtesy of nordin@, sysctl(2) support and a concept of quality for each time source attached exists. High quality time sources exists for PIIX4 ACPI timer as well as some AMD power management chips. This will have to be redone once we actually add ACPI support (at that time we need to use the ACPI interfaces to get at these clocks). ok art@ ken@ miod@ jmc@ and many more
2004-06-28Add new, generic ``evcount'' event counter API to the kernel. From art@,Aaron Campbell
with modifications from me. Includes code for generic interrupt counter fetching via sysctl. deraadt@ tholo@ drahn@ millert@ ok
2004-06-25Instead of accessing ci_dev (that's an MI field), provide a marco thatArtur Grabowski
translates a cpu_info structure into a human-readable cpu number. drahn@ deraadt@ ok
2004-06-24Remove the 8 page limit for sysctl_proc_args after discussing with Theo.Todd C. Miller
Add trivial support for passing a NULL pointer for the argv buffer; currently just returns ARG_MAX for KERN_PROC_ARGV and KERN_PROC_ENV.
2004-06-20Another merge error from smp branch.Artur Grabowski
Found by otto@drijf.net deraadt@ ok
2004-06-16export cpu# instead of apid#; art okTheo de Raadt
2004-06-13debranch SMP, have funNiklas Hallqvist
2004-06-09Merge in a piece of the SMP branch into HEAD.Artur Grabowski
Introduce the cpu_info structure, p_cpu field in struct proc and global scheduling context and various changed code to deal with this. At the moment no architecture uses this stuff yet, but it will allow us slow and controlled migration to the new APIs. All new code is ifdef:ed out. ok deraadt@ niklas@
2004-06-08pull ncpus support from smp tree into main branch.Marco S Hyman
remove alpha specific definition of ncpus. OK (and tested on alpha) deraadt@
2004-05-27apm restores perflevel after resume; some cpus are forgetful.Ted Unangst
update cpu even with 100 -> 100 setperf changes, in case saved value has gotten out of sync. from grange@ ok deraadt@ grange@
2004-05-23bad stuff escaped by accidentTed Unangst
2004-05-23according to fork1(9), retval is optional. make it so.Ted Unangst
from form@pdp-11.org.ru via mpech. ok millert
2004-04-19introduce a new km_page allocator that gets pages from kernel_map usingTed Unangst
an interrupt safe thread. use this as the new backend for mbpool and mclpool, eliminating the mb_map. introduce a sysctl kern.maxclusters which controls the limit of clusters allocated. testing by many people, works everywhere but m68k. ok deraadt@ this essentially deprecates the NMBCLUSTERS option, don't use it. this should reduce pressure on the kmem_map and the uvm reserve of static map entries.
2004-04-15rework access to emulations slightly in an effort to both merge andTed Unangst
separate exec format from emulation. consistent naming of freebsd emuls. not much in the way of functional changes yet. testing and ok deraadt@ and others along the way.