Commit Graph

8152 Commits

Author SHA1 Message Date
mrg
d9a1d7a11e add an XXX comment i meant to include with the original change. 2012-02-18 06:29:10 +00:00
yamt
31e27eaca4 BUFQ_PRIOCSCAN:
- to reduce cpu consumption for a long queue, maintain the sorted lists of
  buffers with rbtree instead of TAILQ.  i vaguely remember that the problem
  pointed out by someone on a public mailing list while ago.  sorry, i can't
  remember who and where.

- add some #ifdef'ed out experimental code.

- bump kernel version for struct buf change.
2012-02-17 08:45:11 +00:00
martin
d178e64fee Fix fallout from the new tests exercising all error paths: do not deactivate
the pmap of a vmspace-less child of a posix spawn operation that never
made it to userland.
2012-02-15 11:59:30 +00:00
martin
f4db024f0d Fix SDT_PROBE macro argument overlooked in argument renaming, noted by <chs> 2012-02-12 20:11:03 +00:00
martin
c6a7db15e9 Minor tweaks to posix_spawn error handling.
The standard allows "open" file actions for descriptors that are alreay
open, add support for that.
2012-02-12 13:14:37 +00:00
martin
0b454a86a3 fd_open(): fix confusion between userland and kernel encoding of open flags 2012-02-12 13:12:45 +00:00
martin
8cd221e226 Regen for posix_spawn 2012-02-11 23:18:13 +00:00
martin
f8c7c04bbe Add a posix_spawn syscall, as discussed on tech-kern.
Based on the summer of code project by Charles Zhang, heavily reworked
later by me - all bugs are likely mine.
Ok: core, releng.
2012-02-11 23:16:15 +00:00
para
4c23b30cff proper sizing of kmem_arena on different ports
PR port-i386/45946: Kernel locks up in VMEM system
2012-02-10 17:35:47 +00:00
drochner
76ee9eff38 align allocations >=pagesize at a page boundary, to preserve traditional
malloc(9) semantics
fixes dri mappings shared per mmap (at least on i945)
approved by releng
2012-02-06 12:13:44 +00:00
rmind
02bf188b03 - Make KMGUARD interrupt-safe.
- kmem_intr_{alloc,free}: remove workaround.

