summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2008-11-03pre-allocate the ptrace_state we may need to tie to the new processTheo de Raadt
in case we need it. the idea is to try to get rid of some potential sleeps.. ok tedu
2008-11-01Grab a reference to the trace vnode of the process when traversing thePedro Martelletto
global process list and calling ktrsettracevnode() in ktrwrite(), so that we don't sleep in vrele(). Discussed with deraadt@, okay beck@, tedu@ and thib@.
2008-11-01change vrele() to return an int. if it returns 0, it can gaurantee thatTheo de Raadt
it did not sleep. this is used to avoid checkdirs() to avoid having to restart the allproc walk every time through idea from tedu, ok thib pedro
2008-11-01change all callers of enterpgrp() to pre-allocate a pgrp or session ifTheo de Raadt
it might be needed later -- before calling pfind(), so that enterpgrp() can operate without sleeping ok tedu
2008-10-31Do not assume that a pointer to another process will live over a set ofTheo de Raadt
sleeping calls. Since we are simply operating on another process' vmspace, grab a (refcounted) copy of that pointer and use that instead. Similar to the bug just fixed in sysctl_proc_args. discussed with art
2008-10-31Do not assume that a pointer to another process will live over a set ofTheo de Raadt
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
2008-10-31accidental commit ... backoutTheo de Raadt
2008-10-31accidental commit ... backoutTheo de Raadt
2008-10-31kern_sysctl.cTheo de Raadt
2008-10-31checkdirs() walks allproc and calls sleeping functions if directories haveTheo de Raadt
to be snapped. Change it so that everytime it sleeps it restarts from the top of the list. ok art
2008-10-30reintroduce mutexes to workqs for locking.David Gwynne
tested by many on many archs including several alpha test. ok tedu@ go for it deraadt@
2008-10-30Use msleep() in the reaper to make it not lose events. Based on discussionTheo de Raadt
PR 5609, and revisited with dlg. Tested on all platforms. ok miod
2008-10-27when shutting workq threads down, dont try to take the big kernelDavid Gwynne
lock when we've never given it up. this is a remnant of the mpsafe workq stuff we had that wasnt cleaned up properly. found by and fix tested by oga@
2008-10-24another oops.Ted Unangst
2008-10-24yet again i prove unable to commit what i really wanted. spotted by deraadtTed Unangst
2008-10-23a better fix for the "uvm_km thread runs out of memory" problem.Ted Unangst
add a new arg to the backend so it can tell pool to slow down. when we get this flag, yield *after* putting the page in the pool's free list. whatever we do, don't let the thread sleep. this makes things better by still letting the thread run when a huge pf request comes in, but without artificially increasing pressure on the backend by eating pages without feeding them forward. ok deraadt
2008-10-22Add timeout_add_msec(), for timeouts in milliseconds.Bret Lambert
Idea and original patch mk@ ok mk@, krw@
2008-10-20The optimization done in 1.19 (and repaired in 1.20) results inTheo de Raadt
cache entries which are freed (and potentially reused), but which are currently in use by another kernel thread which was sleeping in vput() or vget(). This causes the crash in PR 5960, but potentially a bunch of other side effects. figured out with pedro. ok kettenis
2008-10-18Revert the change to use pools for <= PAGE_SIZE allocations. ItMark Kettenis
changes the pressure on the uvm system, uncovering several bugs. Some of those bugs result in provable deadlocks. We'll have to reconsider integrating this diff again after fixing those bugs. ok art@
2008-10-15make random(9) return per-cpu values (by saving the seed in the cpuinfo),Theo de Raadt
which are uniform for the profclock on each cpu in a SMP system (but using a different seed for each cpu). on all cpus, avoid seeding with a value out of the [0, 2^31-1] range (since that is not stable) ok kettenis drahn
2008-10-14Back-in; problems were apparently elsewhere.Philip Guenthe
Put a reference count in struct process to prevent use-after-free if the main thread reaches the reaper ahead of some other thread in the process. Use the reference count to update the user process count correctly when changin real uid. "please re-commit before something else nasty comes in" deraadt@
2008-10-14Change m_devget()'s outdated and unused "offset" argument: It isChristian Weisgerber
now the offset into the first mbuf of the target chain before copying the source data over. From FreeBSD. Convert drivers' use of m_devget(). Mostly from thib@. Update mbuf(9) man page. ok claudio@, thib@
2008-10-11Since malloc_page_alloc() is a pool allocator it should check for PR_WAITOKMark Kettenis
instead of M_NOWAIT. Checking for M_NOWAIT made many malloc calls that used that flag actually wait. This probably explains many if the strange hangs people have seen recently. ok miod@
2008-10-10backout; is causing some people difficultyTheo de Raadt
2008-10-09Change sb_timeo to unsigned, so that even if some calculation (ie. n * HZ)Theo de Raadt
becomes a very large number it will not wrap the short into a negative number and screw up timeouts. It will simply become a max of 65535. Since this happens when HZ is cranked to a high number, this will still only take n seconds, or less. Safer than crashing. Prompted by PR 5511 ok guenther
2008-10-09pass NULL rather than 0 for interrupt time usage to calcru()Kevin Lo
ok art@
2008-10-09Use the reference count in struct process to update the proc countPhilip Guenthe
for users by the correct amount when changing real UID on (r)threaded processes. ok art@ tedu@
2008-10-09Put a reference count in struct process to prevent use-after-freePhilip Guenthe
if the main thread reaches the reaper ahead of some other thread in the process. ok art@ tedu@
2008-10-07Do not display file offsets and a few other pieces of information, exceptTheo de Raadt
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
2008-10-05In malloc_page_free(), restore the correct wire_count value.Miod Vallat
2008-10-04At clock initialization, if we discover that tickadj is 0 (due to veryTheo de Raadt
high HZ) set it to 1, to avoid various divide-by-zero errors later Based on discussion in PR 5511 ok miod
2008-10-03Make sigwait() work correctly. In particular, it'll work when thePhilip Guenthe
signal is already pending in the calling thread or the main thread and there's no longer a race condition where the signal could be diverted but sigwait() would still block. There were some off-by-one errors too. (The checking of the main thread's pending list is just until a pending list for the process can be added to struct process. For now, such signals end up as pending on the main thread.) oks tedu@ and art@
2008-10-02A closed, disconnected, or otherwise failed socket is still a socketTheo de Raadt
and should return stat information instead of EINVAL from deep in the guts of tcp_usrreq. While there, put some more information into struct stat, inspired by FreeBSD. EINVAL problem reported in PR 5943
2008-09-29Use pools to do allocations for all sizes <= PAGE_SIZE.Artur Grabowski
This will allow us to escape the limitations of kmem_map. At this moment, the per-type limits are still enforced for all sizes, but we might loosen that limit in the future after some thinking. Original diff from Mickey in kernel/5761 , I massaged it a little to obey the per-type limits. miod@ ok
2008-09-28initialize the ether_vtag field like the rest of the packet headerChristian Weisgerber
2008-09-19system/5918: fix clearing of ITIMER_VIRTUAL and ITIMER_PROF it_intervalDamien Miller
ok tedu@
2008-09-19Fix a bunch of problems and races with posix file locking.Artur Grabowski
- file descriptor table becomes the owner of the lock instead of the proc. - When grabbing the lock, we check if the fd hasn't changed under our feet, this is more or less impossible to solve without a hack like this. I've banged my head against the wall, I figured out a solution, but implementing it correctly would cost me 12 gray hairs. Screw it, this is ugly, but it works. - Wait until usecount drains before releasing the posix lock in closef. - Add missing FREF/FRELE to sys_flock - keep the pid in the flock struct instead of abusing the fact that we used to use the proc as the lock owner. Pointed out by and discussed with Al Viro, big thanks. miod@ ok
2008-09-19increase MAXINTERP from 64 to 128 and allow a little extra room on topDamien Miller
of that for shell scripts to cover the #!, an optional space following it and a newline at the end. feedback and ok miod@
2008-09-16Add PIOD_READ_AUXV, a way to get the ELF auxilliary vector through ptrace(2).Mark Kettenis
ok miod@
2008-09-16netstat statistics for pflow(4) via pseudo familyJoerg Goltermann
ok cluadio@ henning@
2008-09-10Convert timeout_add() calls using multiples of hz to timeout_add_sec()Bret Lambert
Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
2008-09-10There's no need to fully traverse the wakeup queue when waking a specificBret Lambert
process sleeping on a unique address (wakeup -> wakeup_one) ok guenther@, tedu@, art@
2008-09-05Back out previous. Art realised a problem with it.Owain Ainsworth
2008-09-05Don't overwrite the old ipl in msleep if PNORELOCK was set.Artur Grabowski
2008-09-05When munging the WANTIPL of the mutex to prevent undoing the sched_lock,Owain Ainsworth
use the constant for IPL_SCHED, and not splsched(), which doesn't do what we want. ok art@. Tested by Paul de Weerd.
2008-08-25If partoffp is non-NULL then readdoslabel() is just looking for theKenneth R Westerback
correct address to write the passed label. Don't spoof partitions while looking for the address, as this could result in an invalid label being written out. "That looks right" deraadt@ "Looks good to me" miod@
2008-08-22simplification, and repair findblkmajor for name## lookups; ok krwTheo de Raadt
2008-08-20Allow devices attaching at root (such as softraid) to be disabled in UKC.Miod Vallat
ok marco@ deraadt@
2008-08-14Kill the _MCLDEREFERENCE() macro it was only used once and it should be onlyClaudio Jeker
used once -- in m_free(). Removed so that people don't get stupid ideas. OK thib@
2008-08-08Admit b_blkno means block number; a block is DEV_BSIZE (a.k.a.Kenneth R Westerback
512) bytes; ffs is inextricably tied to using b_blkno and disklabel always uses sectorsize units. Thus use DEV_BSIZE units for all fields describing ffs filesystems and convert to/from sectors where required. This enables the creation and use of ffs filesystems on non-512 byte sectorsize devices. This diff allows i386 and sgi (the two test platforms) to find disklabels that are not on a sectorsize boundary. Same change to further archs coming. This is a no-op on 512-byte sectorsize devices. This work triggered by jsing@'s need to create ffs filesystems on sgi cdroms so we can create cdrom install media for sgi. sgi testing by jsing@ ok jsing@ pedro@ "looks sane" beck@ weingart@