Commit Graph

5480 Commits

Author SHA1 Message Date
pooka 6ae9cab127 In quotactl, move vrele() to after the VFS call: protects the
mountpoint from being wiped under us better.

from David Holland
2007-08-28 09:28:10 +00:00
dsl c232133678 ktrace socket control structures (ie msghdr, address etc) using ktrkuser(). 2007-08-27 20:09:44 +00:00
dsl 22c0ab6d47 Only ktrace the part of the buffer actually read/written. 2007-08-27 16:23:16 +00:00
dsl 31c3c56394 Fix inverted test in ktrpoint(), NAMI traces weren't being generated.
Also inline the 'ktrace_on' part of the test.
2007-08-27 13:33:45 +00:00
dyoung 5204966a96 Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).

Use sockaddr_dl_setaddr() in a few places.
2007-08-26 22:59:08 +00:00
ad 6b79143ab0 pool_drain: add a comment. 2007-08-18 00:37:14 +00:00
ad e492e656cc pool_do_cache_invalidate_grouplist: drop locks while calling the destructor.
XXX Expensive - to be revisited.
2007-08-18 00:33:38 +00:00
ad b5866eb299 Make the uarea cache per-CPU and drain in batches of 4. 2007-08-18 00:21:10 +00:00
ad c3ffc50d7a Remove obsolete comments. 2007-08-18 00:11:00 +00:00
ad 215f99bf1f Remove obsolete comment. 2007-08-17 23:46:34 +00:00
skd 617b9b58ef Don't put the condvars in the *middle* of the undo structures.
(semu + seminfo.semmnu) is wrong, because the type of semu is int*.
You could fix the offset ((char *)semu + seminfo.semusz), but simply
putting the condvars first is more clear.
2007-08-17 23:05:06 +00:00
ad 26c3495f7d Timecounters are lockless. Add conservative memory barriers to ensure that
loads and stores occur in the correct order.
2007-08-17 21:20:24 +00:00
ad c0fd052388 Fix a couple of comments. 2007-08-17 17:25:14 +00:00
ad 399122feeb subr_prf_bitmask.c -> subr_prf2.c 2007-08-15 20:34:48 +00:00
ad e59f9f3e20 proc_free: don't destroy locks until the last LWP is confirmed off the CPU.
This is an ideal candidate for pool_cache.
2007-08-15 12:20:28 +00:00
ad d3675885a8 Regen. 2007-08-15 12:09:12 +00:00
ad df7945cf28 - Update for ktrace changes.
- Mark a few more syscalls MPSAFE.
2007-08-15 12:08:38 +00:00
ad 63c4506184 Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
2007-08-15 12:07:23 +00:00
rmind d2142b3188 sys__lwp_suspend: Handle the possible problem when target LWP might exit via
lwp_exit() before suspending.  In such case, LWP might be already freed after
cv_wait_sig() and checking the list of LWPs via lwp_find() is necessary.

Possible problem catched by Andrew Doran.
2007-08-15 02:50:40 +00:00
pooka 3340382aec more vfs_subr -> vfs_subr2 dance for rump:
vwakeup, vinvalbuf, vtruncbuf, vflushbuf, bgetvp, brelvp, reassignbuf
2007-08-14 13:51:31 +00:00
pooka e7c5957392 Revert code part of rev 1.95, yamt pointed out it changes NFS semantics. 2007-08-12 23:40:40 +00:00
pooka 67c57c75e0 CREATE is a write operation in my book, so check for that also when
checking for a readonly lookup.  This shouldn't make a difference
now, though, as the only RDONLY lookup is done by getcwd(), and
that a) doesn't create files b) calls LOOKUP directly anyway.

Also, fix comment I managed to miss in the previous commit (I didn't
expect the same comment to be there twice).
2007-08-12 19:42:09 +00:00
pooka 5450d0d87b cn_flags RDONLY brilliantly has nothing to do with the file system
itself being r/o, so fix a couple of misguided comments.
2007-08-12 19:31:12 +00:00
pooka 5a92d448e1 POOL_INIT -> pool_init, we need to call bufinit() anyway 2007-08-11 19:56:53 +00:00
dyoung 596a16c16b Don't run ctags(1) on sys/altq/altq.h, it redefines useful NetBSD
tag targets.
2007-08-10 22:50:12 +00:00
dyoung ffbbd3ac2d Fix kernel compilation with 'options KSTACK_CHECK_MAGIC': change
'void *' to 'char *' so pointer arithmetic will work.
2007-08-10 21:50:48 +00:00
pooka b4b6be82da do the shuffle: move mount_specificdata stuff from vfs_subr to vfs_subr2 2007-08-09 20:55:30 +00:00
he fd961c4429 Add a new socket option for unix domain sockets: LOCAL_PEEREID, to make
it possible to get the pid, euid and egid of the process at the remote
end at the time it did bind() or connect().

Add a new libc function, getpeereid() to easily get at the euid and egid.
As a consequence, bump libc's minor number.