Changes affect KMGUARD-enabled debug kernels only.
2012-02-05 03:40:07 +00:00
para
fa6083dc6c make acorn26 compile by fixing up subpage pool allocations
ok: riz@
2012-02-04 22:11:42 +00:00
joerg
307c7101da Add AuxInfo record with the base address of the main thread. 2012-02-04 18:12:02 +00:00
matt
2210079e9b Add a hook for freeing an ep_emul_arg. Add a wrapper routine
(exec_free_emul_arg) to call the hook and then clear the ep_emul_arg
and ep_emul_arg_free members in the exec_package.
Change users/accessors to use these routines.
Approved by releng.
2012-02-03 20:11:53 +00:00
tls
7b0b7dedd9 Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.
2012-02-02 19:42:57 +00:00
christos
bccc78a590 Disable PTRACE_FORK for vforked() children, because the parent is waiting
and will not receive the SIGTRAP in time.
2012-02-02 02:44:06 +00:00
para
e253ed8e30 allocate uareas and buffers from kernel_map again
add code to drain pools if kmem_arena runs out of space
2012-02-01 23:43:49 +00:00
matt
993d752c0e Use kmem instead of malloc. 2012-02-01 21:49:52 +00:00
dholland
832d4ca72b Be consistent about whether idtype and objtype codes are signed or
unsigned. They are signed. (While unsigned might have been a better
choice, it doesn't really matter and the majority of preexisting uses
were signed. And consistency is good.)
2012-02-01 05:46:45 +00:00
dholland
d2d6fa0ae1 Improve the names of some members of struct quotactl_args. These are
effectively function parameter names, but since they need to be
described with the same names in the man page the choices do matter.
Some.
2012-02-01 05:43:53 +00:00
dholland
56cf2d9a90 Regen syscalls with proper id info. 2012-02-01 05:42:17 +00:00
dholland
a90e43f7de Split out a do_sys_quotactl for compat_netbsd32. 2012-02-01 05:39:28 +00:00
dholland
59b296daa7 Change the syscall API for quotas over to the new non-proplib one.
- struct vfs_quotactl_args -> struct quotactl_args
   - add sys/stdint.h to sys/quotactl.h for clean userland build
   - install sys/quotactl.h in /usr/include
   - update set lists for same
   - add new marshalling code in libquota
   - add new unmarshalling code in vfs_syscalls.c
   - discard proplib interpreter code in vfs_quotactl.c
   - add dispatching code for the 14 quotactl ops in vfs_quotactl.c
   - mark the proplib quotactl syscall obsolete
   - add a new syscall number for the new quotactl syscall
   - change the name of the syscall to __quotactl()
   - remove the decl of the old quotactl from quota/quotaprop.h
   - add a decl of the new quotactl to sys/quotactl.h
   - update the libc build
   - update ktruss
   - remove proplib marshalling code from libquota
   - update copy of syscall table in gdb ppc sources
   - hack rumphijack to accomodate new quotactl name (as I recall,
     pooka wanted such a name change to simplify something, but I
     don't really see what/how)

This change appears to require a kernel version bump for rumpish
reasons.
2012-02-01 05:34:38 +00:00
matt
72094f6fb4 When using socket loaning, make sure the KVA used for the loan has the same
color as the UVA being loaned.
2012-02-01 02:27:23 +00:00
alnsn
976959cf87 Revert to more readable but non-standard use of offsetof to calculate
a size of a structure with a flexible array member.
2012-01-31 20:40:09 +00:00
alnsn
04804f532f Replace offsetof(pcq_t, pcq_items[nitems]) with sizeof(pcq_t) + sizeof(void *[nitems]). 2012-01-31 19:11:37 +00:00
matt
4b50cb788d Use proper ANSI prototypes for foo() -> foo(void)
Caught when compiling with -Wold-style-definition
2012-01-30 23:31:27 +00:00
rmind
4444e11321 Fix for KMEM_GUARD; do not use it from interrupt context. 2012-01-30 21:05:40 +00:00
para
4c6d5e038d do the bookkeeping right 2012-01-30 17:35:18 +00:00
mrg
28f4072d2a make sure that the 'struct malloc' header on allocations is properly
aligned to (ALIGNBYTES+1).  this ensures that the memory that malloc(9)
returns is correctly aligned for the platform.  this change has an
effect on hppa, ia64, sparc and sparc64.

necessary on sparc for 8-byte load/store instructions.  with this my
SS20 boots multiuser again.
2012-01-30 05:42:54 +00:00
rmind
3ad487514e - kern_realloc: fix a recent regression, use correct size of current allocation.
- kern_malloc: constify.
2012-01-30 01:56:47 +00:00
rmind
f76667381c - Add mi_cpu_init() and initialise cpu_lock and kcpuset_attached/running there.
- Add kcpuset_running which gets set in idle_loop().
- Use kcpuset_running in pserialize_perform().
2012-01-29 22:55:40 +00:00
he
5379ae9cd8 Use the same style for initialization of pool_allocator_kmem under
POOL_SUBPAGE as all the other poll_allocator structs.  Fixes build
problem for acorn26.
2012-01-29 20:20:18 +00:00
rmind
c0a0b7fb10 - Add kcpuset_isotherset() and kcpuset_countset().
- Fix KC_NFIELDS_EARLY.  Make kcpuset_isset() return bool.
2012-01-29 19:08:26 +00:00
rmind
3892f469e5 - vmem_xalloc: remove call to uvm_kick_pdaemon() as it is not right.
- Reduce some #ifdefs.  Misc.
2012-01-29 17:27:37 +00:00
para
33c295ed5b move condvar calls under interlock protection
call uvm_kick_pdaemon in case we can sleep and no space in arena
2012-01-29 13:38:15 +00:00
para
f03b7a6082 remove left over macro after kmem_map is gone 2012-01-29 11:14:49 +00:00
dholland
3f04ff889d malloc -> kmem_alloc, by request of rmind 2012-01-29 07:21:59 +00:00
dholland
569f4e677f Remove the extra op argument to VFS_QUOTACTL() - the op is now stored
purely in the args structure.

This change requires a kernel version bump.
2012-01-29 07:14:38 +00:00
dholland
2246330b84 Tidy up the VFS_QUOTACTL interface. Renumber the command codes in a
logical order (as opposed to the previous order, which accumulated
arbitrarily), remove the separate codes for argument encoding as
there's now a 1-1 mapping between ops and argument substructures,
and assert in VFS_QUOTACTL() itself that the op in the args structure
matches the op passed directly.

This change requires a kernel version bump.
2012-01-29 07:13:42 +00:00
dholland
7f2ebd204c Change QUOTACTL_GETVERSION to QUOTACTL_STAT. Add struct quotastat.
This change requires a kernel version bump.
2012-01-29 07:12:40 +00:00
dholland
8e8ca4e548 Move proplib bits for QUOTACTL_QUOTAOFF out of the ufs code.
This change requires a kernel version bump.
2012-01-29 07:11:55 +00:00
dholland
7302da533e Move the proplib bits for QUOTACTL_QUOTAON out of the ufs code.
This change requires a kernel version bump.
2012-01-29 07:11:12 +00:00
dholland
6fc26625df Use QUOTACTL_CURSORSKIPIDTYPE and QUOTACTL_CURSORATEND in
vfs_quotactl. Have it restart from the beginning if it receives
EDEADLK, which requires QUOTACTL_CURSORREWIND.
2012-01-29 07:10:24 +00:00
dholland
a6c55fc2db Add QUOTACTL_CURSORSKIPIDTYPE, QUOTACTL_CURSORATEND, QUOTACTL_CURSORREWIND.
This change requires a kernel version bump.
2012-01-29 07:09:52 +00:00
dholland
32d1d988da Don't pass the idtype to QUOTACTL_GETALL. Instead, iterate both users
and groups.

This change requires a kernel version bump.
2012-01-29 07:08:58 +00:00
dholland
de22be5e7d Call QUOTACTL_GETALL in a loop to get results 8 at a time. Make
the QUOTACTL_GETALL interface less abusive.

Note: this change requires a kernel version bump.
2012-01-29 07:07:22 +00:00
dholland
dee2efa7f8 Rearrange result processing for QUOTACTL_GETALL. 2012-01-29 07:06:37 +00:00
dholland
c8bea794f6 Stop treating the default values specially in QUOTACTL_GETALL.
Note: this change requires a kernel version bump.
2012-01-29 07:06:01 +00:00
dholland
1857cfb33b Teach quota2 QUOTACTL_GETALL to acecpt a limit on how much it sends back.
Pass in a dummy limit for now.

Note: this change requires a kernel version bump.
2012-01-29 07:05:12 +00:00