Age | Commit message (Collapse) | Author |
|
list walkers in sysctl that can block. As a reward, no more vslock.
With some feedback from art, guenther, phessler. ok guenther.
|
|
/dev/mem to be direct instead of going through kvm_getprocs(), as
that function is going to get more an more broken as we move stuff
from struct proc to struct process for rthreads. To minimize the
code copying, put the common logic of filling in a kinfo_proc2
structure into a macro FILL_KPROC2() in <sys/sysctl.h> for use from
both the kernel and user-space. This also hides the KERN_PROC
#define behind "#if defined(_KERNEL)||defined(_LIBKVM)", as it's
deprecated.
Positive feedback from millert and blambert; so committing to unblock
further rthreads work.
|
|
No longer allocate a static amount of memory for messages in MD
boot path; message queues, message metadata, and message data now
all use dynamic memory, which means that runtime sysctls should now
be trivial to implement.
Since I'm going to be around all week to fix any breakage, this should
probably just go in now.
|
|
after c2k9
allows buffer cache to be extended and grow/shrink dynamically
tested by many, ok oga@, "why not just commit it" deraadt@
|
|
|
|
Man page bits adapted from FreeBSD. OK miod@
|
|
is how sysctl finds them, so it can *never* be renumbered again, and must
stay
|
|
three
commits:
1) The sysctl allowing bufcachepercent to be changed at boot time.
2) The change moving the buffer cache hash chains to a red-black tree
3) The dynamic buffer cache (Which depended on the earlier too).
ok on the backout from marco and todd
|
|
|
|
along with vnode type-specific info to make it more useful for fstat(1).
OK deraadt@
|
|
This commit won't change the default behaviour of the system unless the
buffer cache size is increased with sysctl kern.bufcachepercent. By default
our buffer cache is 10% of memory, which with this commit is now treated
as a low water mark. If the buffer cache size is increased, the new size
is treated as a high water mark and the buffer cache is permitted to grow
to that percentage of memory.
If the page daemon is invoked, the page daemon will ask the buffer cache
to relenquish pages. if the buffer cache has more than the low water mark it
will relenquish pages allowing them to be consumed by uvm. after a short
period the buffer cache will attempt to re-grow back to the high water mark.
This permits the use of a large buffer cache without penalizing the available
memory for other purposes.
Above the low water mark the buffer cache remains entirely subservient to
the page daemon, so if uvm requires pages, the buffer cache will abandon
them.
ok art@ thib@ oga@
|
|
size on a running system.
ok art@, oga@
|
|
in sysctl hw.ncpufound; ok miod kettenis
|
|
value of kern.clockrate with sysctl(3) correctly sets errno on failure.
PR #6040, ok tedu@
|
|
sleeping calls. Since we are simply operating on another process'
vmspace, grab a (refcounted) copy of that pointer and use that instead.
originally spotted by kurt, discussed with art
|
|
|
|
|
|
|
|
ok art@
|
|
to the user or the superuser. Display * for those fields instead. From
PR 5113, but modified to use copyout correctly.
comments from tedu, ok from others
|
|
ok deraadt@
|
|
machines with more than 4GB of memory. Make sysctl(8) print values obtained
using these sysctls for hw.physmem and hw.usermem.
ok krw@, miod@
|
|
ok tedu@ kettenis@
|
|
- Move the functionality of choosing a process from cpu_switch into
a much simpler function: cpu_switchto. Instead of having the locore
code walk the run queues, let the MI code choose the process we
want to run and only implement the context switching itself in MD
code.
- Let MD context switching run without worrying about spls or locks.
- Instead of having the idle loop implemented with special contexts
in MD code, implement one idle proc for each cpu. make the idle
loop MI with MD hooks.
- Change the proc lists from the old style vax queues to TAILQs.
- Change the sleep queue from vax queues to TAILQs. This makes
wakeup() go from O(n^2) to O(n)
there will be some MD fallout, but it will be fixed shortly.
There's also a few cleanups to be done after this.
deraadt@, kettenis@ ok
|
|
eyeballed and ok dlg@
|
|
version for i386
more architectures and ctob() replacement is being worked on
prodded by and ok miod
|
|
|
|
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@
|
|
Pick reasonble names for the locks involved..
ok tedu@, art@
|
|
have cpu_info now, so kill the option.
eyeballed by jsg@ and grange@
|
|
to wire more memory than we are allowed to.
miod@ ok
|
|
leave macros behind for now to keep the commit small
ok art beck miod pedro
|
|
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
|
|
spotted by art, ok dlg art
|
|
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@)
|
|
Constantine A. Murenin
|
|
errors to userland: make all cpu_setperf functions return void.
Tested by many, ok gwk@
|
|
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@
|
|
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.
|
|
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.
|
|
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@
|
|
hook up some sysctls to add system vendor/product/version and UUID reporting.
"get it in" deraadt@
|
|
variable if the result is a lowering of the value; tested matthieu
|
|
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@
|
|
sensor_add()/sensor_del() so that sensors can be attached
and detached dynamicaly.
ok kettenis@ deraadt@ dlg@
|
|
'go for it' deraadt@
|
|
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@
|
|
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.
|
|
tested on GENERIC and RAMDISK_CD to see if the small_kernel stuff stays
happy
|
|
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.
|