Commit Graph

6053 Commits

Author SHA1 Message Date
ad 2ffc44f47b Regen. 2008-03-27 17:14:21 +00:00
ad a19a515177 Put kqueue/kevent back as MPSAFE. 2008-03-27 17:13:25 +00:00
ad 78656b1e91 - kqueue_scan: work around problem noted by yamt@: if an event fires while
we have unlocked the kqueue to check its state, leave it queued and
  re-check later.
- knote_dequeue: fold into knote_detach since nothing else uses it.
- Note a couple more problems.
2008-03-26 13:32:32 +00:00
yamt 91ae756395 - for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well.  fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map.  XXX a bit arbitrary.
- add a comment.
2008-03-25 23:21:42 +00:00
ad 8910b668ba mount_domount: hold an additional reference to the mountpoint across the
call to VFS_START. The file system can be unmounted before VFS_START
returns. Partially addresses PR kern/38291.
2008-03-25 22:13:32 +00:00
yamt ef630703b1 regen. 2008-03-24 23:47:06 +00:00
yamt f725bfefcf after yamt-lazymbuf merge, mark send/recv syscalls MPSAFE.
pointed out by Andrew Doran.
2008-03-24 23:46:43 +00:00
yamt 2acbe71698 regen. 2008-03-24 12:25:42 +00:00
yamt 9a4b7dd279 merge yamt-lazymbuf branch. 2008-03-24 12:24:37 +00:00
yamt 8df658c8ca add some DEBUG checks. 2008-03-24 09:09:55 +00:00
yamt d3d0ab9bb2 kqueue_scan: skip markers correctly. 2008-03-23 22:39:48 +00:00
ad 36cd74d4d8 Undo 1.150 (Don't make root an exception when enforcing rlimits). No other
Unix behaves this way and it breaks too many things, e.g. web servers.
2008-03-23 17:40:25 +00:00
ad 28a2c8b191 Reorder a code block slightly, to allow proclist_mutex to be an adaptive
mutex (purely for testing).
2008-03-23 16:53:45 +00:00
ad 25b10dbb15 lwp_ctl_alloc: initialize lcp_kaddr to vm_map_min(kernel_map), in order to
prevent uvm_map() from spuriously failing.
2008-03-23 16:39:34 +00:00
ad 3acbed8e48 Split select/poll into their own file. 2008-03-23 14:02:49 +00:00
yamt 93109cd91b when calculating some cache sizes, consider the amount of available kva.
PR/33185.
2008-03-23 10:39:52 +00:00
yamt d3bb744af3 make buf_map static. 2008-03-23 10:33:15 +00:00
rmind 579caa1e17 - Support for select/poll.
- Convert pool to pool-cache.
- Wrap long lines, adjust the license.
2008-03-23 00:44:15 +00:00
ad 40379c8716 Commit the "per-CPU" select patch. This is the result of much work and
testing by rmind@ and myself.

Which approach to use is still being discussed, but I would like to get
this out of my working tree. If we decide to use a different approach
there is no problem with revisiting this.
2008-03-22 18:04:42 +00:00
ad 5214147407 LWP_CACHE_CREDS: instead of testing (l_cred != p_cred), use a per-LWP
flag bit to indicate a pending cred update. Avoids touching one item of
shared state in the syscall path.
2008-03-22 17:53:34 +00:00
christos 4897e6c085 bring some stuff from time_t=64...
- add sysalign parameter to syscalls.conf
- add compat_50
2008-03-22 15:11:01 +00:00
ad 527a0b7dab Regen. 2008-03-22 14:20:30 +00:00
ad f5405b27b2 Unmark kevent/kqueue as MPSAFE. There seems to be some kind of deadlock
involving kernel_lock.
2008-03-22 14:20:09 +00:00
yamt 9adad93037 wrap a long line. 2008-03-22 10:24:17 +00:00
rmind cbb7f92857 unp_gc: unlock filelist_lock in a case of restart. 2008-03-21 23:38:40 +00:00
ad 40607e5bba Regen. 2008-03-21 21:59:27 +00:00
ad bc370563bc Mark kqueue/kevent MPSAFE. 2008-03-21 21:58:57 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
ad c743ad7159 File descriptor changes, discussed on tech-kern:
- Redo reference counting to be sane.  LWPs accessing files take a short
  term reference on the local file descriptor.  This is the most common
  case.  While a file is in a process descriptor table, a reference is
  held to the file.  The file reference count only changes during control
  operations like open() or close().  Code that comes at files from an
  unusual direction (i.e. foreign to the process) like procfs or sysctl
  takes a reference on the file (f_count), and not on a descriptor.

- Remove knowledge of reference counting and locking from most code that
  deals with files.

- Make the usual case of file descriptor lookup lockless.

- Make kqueue MP and MT safe. PR kern/38098, PR kern/38137.

- Fix numerous file handling bugs, and bugs in the descriptor code that
  affected multithreaded processes.

- Split descriptor system calls out into sys_descrip.c.

- A few stylistic changes: KNF, remove unused casts now that caddr_t is
  gone. Replace dumb gotos with loop control in a few places.

- Don't do redundant pointer passing (struct proc, lwp, filedesc *) unless
  the routine is likely to be inlined.  Most of the time it's about the
  current process.
2008-03-21 21:53:35 +00:00
plunky 606c30fdca add devsw_name2chr() function to look up character devices 2008-03-21 19:32:07 +00:00
ad 5e7d890908 - Extract the guts of soo_poll() into sopoll(), which takes a struct socket *.
This is for netsmb which wants to poll sockets directly.
- When polling a socket, first check for pending I/O without acquring any
  locks. If no I/O seems to be pending, acquire locks/spl and check again
  doing selrecord() if necessary.
2008-03-20 19:23:15 +00:00
ad a0bce9fd99 softint_execute: add more assertions. 2008-03-20 19:12:23 +00:00
njoly d5bb355fe9 Handle rumpcalls/rumpcallshdr differently by always defining a default
value, which can be overwritten with syscalls.conf defines (just like
sys_nosys).

This fix a problem where rump awk variables are set to 0 value,
leading to the creation of an unexpected file with that name.

ok by pooka.
2008-03-18 12:36:15 +00:00
mrg 5e0e0b0a59 need <sys/atomic.h> now. 2008-03-18 02:49:15 +00:00
ad 1b558d1305 uid_find:
- Issue membar_producer() before inserting the new uidinfo.
- Optimize slightly and fix a couple of KNF nits.
- Need sys/atomic.h.
2008-03-18 02:35:29 +00:00
rmind 33928e0f83 - Replace uihashtbl_lock and struct uidinfo::ui_lock with atomic operations.
This make uid_find(), chgproccnt(), chgsbsize() and lf_alloc(), lf_free()
  functions lock-less.
- Increase the size of uihashtbl in case of MP system, as suggested by <ad>.
- Add HASH_SLIST type for hashinit().

Reviewed by <ad>.
2008-03-17 21:16:03 +00:00
ad c796b0c73a Add a boolean parameter to syncobj_t::sobj_unsleep. If true we want the
existing behaviour: the unsleep method unlocks and wakes the swapper if
needs be. If false, the caller is doing a batch operation and will take
care of that later. This is kind of ugly, but it's difficult for the caller
to know which lock to release in some situations.
2008-03-17 18:01:44 +00:00
ad ad4f28d1e9 Make them compile again. 2008-03-17 17:05:54 +00:00
ad c42a4d1422 Add a boolean parameter to syncobj_t::sobj_unsleep. If true we want the
existing behaviour: the unsleep method unlocks and wakes the swapper if
needs be. If false, the caller is doing a batch operation and will take
care of that later. This is kind of ugly, but it's difficult for the caller
to know which lock to release in some situations.
2008-03-17 16:54:51 +00:00
yamt a67bae0b7b - simplify ASSERT_SLEEPABLE.
- move it from proc.h to systm.h.
- add some more checks.
- make it a little more lkm friendly.
2008-03-17 08:27:50 +00:00
ad 2d19d2a3e9 Process group and session structures are allocated so infrequently that
there is no point having seperate caches for them. Just use kmem_alloc().
2008-03-17 00:52:56 +00:00
rmind 05595560a2 - Initialize uihashtbl in resource_init();
- Make some variables static, remove the externs from header;
- Wrap few long lines, misc;

No functional changes are intended.
2008-03-17 00:18:24 +00:00
rmind ae5c2ec2bd Workaround the case, when l_cpu changes to l_target_cpu, and causes
the locking against oneself. Will be revisited. OK by <ad>.
2008-03-16 23:11:30 +00:00
dyoung 3df2b2feb5 Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.

        Add a 'flags' argument to suspend/resume handlers and
        callers such as pmf_system_suspend().

        Define a flag, PMF_F_SELF, which indicates to PMF that a
        device is suspending/resuming itself.  Add helper routines,
        pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
        that call pmf_device_suspend(dev, PMF_F_SELF) and
        pmf_device_resume(dev, PMF_F_SELF), respectively.  Use
        PMF_F_SELF to suspend/resume self in ath(4), audio(4),
        rtw(4), and sip(4).

        In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
        callbacks, provided by the bus front-end, with
        self-suspension/resumption.  Also, clean up the bus
        front-ends.  Make sure that the interrupt handler is
        disestablished during suspension.  Get rid of driver-private
        flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
        device_is_active()/device_has_power() calls, instead.

        In the network-class suspend handler, call if_stop(, 0)
        instead of if_stop(, 1), because the latter is superfluous
        (bus- and driver-suspension hooks will 'disable' the NIC),
        and it may cause recursion.

        In the network-class resume handler, prevent infinite
        recursion through if_init() by getting out early if we are
        self-suspending (PMF_F_SELF).

rtw(4) improvements:

        Destroy rtw(4) callouts when we detach it.  Make rtw at
        pci detachable.  Print some more information with the "rx
        frame too long" warning.

Remove activate() methods:

        Get rid of rtw_activate() and ath_activate().  The device
        activate() methods are not good for much these days.

Make ath at cardbus resume with crypto functions intact:

        Introduce a boolean device property, "pmf-powerdown".  If
        pmf-powerdown is present and false, it indicates that a
        bus back-end should not remove power from a device.

        Honor this property in cardbus_child_suspend().

        Set this property to 'false' in ath_attach(), since removing
        power from an ath at cardbus seems to lobotomize the WPA
        crypto engine.  XXX Should the pmf-powerdown property
        propagate toward the root of the device tree?

Miscellaneous ath(4) changes:

        Warn if ath(4) tries to write crypto keys to suspended
        hardware.

        Reduce differences between FreeBSD and NetBSD in ath(4)
        multicast filter setup.

        Make ath_printrxbuf() print an rx descriptor's status &
        key index, to help debug crypto errors.

        Shorten a staircase in ath_ioctl().  Don't check for
        ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 18:02:21 +00:00
ad 7b0b5fdc9d +2008 for the copyright 2008-03-12 11:05:01 +00:00
ad 727b89a296 Add a preemption counter to lwpctl_t, to allow user threads to detect that
they have been preempted.
2008-03-12 11:00:43 +00:00
pooka a5d0e14cb0 regen this too, not that it changes except for rcsid 2008-03-11 22:55:35 +00:00
pooka de0571f1e7 regen 2008-03-11 22:52:37 +00:00
pooka 5354d1092b Add locations for rump_syscalls.[hc] files 2008-03-11 22:51:51 +00:00
pooka f2976c3905 Generate syscalls entry points which can be called directly without
going through a syscall trap.  These are currently useful for rumps.
As all the standard syscalls are not compiled into librump, mark
relevant ones with RUMP in syscalls.master.  To do e.g. a mkdir
"system call" from a rump, one would call

  rump_sys_mkdir("/dir", mode, &eval);

where the last value represents something to store errno into.
2008-03-11 22:50:10 +00:00