summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2012-04-11Move the P_WAITED flag from struct proc to struct process.Mark Kettenis
ok guenther@
2012-04-11In sendmsg() permit at most 10% of maxfiles to be in-flightTheo de Raadt
during CMSG_DATA SCM_RIGHTS fd transfers. If this is exceeded, return EMFILE. ok claudio guenther gilles
2012-04-11SLIST_REMOVE_NEXT -> SLIST_REMOVE_AFTER for better consistency andChristian Weisgerber
compatibility with FreeBSD/NetBSD. Also rename SIMPLEQ_REMOVE_NEXT to SIMPLEQ_REMOVE_AFTER. ok mikeb@ guenther@
2012-04-10Add a start record to the ktrace and use a special magic string "KTR"Mike Belopuhov
to identify ktrace files. kdump(1) will now refuse to operate on trace data without the start record and as a bonus will print only PID, unless an -H flag is specified to print PID/TID pairs. Initial diff, input from and ok deraadt, 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-04-10When converting the timeout to ticks, both round up and add one to accountPhilip Guenthe
for the tick that we're already in the middle of. noted and tested by aja; ok kurt@
2012-04-10POSIX locks should track the process's pid and not the thread's idPhilip Guenthe
2012-04-07Tweak FAT detection/usage. Recognize 'bare' FAT media that lacksKenneth R Westerback
the 0x55aa signature. Don't try FAT detection if we have found an OpenBSD MBR partition. Don't try to read a disklabel from 'bare' FAT media. There can't be one. Finally, don't allow the writing of a disklabel on 'bare' FAT media. There is no safe spot for it, and splatting it in the middle of the FAT structures has not proved helpful.
2012-04-06Implement PT_GET_THREAD_FIRS and PT_GET_THREAD_NEXT.Mark Kettenis
ok miod@
2012-04-06ruadd() does the summing of system and user times, so doing so againPhilip Guenthe
results in bogus total times, as reported by numerous ports people. ok miod@
2012-03-31Some whitespace/paren tweaks. Rename the mbr testing variable fromKenneth R Westerback
'fattest' to 'mbrtest'. No change to .o.
2012-03-30Expand the panic to show the malloc type and size. Okay deraadt@.Paul Irofti
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-26Fix an integer math error when using the result of uvm_page_rle, andMike Larkin
at the same time increase said function's max RLE page count return value. Add hooks in the right places to call the hibernate suspend and resume routines, so that we can enable hibernation with a HIBERNATE option line in GENERIC and appropriate acpi.c goo. discussed on and off with deraadt@ over the past few months
2012-03-26clear junk in p_comm before copying shorter names into itTheo de Raadt
ok jsing guenther miod
2012-03-25release the file ref to the kqueue while in kevent(), so that close()Theo de Raadt
can terminate. a new ref on the kqueue itself allows us to free it properly in that case. wakeups were missing too (for both kevent and poll). similar to netbsd pr46248. fixes a number of threaded ports. this version of the fix from matthew. ok tedu guenther matthew
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-19Add tracing and dumping of "pointer to struct" syscall arguments forPhilip Guenthe
structs timespec, timeval, sigaction, and rlimit. ok otto@ jsing@
2012-03-17remove IP_JUMBO, SO_JUMBO, and RTF_JUMBO.David Gwynne
no objection from mcbride@ krw@ markus@ deraadt@
2012-03-14Close a race that would corrupt a sockbuf because the code that externalizesMark Kettenis
an SCM_RIGHTS message may sleep. Bits and pieces from NetBSD with some simplifications by yours truly. Fixes the "receive 1" panic seen by many. ok guenther@, claudio@
2012-03-130 is a valid uid for files sysctl, don't skip it. ok guentherTed Unangst
2012-03-10Account for sched_noidle and document the scheduler variables.Christiano F. Haesbaert
ok tedu@
2012-03-10Give sigwait priority over ptrace to avoid panicPhilip Guenthe
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-03-09New vmmap implementation.Ariane van der Steldt
no oks (it is really a pain to review properly) extensively tested, I'm confident it'll be stable 'now is the time' from several icb inhabitants Diff provides: - ability to specify different allocators for different regions/maps - a simpler implementation of the current allocator - currently in compatibility mode: it will generate similar addresses as the old allocator
2012-02-25Allow this to build on platforms lacking PT_GETFPREGS or PT_SETFPREGS; brokenMiod Vallat
in previous rev.
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-02-15Hold struct filedesc's fd_lock when writing to the fd_ofiles, fd_ofileflags,Philip Guenthe
or fd_{lo,hi}maps members, or when doing a read for a write. Fixes hangs when an rthreaded processes sleeps while copying the fd table for fork() and catches another thread with the lock. ok jsing@ tedu@
2012-02-10DUIDs are only valid when booting off of a disk, so make sure we arePeter Hessler
actually doing so before using them OK deraadt@, krw@
2012-02-05Fix SysV message queue identifiers.Bret Lambert
Found and diagnosed by Alexis Fouilhe hyjial at gmail dot com input miod@ guenther@ ok guenther@
2012-01-25A signal handled by __thrsigdivert() shouldn't be marked pendingPhilip Guenthe
for the thread handling it. Otherwise (i.e., no sig divert), prefer to deliver a process-aimed signal to some thread which doesn't have the signal blocked. ok tedu@
2012-01-21When disklabels can't be read before attempting to mount root, makeKenneth R Westerback
the message less scary and print out the failing devices to improve troubleshooting. ok jsing@
2012-01-21Make the KERN_FILE2 sysctl() report ENOMEM as documented in sysctl(3).Philip Guenthe
ok millert@
2012-01-21Do not wait for DKF_OPENED to be set if we never actually created aJoel Sing
callback for this disk. Fixes an issue found by krw on macppc. ok krw@
2012-01-17Reimplement mutexes, condvars, and rwlocks to eliminate bugs,Philip Guenthe
particularly the "consume the signal you just sent" hang, and putting the wait queues in userspace. Do cancellation handling in pthread_cond_*wait(), pthread_join(), and sem_wait(). Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add 'abort" argument to thrsleep to close cancellation race; make thr{sleep,wakeup} return errno values via *retval to avoid touching userspace errno.
2012-01-16Ensure that all disk attach callbacks have completed before attemptingJoel Sing
to locate the root via DUID. ok krw@
2012-01-13Always set DKF_OPENED in the disk attach callback.Joel Sing
2012-01-13Restore previous behaviour - only print the DUID if we used it toJoel Sing
select root.
2012-01-11If the DUID of the boot disk has not been provided, attempt to locate itJoel Sing
via the boot device. This allows root on softraid to work on most architectures. For architectures that cannot clearly identify their boot device, the DUID of the boot disk can still be passed from the boot loader, as is already done for amd64 and i386. Based on a suggestion from kettenis@ ok krw@
2012-01-11Move softraid root mapping to later in the boot process - this will allowJoel Sing
us to play some tricks in setroot().
2012-01-10Replace the only occurrence of the obscure macro SLIST_FOREACH_PREVPTR.Alexander Bluhm
No binary change. ok mikeb@ deraadt@ guenther@
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@
2012-01-04Fix use after free in cache_lookup() - found by PedroBob Beck
fix is to manipulate the name cache structures before potentially sleeping on a vn_lock(). This avoids the race of the ncp entry being recycled while we are asleep. run in snaps and on ftp.openbsd.org for months ok thib@
2012-01-01copyright++Federico G. Schwindt
2011-12-28Avoid the use of an invalid disklabel by setting a DK_LABELVALID flagJoel Sing
if we correctly read and validated the disklabel. Always check that this flag is set before using the DUID from the disklabel. Discussed with deraadt@ ok krw@
2011-12-28An all-zero DUID is considered to be a blank DUID - ensure that we do notJoel Sing
generate one. ok krw@
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-11Suspend other rthreads before dumping core or execing; make them exitPhilip Guenthe
when exec succeeds. ok jsing@
2011-12-09Add new KERN_PROC_CWD sysctl to get the current working directory of a process.Nicholas Marriott
ok guenther deraadt