summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2007-04-23Clean up an obsolete allocator.Artur Grabowski
miod@ ok
2007-04-19Fix freeing of namecache entries in cache_purgevfs(), okay miod@ art@Pedro Martelletto
2007-04-19After we bumped the maximal number of vnodes by quite a bit we becameArtur Grabowski
painfully aware of what the comment: "This makes the algorithm O(n^2), but do you think I care?" actually means. I started to care. Fix up the cache_purgevfs algorithm to not be O(n^2) since it's not preemptible anyway and while I'm here, make this code actually return the cache entries to the pool instead of hogging them and implement a marginally faster free list. This way we return memory to the system when some parameters change. miod@ ok
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-17Don't bother performing ITIMER accounting on P_SYSTEM processes (i.e. kthreads).Miod Vallat
ok art@ kettenis@
2007-04-13While splitting flags and pqflags might have been a good idea in theoryArtur Grabowski
to separate locking, on most modern machines this is not enough since operations on short types touch other short types that share the same word in memory. Merge pg_flags and pqflags again and now use atomic operations to change the flags. Also bump wire_count to an int and pg_version might go int as well, just for alignment. tested by many, many. ok miod@
2007-04-13Move the declaration of VN_KNOTE() into vnode.h instead of havingThordur I. Bjornsson
multiple defines all over; ok tedu@
2007-04-13Remove comments talking about vnode interlock. No binary change.Alexander Bluhm
ok thib
2007-04-12Remove the lk_interlock from struct lock; Also remove the LK_INTERLOCKThordur I. Bjornsson
flag. This effectively makes the simplelock argument to lockmgr() fluff. ok miod@
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-04-12Allow machine-dependant overrides for the ``deadbeef'' sentinel values,Miod Vallat
and make sure that nothing can ever be mapped at theses addresses. Only i386 overrides the default for now. From mickey@, ok art@ miod@
2007-04-11Remove the simplelock argument from vrecycle();Thordur I. Bjornsson
ok pedro@, sturm@
2007-04-11remove proc from process thread list sooner in exit (notably, before waitingTed Unangst
for the list to become empty) ok art
2007-04-11Instead of managing pages for intrsafe maps in special objects (aka.Artur Grabowski
kmem_object) just so that we can remove them, just use pmap_extract to get the pages to free and simplify a lot of code to not deal with the list of intrsafe maps, intrsafe objects, etc. miod@ ok
2007-04-11lockmgr keeps losing code, call 911!Miod Vallat
ok pedro@ art@
2007-04-10undoTed Unangst
2007-04-10remove duplicate check for uio_resid == 0 inThordur I. Bjornsson
spec_read(); ok pedro@
2007-04-10``it's'' -> ``its'' when the grammar gods require this change.Miod Vallat
2007-04-10remove process from thread list sooner in exit (notably, before waitingTed Unangst
for the list to become empty)
2007-04-05jason crawford noticed that the rthreads diff didn't compile with rthreads!Ted Unangst
2007-04-04Implement RW_DOWNGRADE that downgrades an exclusive lock to a shared lockArtur Grabowski
without letting any other exclusive locks in between. As opposed to upgrading locks, this is easy and solves real problems. deraadt@ ok
2007-04-04Mechanically rename the "flags" and "version" fields in struct vm_pageArtur Grabowski
to "pg_flags" and "pg_version", so that they are a bit easier to work with. Whoever uses generic names like this for a popular struct obviously doesn't read much code. Most architectures compile and there are no functionality changes. deraadt@ ok ("if something fails to compile, we fix that by hand")
2007-04-04Implement clock_gettime(CLOCK_PROF) since it's so simple.Artur Grabowski
deraadt@ ok
2007-04-04oursleves -> ourselvesPedro Martelletto
2007-04-04Don't remove the process from the threads queue in proc_zap() as thatPedro Martelletto
currently already happens in exit1(), okay art@
2007-04-03Start moving state that is shared among threads in a process intoArtur Grabowski
a new struct. Instead of doing a huge rename and deal with the fallout for weeks, like other projects that need no mention, we will slowly and carefully move things out of struct proc into a new struct process. - Create struct process and the infrastructure to create and remove them. - Move threads in a process into struct process. deraadt@, tedu@ ok
2007-03-31Add missing bintime2timespec().Mark Kettenis
ok art@
2007-03-30change a misplaced splnet() in kqueue_poll() to splhigh(). fixes aReyk Floeter
random panics with kqueue under high load with many events. tested by me cookies for dlg@ deraadt@ ok dlg@ tedu@ art@
2007-03-30replace lockmgr locks with rwlocks. these are no longer recursive, but theyDavid Gwynne
weren't used recursively anyway. tested by hsoexer@ fkr@ ok pedro@
2007-03-27Remove an #ifdef LFS chunk from dk_mountroot();Thordur I. Bjornsson
ok pedro@
2007-03-25Garbage collect CPU_CLOCKUPDATE since it was only used by i386.Artur Grabowski
from brad.
2007-03-25remove a few void * casts that are uselessTed Unangst
2007-03-24Kill the horrible hack of storing the pid in struct selinfo.Artur Grabowski
Instead, keep the proc pointer in it and put the selinfo on a list in struct proc in selrecord. Then clean up the list when leaving sys_select and sys_poll. miod@ ok, testing by many, including Bobs spamd boxes.
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-03-21Remove the v_interlock simplelock from the vnode structure.Thordur I. Bjornsson
Zap all calls to simple_lock/unlock() on it (those calls are #defined away though). Remove the LK_INTERLOCK from the calls to vn_lock() and cleanup the filesystems wich implement VOP_LOCK(). (by remvoing the v_interlock from there calls to lockmgr()). ok pedro@, art@, tedu@
2007-03-21Split tsleep into pieces. Instead of doing everything in a large "shoveArtur Grabowski
everything into it" function, there are now 6 stages of tsleep with an on-stack (remember that kernel stacks are not swappable now?) structure that keeps track of the state. This way we first setup the sleep, setup the events that might break the sleep, finish the sleep (actually sleeping) and then take care of the events that could wake us up. In the future this will make it easier to implement functionality like: setup sleep, release lock or check some condition, finish sleep, in a race-free way and without duplicating or complicating the tsleep function too much. miod@, millert@ ok.
2007-03-20swiss spellingTheo de Raadt
2007-03-20zap unused variable.Thordur I. Bjornsson
ok pedro@
2007-03-19attach softraid to the root of the device tree in a machine independantDavid Gwynne
way, rather than requiring some glue in each machines mainbus probe. it is still commented out. based on a discussion with miod@ ok marco@ deraadt@
2007-03-19Change the way the nmea(4) line discipline takes the timestamp forMarc Balmer
the timedelta sensor when no PPS signal is available. Previously, the timestamp was taken at the leading '$' character of a GPRMC message, which was not always correct, as some GPS units send other messages first; we do not know when the GPRMC message is sent within a data block (we refer to a data block as the set of NMEA messages that are sent by a GPS unit in one go, usually once per second). nmea(4) now takes the timestamp at the first '$' character received after the start of a new seconds. Since GPS units transmit a data block every second, the first message can be found by measuring the gap between consecutive messages: after the longest gap, the first message of the next second follows. And it is at the leading '$' character of this message that we take the timestamp. $GPGGA,..... <- take timestamp here $GPGSA,..... $GPRMC,..... <- decode time here ... <- possibly more messages <- longer gap till start of next second $GPGGA,..... <- it starts all over, take next timestamp This code has been designed to work independent of the baudrate and the rate at which the GPS sends out it's data blocks (usually 1 Hz, but 5 Hz units are common as well): With this change, precision is greatly improved in the absence of a PPS signal and as a side effect, jitter is reduced. Note that while this is much better than before, there is still a slight offset to the real time, as calculating the fix in the GPS unit and transmitting the '$' character takes a short, but unpredictable amount of time. When tty timestamping is enabled, but there is no PPS signal available, the sensor status will be degraded to CRITICAL, which means "check your hardware". Thanks to Chris Kuethe for testing and feedback. ok ckuethe.
2007-03-18Don't restart thrsleep after a signal. After a signal happened and weArtur Grabowski
weren't on the sleep queues, the condition we were sleeping on might have changed, so we need to go back to userland and recheck that condition. This fixes the majority of lockups and and hanging threads in rthreads since it fixes a race in the semaphore code. ok tedu@
2007-03-17Since we're not always called with M_WAIT, check return value fromArtur Grabowski
MGETHDR and fail if it's NULL. ok miod@
2007-03-15m_prepend() works only for sizes smaller than MHLEN.Claudio Jeker
OK beck@ deraadt@ pyr@
2007-03-15Since p_flag is often manipulated in interrupts and without biglockArtur Grabowski
it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
2007-03-14Clean up after miod.Mark Kettenis
2007-03-13Don't bother checking for OLF binaries if option SMALL_KERNEL.Miod Vallat
2007-03-12better desiredvnodes not based on maxusers; pedro@ deraadt@ okMichael Shalayeff
2007-03-05If tty-timestamping is requested, but no PPS signal is present, output aMarc Balmer
warning message and unconditionally set the sensor state to WARNING. discussed with otto, ckuethe; ok otto, "i like it" ckuethe
2007-03-01Remove two ancient debugging printfs.Artur Grabowski
2007-02-26exclude control data from the number of bytes returned by FIONREAD ioctl()Kurt Miller
by adding a sb_datacc count to sockbuf that counts data excluding MT_CONTROL and MT_SONAME mbuf types. w/help from deraadt@. okay deraadt@ claudio@