Document the LOCAL_PEEREID socket option in unix(4).

Based on contribution by Arne H. Juul, minor modifications by myself.
2007-08-09 15:23:01 +00:00
pooka 3de9f5d391 Instead of having lfs muck directly about with vnode free lists,
introduce vrele2(), which allows to release vnodes the way lfs
sometimes wants it:
  + without calling inactive
  + inserting the vnode at the head of the freelist (this is a very
    questionable optimization that isn't even enabled by default,
    but I went along with the same semantics for now)
2007-08-09 08:51:21 +00:00
pooka 5fbd525b19 Shuffle routines which just roll values around from kern_clock.c
and kern_time.c to subr_time.c.
2007-08-09 07:36:18 +00:00
ad 41368c8e7e Grab locks in getrusage/getrlimit. 2007-08-08 14:07:11 +00:00
ad 06f7ccf01d Regen. 2007-08-07 19:01:23 +00:00
ad 830ab6bb3c - Fix a bug with _lwp_park() where if the computed wakeup time was under
1 microsecond into the future, the thread could enter an untimed sleep.
- Change the signature of _lwp_park() to accept an lwpid_t and second
  hint pointer, but do so in a way that remains compatible with older
  pthread libraries. This can be used to wake another thread before the
  calling thread goes asleep, saving at least one syscall + involuntary
  context switch. This turns out to be a fairly large win on the condvar
  benchmarks that I have tried.
- Mark some more syscalls MP safe.
2007-08-07 19:00:42 +00:00
yamt 69aa06cd40 don't bother to set thread's priority by ourselves,
as kthread_create does it for us now.  from Andrew Doran.
2007-08-07 12:50:26 +00:00
ad eef90c7197 Regen. 2007-08-07 12:48:52 +00:00
ad b9d8ad095d wait() can't yet be MPSAFE since it's impractical to hold proclist_mutex
across exit(), and so there is a short race against cv_wait_sig(). This
can be reverted when proclist_mutex/proclist_lock merge.
2007-08-07 12:48:30 +00:00
ad 5005559992 Do cv_broadcast() on proc::p_waitcv to be on the safe side (the parent
could be multithreaded).
2007-08-07 12:45:54 +00:00
ad c1bc924601 No reason not to make itimespecfix() generally available.. 2007-08-07 11:43:35 +00:00
ad 4a8903393a Export itimespecfix() until itimerfix() dies. 2007-08-07 11:39:18 +00:00
yamt e3fe8e011e - don't assume the order of cpus in a CPU_INFO_FOREACH loop.
- remove unused structure members.
- simplify.
2007-08-07 10:42:22 +00:00
ad 23cf810fc7 Regen. 2007-08-07 09:46:39 +00:00
ad 9dab7d5077 gettimeofday() doesn't need locks, and MySQL seems to make heavy use of it. 2007-08-07 09:46:24 +00:00
dyoung 04d14f227e Lengthen sockaddr_dl so that a 16-byte FireWire address will fit
into sdl_data[].

Move the macro satocsdl() to net/if_dl.h, and introduce satosdl().

Add some helpers for initializing sockaddr_dl (sockaddr_dl_init),
for finding out the length to put in a sockaddr_dl's sdl_len member
(sockaddr_dl_measure), and for setting the link-layer address in
a sockaddr_dl to a new value (sockaddr_dl_setaddr).

Make sockaddr_copy() panic if the caller tries to copy a sockaddr
to a destination where it will not fit.
2007-08-07 04:06:20 +00:00
pooka 3fbf89c648 Initialize size of outsize-of-fs device vnodes also, since they
can migrate to file systems due to checkalias() and cause KASSERT
panics.

fixes nfsroot panic reported by martin
2007-08-06 17:09:11 +00:00
yamt 261e7c1e79 remove a homegrown definition of CPU_INFO_FOREACH. 2007-08-06 11:51:46 +00:00
yamt 954298e279 suspendsched: reduce #ifdef. 2007-08-06 11:48:23 +00:00
yamt e42cf10955 sosetopt: clear SB_AUTOSIZE when setting buffer size explicitly. 2007-08-06 11:41:52 +00:00
ad 5b2aca96b9 Current convention is to name/number objects after ci->ci_cpuid, so do
that when creating the kthreads. We may want to change this.
2007-08-05 13:47:25 +00:00
rmind c8c024369c Improve per-CPU support for the workqueue(9):
- Make structures CPU-cache friendly, as suggested and explained
   by Andrew Doran.  CACHE_LINE_SIZE definition is invented.
 - Use current CPU if NULL is passed to the workqueue_enqueue().
 - Implemented MI CPU index, which could be used as an index of array.
   Removed linked-lists usage for work queues.

The roundup2() function avoids division, but works only with power of 2.

Reviewed by: <ad>, <yamt>, <tech-kern>
2007-08-05 01:19:17 +00:00
ad c3085c5fd6 A quick hack to get things building again. Don't refer to curlwp
if !MULTIPROCESSOR.
2007-08-04 11:57:54 +00:00