The NetBSD Project

CVS log for src/sys/kern/kern_sleepq.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.87 / (download) - annotate - [select for diffs], Thu Nov 2 10:31:55 2023 UTC (4 months, 3 weeks ago) by martin
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.86: +12 -17 lines
Diff to previous 1.86 (colored) to selected 1.1.2.15 (colored)

Back out the following revisions on behalf of core:

	sys/sys/lwp.h: revision 1.228
	sys/sys/pipe.h: revision 1.40
	sys/kern/uipc_socket.c: revision 1.306
	sys/kern/kern_sleepq.c: revision 1.84
	sys/rump/librump/rumpkern/locks_up.c: revision 1.13
	sys/kern/sys_pipe.c: revision 1.165
	usr.bin/fstat/fstat.c: revision 1.119
	sys/rump/librump/rumpkern/locks.c: revision 1.87
	sys/ddb/db_xxx.c: revision 1.78
	sys/ddb/db_command.c: revision 1.187
	sys/sys/condvar.h: revision 1.18
	sys/ddb/db_interface.h: revision 1.42
	sys/sys/socketvar.h: revision 1.166
	sys/kern/uipc_syscalls.c: revision 1.209
	sys/kern/kern_condvar.c: revision 1.60

  Add cv_fdrestart() [...]
  Use cv_fdrestart() to implement fo_restart.
  Simplify/streamline pipes a little bit [...]

This changes have caused regressions and need to be debugged.
The cv_fdrestart() addition needs more discussion.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Oct 15 10:29:02 2023 UTC (5 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.85: +7 -6 lines
Diff to previous 1.85 (colored) to selected 1.1.2.15 (colored)

kern_sleepq.c: Sort includes.  No functional change intended.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Oct 15 10:27:11 2023 UTC (5 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.84: +3 -2 lines
Diff to previous 1.84 (colored) to selected 1.1.2.15 (colored)

sys/lwp.h: Nix sys/syncobj.h dependency.

Remove it in ddb/db_syncobj.h too.

New sys/wchan.h defines wchan_t so that users need not pull in
sys/syncobj.h to get it.

Sprinkle #include <sys/syncobj.h> in .c files where it is now needed.

Revision 1.84 / (download) - annotate - [select for diffs], Fri Oct 13 18:48:56 2023 UTC (5 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.83: +17 -12 lines
Diff to previous 1.83 (colored) to selected 1.1.2.15 (colored)

Add cv_fdrestart() (better name suggestions welcome):

Like cv_broadcast(), but make any LWPs that share the same file descriptor
table as the caller return ERESTART when resuming.  Used to dislodge LWPs
waiting for I/O that prevent a file descriptor from being closed, without
upsetting access to the file (not descriptor) made from another direction.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Oct 8 13:37:26 2023 UTC (5 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.82: +3 -3 lines
Diff to previous 1.82 (colored) to selected 1.1.2.15 (colored)

Oops, fix inverted test.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Oct 8 13:23:05 2023 UTC (5 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.81: +21 -10 lines
Diff to previous 1.81 (colored) to selected 1.1.2.15 (colored)

Ensure that an LWP that has taken a legitimate wakeup never produces an
error code from sleepq_block().  Then, it's possible to make cv_signal()
work as expected and only ever wake a singular LWP.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Oct 8 11:12:47 2023 UTC (5 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.80: +10 -6 lines
Diff to previous 1.80 (colored) to selected 1.1.2.15 (colored)

sleepq_block(): slightly reduce number of test+branch in the common case.

Revision 1.80 / (download) - annotate - [select for diffs], Sat Oct 7 20:48:50 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.79: +3 -3 lines
Diff to previous 1.79 (colored) to selected 1.1.2.15 (colored)

sleepq_uncatch(): fix typo that's been there since 2020, hello @thorpej lol:

-       l->l_flag = ~(LW_SINTR | LW_CATCHINTR | LW_STIMO);
+       l->l_flag &= ~(LW_SINTR | LW_CATCHINTR | LW_STIMO);

Revision 1.79 / (download) - annotate - [select for diffs], Sat Oct 7 14:12:29 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.78: +4 -3 lines
Diff to previous 1.78 (colored) to selected 1.1.2.15 (colored)

sleepq_uncatch(): clear LW_STIMO too, so that there's no possibility that
the newly non-interruptable sleep could produce EWOULDBLOCK (paranoia).

Revision 1.78 / (download) - annotate - [select for diffs], Thu Oct 5 19:28:30 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.77: +10 -4 lines
Diff to previous 1.77 (colored) to selected 1.1.2.15 (colored)

Resolve !MULTIPROCESSOR build problem with the nasty kernel lock macros.

Revision 1.77 / (download) - annotate - [select for diffs], Wed Oct 4 20:29:18 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.76: +9 -8 lines
Diff to previous 1.76 (colored) to selected 1.1.2.15 (colored)

Eliminate l->l_biglocks.  Originally I think it had a use but these days a
local variable will do.

Revision 1.76 / (download) - annotate - [select for diffs], Sat Sep 23 20:23:07 2023 UTC (6 months ago) by ad
Branch: MAIN
Changes since 1.75: +3 -2 lines
Diff to previous 1.75 (colored) to selected 1.1.2.15 (colored)

Sigh..  Adjust previous to work as intended.  The boosted LWP priority
didn't persist as far as the run queue because l_syncobj gets reset
earlier than I recalled.

Revision 1.75 / (download) - annotate - [select for diffs], Sat Sep 23 18:48:04 2023 UTC (6 months ago) by ad
Branch: MAIN
Changes since 1.74: +24 -4 lines
Diff to previous 1.74 (colored) to selected 1.1.2.15 (colored)

- Simplify how priority boost for blocking in kernel is handled.  Rather
  than setting it up at each site where we block, make it a property of
  syncobj_t.  Then, do not hang onto the priority boost until userret(),
  drop it as soon as the LWP is out of the run queue and onto a CPU.
  Holding onto it longer is of questionable benefit.

- This allows two members of lwp_t to be deleted, and mi_userret() to be
  simplified a lot (next step: trim it down to a single conditional).

- While here, constify syncobj_t and de-inline a bunch of small functions
  like lwp_lock() which turn out not to be small after all (I don't know
  why, but atomic_*_relaxed() seem to provoke a compiler shitfit above and
  beyond what volatile does).

Revision 1.74 / (download) - annotate - [select for diffs], Sun Apr 9 09:18:09 2023 UTC (11 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.73: +4 -3 lines
Diff to previous 1.73 (colored) to selected 1.1.2.15 (colored)

kern: KASSERT(A && B) -> KASSERT(A); KASSERT(B)

Revision 1.73 / (download) - annotate - [select for diffs], Wed Jun 29 22:27:01 2022 UTC (20 months, 4 weeks ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.72: +3 -4 lines
Diff to previous 1.72 (colored) to selected 1.1.2.15 (colored)

sleepq(9): Pass syncobj through to sleepq_block.

Previously the usage pattern was:

sleepq_enter(sq, l, lock);              // locks l
...
sleepq_enqueue(sq, ..., sobj, ...);     // assumes l locked, sets l_syncobj
... (*)
sleepq_block(...);			// unlocks l

As long as l remains locked from sleepq_enter to sleepq_block,
l_syncobj is stable, and sleepq_block uses it via ktrcsw to determine
whether the sleep is on a mutex in order to avoid creating ktrace
context-switch records (which involves allocation which is forbidden
in softint context, while taking and even sleeping for a mutex is
allowed).

However, in turnstile_block, the logic at (*) also involves
turnstile_lendpri, which sometimes unlocks and relocks l.  At that
point, another thread can swoop in and sleepq_remove l, which sets
l_syncobj to sched_syncobj.  If that happens, ktrcsw does what is
forbidden -- tries to allocate a ktrace record for the context
switch.

As an optimization, sleepq_block or turnstile_block could stop early
if it detects that l_syncobj doesn't match -- we've already been
requested to wake up at this point so there's no need to mi_switch.
(And then it would be unnecessary to pass the syncobj through
sleepq_block, because l_syncobj would remain stable.)  But I'll leave
that to another change.

Reported-by: syzbot+8b9d7b066c32dbcdc63b@syzkaller.appspotmail.com

Revision 1.72 / (download) - annotate - [select for diffs], Wed Jun 29 22:10:43 2022 UTC (20 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.71: +5 -4 lines
Diff to previous 1.71 (colored) to selected 1.1.2.15 (colored)

ktrace(9): Fix mutex detection in ktrcsw.

On _entry_ to sleepq_block, l->l_syncobj is set so that ktrcsw
(ktr_csw) has the opportunity to detect whether it's a mutex or
rwlock.  It is critical to avoid ktealloc when we're sleeping on a
mutex because we may be in softint context where ktealloc is
forbidden.

But after mi_switch, on _exit_ from sleepq_block, l->l_syncobj may
have been changed back to &sched_syncobj or something by
sleepq_remove, and so ktrcsw can no longer rely on l->l_syncobj to
determine whether we _were_ sleeping on a mutex or not.

Instead, save the syncobj in sleepq_block and pass it through as an
argument to ktrcsw.

Reported-by: syzbot+414edba9d161b7502658@syzkaller.appspotmail.com
Reported-by: syzbot+4425c97ac717b12495a2@syzkaller.appspotmail.com
Reported-by: syzbot+5812565b926ee8eb5cf3@syzkaller.appspotmail.com
Reported-by: syzbot+8b9d7b066c32dbcdc63b@syzkaller.appspotmail.com
Reported-by: syzbot+909a8e743c967d97f433@syzkaller.appspotmail.com
Reported-by: syzbot+e2a34bb5509bea0bba11@syzkaller.appspotmail.com
Reported-by: syzbot+faaea3aad6c9d0829f76@syzkaller.appspotmail.com

Revision 1.71 / (download) - annotate - [select for diffs], Fri Apr 8 10:17:55 2022 UTC (23 months, 2 weeks ago) by andvar
Branch: MAIN
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored) to selected 1.1.2.15 (colored)

fix various typos, mainly in comments, but also log messages, docs, game text.

Revision 1.70 / (download) - annotate - [select for diffs], Sat Jan 1 12:00:01 2022 UTC (2 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored) to selected 1.1.2.15 (colored)

s/happends/happens/ in comment.

Revision 1.69 / (download) - annotate - [select for diffs], Fri Oct 23 00:25:45 2020 UTC (3 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.68: +41 -7 lines
Diff to previous 1.68 (colored) to selected 1.1.2.15 (colored)

- sleepq_block(): Add a new LWP flag, LW_CATCHINTR, that is used to track
  the intent to catch signals while sleeping.  Initialize this flag based
  on the catch_p argument to sleepq_block(), and rather than test catch_p
  when awakened, test LW_CATCHINTR.  This allows the intent to change
  (based on whatever criteria the owner of the sleepq wishes) while the
  LWP is asleep.  This is separate from LW_SINTR in order to leave all
  other logic around LW_SINTR unaffected.
- In sleepq_transfer(), adjust also LW_CATCHINTR based on the catch_p
  argument.  Also allow the new LWP lock argument to be NULL, which
  will cause the lwp_setlock() call to be skipped; this allows transfer
  to another sleepq that is known to be protected by the same lock.
- Add a new function, sleepq_uncatch(), that will transition an LWP
  from "interruptible sleep" to "uninterruptible sleep" on its current
  sleepq.

Revision 1.68 / (download) - annotate - [select for diffs], Thu May 21 00:39:04 2020 UTC (3 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.67: +11 -3 lines
Diff to previous 1.67 (colored) to selected 1.1.2.15 (colored)

In sleepq_insert(), in the SOBJ_SLEEPQ_SORTED case, if there are existing
waiters of lower priority, then the new LWP will be inserted in FIFO order
with respect to other LWPs of the same priority.  However, if all other
LWPs are of equal priority to the LWP being inserted, the new LWP would
be inserted in LIFO order.

Fix this to always insert in FIFO order with respect to equal priority LWPs.

OK ad@.

Revision 1.67 / (download) - annotate - [select for diffs], Fri May 8 03:26:51 2020 UTC (3 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.66: +34 -2 lines
Diff to previous 1.66 (colored) to selected 1.1.2.15 (colored)

Add a new function, sleepq_transfer(), that moves an lwp from one
sleepq to another.

Revision 1.51.18.3 / (download) - annotate - [select for diffs], Tue Apr 21 18:42:42 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.51.18.2: +15 -8 lines
Diff to previous 1.51.18.2 (colored) to branchpoint 1.51 (colored) next main 1.52 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD

Revision 1.63.2.1 / (download) - annotate - [select for diffs], Mon Apr 20 11:29:10 2020 UTC (3 years, 11 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.63: +20 -8 lines
Diff to previous 1.63 (colored) next main 1.64 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD

Revision 1.66 / (download) - annotate - [select for diffs], Sun Apr 19 20:35:29 2020 UTC (3 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Changes since 1.65: +15 -8 lines
Diff to previous 1.65 (colored) to selected 1.1.2.15 (colored)

Set LW_SINTR earlier so it doesn't pose a problem for doing interruptable
waits with turnstiles (not currently done).

Revision 1.65 / (download) - annotate - [select for diffs], Mon Apr 13 15:54:45 2020 UTC (3 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.64: +4 -4 lines
Diff to previous 1.64 (colored) to selected 1.1.2.15 (colored)

hardclock_ticks -> getticks()

Revision 1.51.18.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:04 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.51.18.1: +8 -3 lines
Diff to previous 1.51.18.1 (colored) to branchpoint 1.51 (colored) to selected 1.1.2.15 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.64 / (download) - annotate - [select for diffs], Fri Apr 10 17:16:21 2020 UTC (3 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: phil-wifi-20200411
Changes since 1.63: +10 -5 lines
Diff to previous 1.63 (colored) to selected 1.1.2.15 (colored)

- Make this needed sequence always work for condvars, by not touching the CV
  again after wakeup.  Previously it could panic because cv_signal() could
  be called by cv_wait_sig() + others:

	cv_broadcast(cv);
	cv_destroy(cv);

- In support of the above, if an LWP doing a timed wait is awoken by
  cv_broadcast() or cv_signal(), don't return an error if the timer
  fires after the fact, i.e. either succeed or fail, not both.

- Remove LOCKDEBUG code for CVs which never worked properly and is of
  questionable use.

Revision 1.51.18.1 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:51 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.51: +49 -32 lines
Diff to previous 1.51 (colored) to selected 1.1.2.15 (colored)

Merge changes from current as of 20200406

Revision 1.63 / (download) - annotate - [select for diffs], Thu Mar 26 19:46:42 2020 UTC (4 years ago) by ad
Branch: MAIN
CVS Tags: phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.62: +11 -14 lines
Diff to previous 1.62 (colored) to selected 1.1.2.15 (colored)

Change sleepq_t from a TAILQ to a LIST and remove SOBJ_SLEEPQ_FIFO.  Only
select/poll used the FIFO method and that was for collisions which rarely
occur.  Shrinks sleep_t and condvar_t.

Revision 1.62 / (download) - annotate - [select for diffs], Tue Mar 24 21:05:06 2020 UTC (4 years ago) by ad
Branch: MAIN
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (colored) to selected 1.1.2.15 (colored)

Update a comment.

Revision 1.56.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:03 2020 UTC (4 years ago) by ad
Branch: ad-namecache
Changes since 1.56.2.1: +19 -7 lines
Diff to previous 1.56.2.1 (colored) to branchpoint 1.56 (colored) next main 1.57 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Feb 15 18:12:15 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored) to selected 1.1.2.15 (colored)

- Move the LW_RUNNING flag back into l_pflag: updating l_flag without lock
  in softint_dispatch() is risky.  May help with the "softint screwup"
  panic.

- Correct the memory barriers around zombies switching into oblivion.

Revision 1.60 / (download) - annotate - [select for diffs], Sat Feb 1 19:29:27 2020 UTC (4 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.59: +3 -3 lines
Diff to previous 1.59 (colored) to selected 1.1.2.15 (colored)

fix incorrect type

Revision 1.59 / (download) - annotate - [select for diffs], Sun Jan 26 19:01:56 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.58: +17 -5 lines
Diff to previous 1.58 (colored) to selected 1.1.2.15 (colored)

Add SOBJ_SLEEPQ_NULL: means there is no TAILQ and the caller tracks the
sleeping LWPs some other way, which sleepq_*() doesn't know about.

Revision 1.56.2.1 / (download) - annotate - [select for diffs], Fri Jan 17 21:47:35 2020 UTC (4 years, 2 months ago) by ad
Branch: ad-namecache
Changes since 1.56: +3 -4 lines
Diff to previous 1.56 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jan 12 13:08:32 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1
Changes since 1.57: +2 -3 lines
Diff to previous 1.57 (colored) to selected 1.1.2.15 (colored)

Nothing uses l->l_sleeperr any more.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Jan 8 17:38:42 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored) to selected 1.1.2.15 (colored)

Hopefully fix some problems seen with MP support on non-x86, in particular
where curcpu() is defined as curlwp->l_cpu:

- mi_switch(): undo the ~2007ish optimisation to unlock curlwp before
  calling cpu_switchto().  It's not safe to let other actors mess with the
  LWP (in particular l->l_cpu) while it's still context switching.  This
  removes l->l_ctxswtch.

- Move the LP_RUNNING flag into l->l_flag and rename to LW_RUNNING since
  it's now covered by the LWP's lock.

- Ditch lwp_exit_switchaway() and just call mi_switch() instead.  Everything
  is in cache anyway so it wasn't buying much by trying to avoid saving old
  state.  This means cpu_switchto() will never be called with prevlwp ==
  NULL.

- Remove some KERNEL_LOCK handling which hasn't been needed for years.

Revision 1.56 / (download) - annotate - [select for diffs], Tue Dec 17 18:08:15 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base
Branch point for: ad-namecache
Changes since 1.55: +8 -3 lines
Diff to previous 1.55 (colored) to selected 1.1.2.15 (colored)

Fix LOCKDEBUG panic on mutex_init().

Reported-by: syzbot+5a77339dc0a55e8d8caa@syzkaller.appspotmail.com

Revision 1.55 / (download) - annotate - [select for diffs], Mon Dec 16 19:43:36 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.54: +4 -4 lines
Diff to previous 1.54 (colored) to selected 1.1.2.15 (colored)

As with turnstiles, don't bother allocating sleepq locks with mutex_obj_alloc(),
and avoid the indirect reference.

Revision 1.54 / (download) - annotate - [select for diffs], Fri Dec 6 21:36:10 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.53: +3 -2 lines
Diff to previous 1.53 (colored) to selected 1.1.2.15 (colored)

Make it possible to call mi_switch() and immediately switch to another CPU.
This seems to take about 3us on my Intel system.  Two changes required:

- Have the caller to mi_switch() be responsible for calling spc_lock().
- Avoid using l->l_cpu in mi_switch().

While here:

- Add a couple of calls to membar_enter()
- Have the idle LWP set itself to LSIDL, to match softint_thread().
- Remove unused return value from mi_switch().

Revision 1.53 / (download) - annotate - [select for diffs], Sat Nov 23 19:42:52 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.52: +5 -4 lines
Diff to previous 1.52 (colored) to selected 1.1.2.15 (colored)

Minor scheduler cleanup:

- Adapt to cpu_need_resched() changes. Avoid lost & duplicate IPIs and ASTs.
  sched_resched_cpu() and sched_resched_lwp() contain the logic for this.
- Changes for LSIDL to make the locking scheme match the intended design.
- Reduce lock contention and false sharing further.
- Numerous small bugfixes, including some corrections for SCHED_FIFO/RT.
- Use setrunnable() in more places, and merge cut & pasted code.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Nov 21 18:56:55 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.51: +16 -14 lines
Diff to previous 1.51 (colored) to selected 1.1.2.15 (colored)

Sleep queues & turnstiles:

- Avoid false sharing.
- Make the turnstile hash function more suitable.
- Increase turnstile hash table size.
- Make amends by having only one set of system wide sleep queue hash locks.

Revision 1.47.2.3 / (download) - annotate - [select for diffs], Sun Dec 3 11:38:44 2017 UTC (6 years, 3 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.47.2.2: +4 -3 lines
Diff to previous 1.47.2.2 (colored) to branchpoint 1.47 (colored) next main 1.48 (colored) to selected 1.1.2.15 (colored)

update from HEAD

Revision 1.50.2.1 / (download) - annotate - [select for diffs], Sat Jul 9 20:25:20 2016 UTC (7 years, 8 months ago) by skrll
Branch: nick-nhusb
Changes since 1.50: +3 -2 lines
Diff to previous 1.50 (colored) next main 1.51 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD

Revision 1.51 / (download) - annotate - [select for diffs], Sun Jul 3 14:24:58 2016 UTC (7 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20191119, phil-wifi-20190609, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, isaki-audio2-base, isaki-audio2, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi
Changes since 1.50: +3 -2 lines
Diff to previous 1.50 (colored) to selected 1.1.2.15 (colored)

GSoC 2016 Charles Cui: Implement thread priority protection based on work
by Andy Doran. Also document the get/set pshared thread calls as not
implemented, and add a skeleton implementation that is disabled.
XXX: document _sched_protect(2).

Revision 1.50 / (download) - annotate - [select for diffs], Fri Sep 5 05:57:21 2014 UTC (9 years, 6 months ago) by matt
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.49: +5 -5 lines
Diff to previous 1.49 (colored) to selected 1.1.2.15 (colored)

Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.

Revision 1.47.2.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:29 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.47.2.1: +1 -2 lines
Diff to previous 1.47.2.1 (colored) to branchpoint 1.47 (colored) to selected 1.1.2.15 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.48.10.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:55:58 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.48: +3 -4 lines
Diff to previous 1.48 (colored) next main 1.49 (colored) to selected 1.1.2.15 (colored)

Rebase.

Revision 1.44.2.3 / (download) - annotate - [select for diffs], Thu May 22 11:41:03 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.44.2.2: +5 -4 lines
Diff to previous 1.44.2.2 (colored) to branchpoint 1.44 (colored) next main 1.45 (colored) to selected 1.1.2.15 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.48.6.1 / (download) - annotate - [select for diffs], Sun May 18 17:46:07 2014 UTC (9 years, 10 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.48: +3 -4 lines
Diff to previous 1.48 (colored) next main 1.49 (colored) to selected 1.1.2.15 (colored)

sync with head

Revision 1.49 / (download) - annotate - [select for diffs], Thu Apr 24 12:04:28 2014 UTC (9 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, rmind-smpnet-nbase, rmind-smpnet-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.48: +3 -4 lines
Diff to previous 1.48 (colored) to selected 1.1.2.15 (colored)

Make sleepq_wake() type void.  The return value hasn't been used in
almost 6 years.  Even if it were, returning an arbitrary lwp is a bit
of a wonky interface and can really work only when expected == 1.

Revision 1.47.2.1 / (download) - annotate - [select for diffs], Sun Jun 23 06:18:58 2013 UTC (10 years, 9 months ago) by tls
Branch: tls-maxphys
Changes since 1.47: +4 -2 lines
Diff to previous 1.47 (colored) to selected 1.1.2.15 (colored)

resync from head

Revision 1.48 / (download) - annotate - [select for diffs], Fri Mar 8 08:35:09 2013 UTC (11 years ago) by apb
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: tls-earlyentropy, rmind-smpnet
Changes since 1.47: +4 -2 lines
Diff to previous 1.47 (colored) to selected 1.1.2.15 (colored)

Add comments saying that a cv_timedwait and sleepq_block interpret
timo = 0 as an infinite timeout.  This is already documented in the
cv_timedwait(9) man page, and there is no sleeq_block(9) man page.

Revision 1.44.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:31 2012 UTC (11 years, 5 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.44.2.1: +17 -4 lines
Diff to previous 1.44.2.1 (colored) to branchpoint 1.44 (colored) to selected 1.1.2.15 (colored)

sync with head

Revision 1.47 / (download) - annotate - [select for diffs], Fri Jul 27 05:36:13 2012 UTC (11 years, 8 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.46: +17 -4 lines
Diff to previous 1.46 (colored) to selected 1.1.2.15 (colored)

Remove safepri and use IPL_SAFEPRI instead.  This may be defined in a MD
header file (if not, a value of 0 is assmued).

Revision 1.44.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:26 2012 UTC (11 years, 11 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.44: +7 -20 lines
Diff to previous 1.44 (colored) to selected 1.1.2.15 (colored)

sync with head

Revision 1.44.6.2 / (download) - annotate - [select for diffs], Fri Feb 24 09:11:47 2012 UTC (12 years, 1 month ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.44.6.1: +6 -19 lines
Diff to previous 1.44.6.1 (colored) to branchpoint 1.44 (colored) next main 1.45 (colored) to selected 1.1.2.15 (colored)

sync to -current.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Feb 19 21:06:54 2012 UTC (12 years, 1 month ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base10
Changes since 1.45: +6 -19 lines
Diff to previous 1.45 (colored) to selected 1.1.2.15 (colored)

Remove COMPAT_SA / KERN_SA.  Welcome to 6.99.3!
Approved by core@.

Revision 1.44.6.1 / (download) - annotate - [select for diffs], Sat Feb 18 07:35:31 2012 UTC (12 years, 1 month ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored) to selected 1.1.2.15 (colored)

merge to -current.

Revision 1.35.4.1 / (download) - annotate - [select for diffs], Sat Feb 4 16:57:58 2012 UTC (12 years, 1 month ago) by bouyer
Branch: netbsd-5
CVS Tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2
Changes since 1.35: +5 -3 lines
Diff to previous 1.35 (colored) next main 1.36 (colored) to selected 1.1.2.15 (colored)

Apply patch, requested by jmcneill in ticket #1668:
	sys/arch/amd64/amd64/syscall.c			patch
	sys/arch/i386/i386/syscall.c			patch
	sys/arch/i386/i386/trap.c			patch
	sys/kern/kern_sig.c				patch
	sys/kern/kern_sleepq.c				patch
	sys/kern/kern_subr.c				patch
	sys/kern/sys_process.c				patch
	sys/secmodel/bsd44/secmodel_bsd44_suser.c	patch
	sys/sys/proc.h					patch
	sys/sys/ptrace.h				patch

arch/i386/i386/machdep.c, arch/amd64/amd64/machdep.c (from
arch/x86/x86/machdep.c) by christos:
Remove code that was used to avoid register spills. setcontext(2) can change
the registers, so re-fetching will produce the wrong result for trace_exit().
arch/i386/i386/trap.c by reinoud:
Fix the illegal instruction return address. It was using the value of the
cpu's %cr2 register but thats not valid:

CR2 Contains a value called Page Fault Linear Address (PFLA). When a page
fault occurs, the address the program attempted to access is stored in the CR2
register.

And this is thus NOT the illegal instruction address!
kern/kern_sig.c by christos:
PR kern/45327: Jared McNeill: ptrace: siginfo doesn't work with traced processes
When saving the signal in p->p_xstat, clear it from the pending mask, but
don't remove it from the siginfo queue, so that next time the debugger
delivers it, the original information is found.
When posting a signal from the debugger l->l_sigpendset is not set, so we
use the process pending signal and add it back to the process pending set.
Split sigget into sigget() and siggetinfo(). When a signal comes from the
debugger (l->l_sigpendset == NULL), using siggetinfo() try to fetch the
siginfo information from l->l_sigpend and then from p->p_sigpend if it
was not found. This allows us to pass siginfo information for traps from
the debugger.
don't delete signal from the debugger.
kern/kern_sleepq.c by christos:
PR kern/40594: Antti Kantee: Don't call issignal() here to determine what errno
to set for the interrupted syscall, because issignal() will consume the signal
and it will not be delivered to the process afterwards. Instead call
sigispending() (which now returns the first pending signal) and does not
consume the signal.
We need to process SA_STOP signals immediately, and not deliver them to
the process. Instead of re-structuring the code to do that, call issignal()
like before in that case. (tail -F /file^Zfg should not get interrupted).
kern/kern_subr.c by jmcneill, christos:
PR kern/45312: ptrace: PT_SETREGS can't alter system calls

Add a new PT_SYSCALLEMU request that cancels the current syscall, for
use with PT_SYSCALL.
For PT_SYSCALLEMU, no need to stop again on syscall exit.
ifdef unused variable with -UPTRACE

kern/sys_process.c, sys/proc.h, sys/ptrace.h, secmodel/bsd44/secmodel_bsd44_suser.c by jmcneill, christos:
PR kern/43681: PT_SYSCALL appears to be broken

sys_ptrace: For PT_CONTINUE/PT_SYSCALL/PT_DETACH, modify the p_trace_enabled
flag of the target process, not the calling process.
Process the signal now, otherwise calling issignal() and ignoring
the return will lose the signal if it came from the debugger
(issignal() clears p->p_xstat)
PR kern/45312: ptrace: PT_SETREGS can't alter system calls

Add a new PT_SYSCALLEMU request that cancels the current syscall, for
use with PT_SYSCALL.
PR kern/45330: ptrace: signals can alter syscall return values

process_stoptrace: defer signal processing to userret, ok christos@

Revision 1.45 / (download) - annotate - [select for diffs], Sat Jan 28 12:22:33 2012 UTC (12 years, 2 months ago) by rmind
Branch: MAIN
CVS Tags: netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base2
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored) to selected 1.1.2.15 (colored)

Remove obsolete ltsleep(9) and wakeup_one(9).

Revision 1.44 / (download) - annotate - [select for diffs], Mon Oct 31 12:18:32 2011 UTC (12 years, 5 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.43: +30 -39 lines
Diff to previous 1.43 (colored) to selected 1.1.2.15 (colored)

- make lendpri/changepri similar.
- make common code a subroutine.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Sep 3 10:28:33 2011 UTC (12 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.42: +5 -3 lines
Diff to previous 1.42 (colored) to selected 1.1.2.15 (colored)

We need to process SA_STOP signals immediately, and not deliver them to
the process. Instead of re-structuring the code to do that, call issignal()
like before in that case. (tail -F /file^Zfg should not get interrupted).

Revision 1.42 / (download) - annotate - [select for diffs], Wed Aug 31 16:09:55 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored) to selected 1.1.2.15 (colored)

PR/40594: Antti Kantee: Don't call issignal() here to determine what errno
to set for the interrupted syscall, because issignal() will consume the signal
and it will not be delivered to the process afterwards. Instead call
sigispending() (which now returns the first pending signal) and does not
consume the signal.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Jul 27 14:35:34 2011 UTC (12 years, 8 months ago) by uebayasi
Branch: MAIN
Changes since 1.40: +2 -4 lines
Diff to previous 1.40 (colored) to selected 1.1.2.15 (colored)

These don't need uvm/uvm_extern.h.

Revision 1.40 / (download) - annotate - [select for diffs], Tue Jul 26 13:04:51 2011 UTC (12 years, 8 months ago) by yamt
Branch: MAIN
Changes since 1.39: +5 -4 lines
Diff to previous 1.39 (colored) to selected 1.1.2.15 (colored)

sleepq_insert: call lwp_eprio only when necessary

Revision 1.37.6.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:31 2011 UTC (12 years, 9 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.37: +6 -6 lines
Diff to previous 1.37 (colored) next main 1.38 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.37.4.1 / (download) - annotate - [select for diffs], Tue May 31 03:05:02 2011 UTC (12 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.37: +6 -6 lines
Diff to previous 1.37 (colored) next main 1.38 (colored) to selected 1.1.2.15 (colored)

sync with head

Revision 1.39 / (download) - annotate - [select for diffs], Fri May 13 22:19:41 2011 UTC (12 years, 10 months ago) by rmind
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.38: +5 -5 lines
Diff to previous 1.38 (colored) to selected 1.1.2.15 (colored)

Sprinkle __cacheline_aligned and __read_mostly, make some functions static.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Apr 27 08:32:42 2011 UTC (12 years, 11 months ago) by plunky
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored) to selected 1.1.2.15 (colored)

drop inline here, to avoid C99 vs GNU differences

Revision 1.27.2.3 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:17 2010 UTC (14 years ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.27.2.2: +10 -32 lines
Diff to previous 1.27.2.2 (colored) to branchpoint 1.27 (colored) next main 1.28 (colored) to selected 1.1.2.15 (colored)

sync with head

Revision 1.37 / (download) - annotate - [select for diffs], Wed Oct 21 21:12:06 2009 UTC (14 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, matt-premerge-20091211, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: rmind-uvmplock, jruoho-x86intr
Changes since 1.36: +10 -32 lines
Diff to previous 1.36 (colored) to selected 1.1.2.15 (colored)

Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.

Revision 1.35.8.1 / (download) - annotate - [select for diffs], Wed May 13 17:21:56 2009 UTC (14 years, 10 months ago) by jym
Branch: jym-xensuspend
Changes since 1.35: +5 -5 lines
Diff to previous 1.35 (colored) next main 1.36 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.27.2.2 / (download) - annotate - [select for diffs], Mon May 4 08:13:47 2009 UTC (14 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.27.2.1: +94 -51 lines
Diff to previous 1.27.2.1 (colored) to branchpoint 1.27 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Tue Apr 28 07:36:59 2009 UTC (14 years, 11 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.35: +5 -5 lines
Diff to previous 1.35 (colored) next main 1.36 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Mar 21 13:11:14 2009 UTC (15 years ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jymxensuspend-base, jym-xensuspend-base
Changes since 1.35: +5 -5 lines
Diff to previous 1.35 (colored) to selected 1.1.2.15 (colored)

Allocate sleep queue locks with mutex_obj_alloc. Reduces memory usage
on !MP kernels, and reduces false sharing on MP ones.

Revision 1.21.6.5 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:19 2009 UTC (15 years, 2 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.21.6.4: +15 -1 lines
Diff to previous 1.21.6.4 (colored) to branchpoint 1.21 (colored) next main 1.22 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.33.2.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:17:28 2008 UTC (15 years, 5 months ago) by haad
Branch: haad-dm
Changes since 1.33: +20 -5 lines
Diff to previous 1.33 (colored) next main 1.34 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.35 / (download) - annotate - [select for diffs], Wed Oct 15 06:51:20 2008 UTC (15 years, 5 months ago) by wrstuden
Branch: MAIN
CVS Tags: nick-hppapmap-base2, netbsd-5-base, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, mjf-devfs2-base, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap, netbsd-5, jym-xensuspend
Changes since 1.34: +17 -3 lines
Diff to previous 1.34 (colored) to selected 1.1.2.15 (colored)

Merge wrstuden-revivesa into HEAD.

Revision 1.21.6.4 / (download) - annotate - [select for diffs], Sun Sep 28 10:40:52 2008 UTC (15 years, 6 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.21.6.3: +3 -2 lines
Diff to previous 1.21.6.3 (colored) to branchpoint 1.21 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.28.2.5 / (download) - annotate - [select for diffs], Thu Sep 18 04:31:42 2008 UTC (15 years, 6 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.28.2.4: +5 -4 lines
Diff to previous 1.28.2.4 (colored) to branchpoint 1.28 (colored) next main 1.29 (colored) to selected 1.1.2.15 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Aug 11 02:36:25 2008 UTC (15 years, 7 months ago) by yamt
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2
Changes since 1.33: +5 -4 lines
Diff to previous 1.33 (colored) to selected 1.1.2.15 (colored)

sleepq_block: fix a bug to lose biglocks in the case of recursive calls.

this fixes pf rb-tree corruption on my box.

Revision 1.28.2.4 / (download) - annotate - [select for diffs], Mon Jul 21 19:13:45 2008 UTC (15 years, 8 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.28.2.3: +8 -2 lines
Diff to previous 1.28.2.3 (colored) to branchpoint 1.28 (colored) to selected 1.1.2.15 (colored)

Add support for compiling SA as an option. Implied by COMPAT_40.

i386 kernels both with COMPAT_40 and with no compat options (and thus
no SA) compile.

No functional changes intended.

Revision 1.28.2.3 / (download) - annotate - [select for diffs], Mon Jun 30 04:55:56 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.28.2.2: +3 -3 lines
Diff to previous 1.28.2.2 (colored) to branchpoint 1.28 (colored) to selected 1.1.2.15 (colored)

Change how we make SA threads not generate upcalls. Instead of clearing
LW_SA, use a private flag, LP_SA_NOBLOCK, that we set when we want
to not generate upcalls. This means we do NOT need to lock (l)
(ourselves) to set it.

Adjust tests that look at LW_SA. Now, we are an upcall-generating
lwp if ((l->l_flag & LW_SA) && (~l->l_pflag & LP_SA_NOBLOCK)).

Introduce code pattern to set & remember this:

	f = ~l->l_pflag & LP_SA_NOBLOCK;
	l->l_pflag |= LP_SA_NOBLOCK;

	...

	/* f is now LP_SA_NOBLOCK if it wasn't set in l_pflag before */

	l->l_pflag ^= f;

I updated a lot of the trap handlers to do trap handling iff LP_SA_NOBLOCK
is not set. I tried to figure out if the trap handler could be triggered
for user-based faults as opposed to kernel faults to user addresses, and
only look at LP_SA_NOBLOCK for the latter.

Above is a result of discussions with rmind at to reduce lock twiddling.

Also, per same discussions, add locking to sys_sa_preempt(). p_lock is
the lock we want.

Also, per same discussions, remove use of LSSUSPENDED as a thread state.
We needed to use it when we were emulating the 4.X and previous behavior
of hiding cached threads. For the moment, we now have them instead
remain visible to all and have them sleeping on the "lwpcache" wait
channel.

sa_newcachelwp(): sa_putcachelwp() wants savp_mutex held, not p_lock.

Tweak some comments.

Revision 1.21.6.3 / (download) - annotate - [select for diffs], Sun Jun 29 09:33:14 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.21.6.2: +42 -7 lines
Diff to previous 1.21.6.2 (colored) to branchpoint 1.21 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.28.2.2 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:51 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.28.2.1: +75 -47 lines
Diff to previous 1.28.2.1 (colored) to branchpoint 1.28 (colored) to selected 1.1.2.15 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.31.2.1 / (download) - annotate - [select for diffs], Wed Jun 18 16:33:35 2008 UTC (15 years, 9 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.31: +44 -9 lines
Diff to previous 1.31 (colored) next main 1.32 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.25.2.3 / (download) - annotate - [select for diffs], Tue Jun 17 09:15:03 2008 UTC (15 years, 9 months ago) by yamt
Branch: yamt-pf42
Changes since 1.25.2.2: +37 -9 lines
Diff to previous 1.25.2.2 (colored) to branchpoint 1.25 (colored) next main 1.26 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jun 17 09:11:25 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base
Branch point for: haad-dm
Changes since 1.32: +9 -2 lines
Diff to previous 1.32 (colored) to selected 1.1.2.15 (colored)

sleepq_block: add a comment.

Revision 1.32 / (download) - annotate - [select for diffs], Mon Jun 16 10:02:15 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4
Changes since 1.31: +37 -9 lines
Diff to previous 1.31 (colored) to selected 1.1.2.15 (colored)

PR kern/38761: new (?) race in buffer cache code

sleepq_changepri, sleepq_lendpri: don't let an active sleep queue head become
empty. The condvar code inspects the queue head without holding the sleep
queue lock and needs to see a non-empty queue if there are waiters.

Revision 1.25.2.2 / (download) - annotate - [select for diffs], Wed Jun 4 02:05:39 2008 UTC (15 years, 9 months ago) by yamt
Branch: yamt-pf42
Changes since 1.25.2.1: +35 -42 lines
Diff to previous 1.25.2.1 (colored) to branchpoint 1.25 (colored) to selected 1.1.2.15 (colored)

sync with head

Revision 1.21.6.2 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:09 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.21.6.1: +37 -58 lines
Diff to previous 1.21.6.1 (colored) to branchpoint 1.21 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.31 / (download) - annotate - [select for diffs], Sat May 31 21:26:01 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base3
Branch point for: simonb-wapbl
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored) to selected 1.1.2.15 (colored)

PR kern/38812 race between lwp_exit_switchaway and exit1/coredump

Move the LWP RUNNING and TIMEINTR flags into the thread-private flag word.

Revision 1.30 / (download) - annotate - [select for diffs], Mon May 26 12:08:38 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.29: +26 -37 lines
Diff to previous 1.29 (colored) to selected 1.1.2.15 (colored)

Take the mutex pointer and waiters count out of sleepq_t: the values can
be or are maintained elsewhere. Now a sleepq_t is just a TAILQ_HEAD.

Revision 1.28.2.1 / (download) - annotate - [select for diffs], Fri May 23 05:24:16 2008 UTC (15 years, 10 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.28: +11 -3 lines
Diff to previous 1.28 (colored) to selected 1.1.2.15 (colored)

Re-add calls to sa_awaken() and sa_switch(). Also add
back sa_awaken() itself. While here, remove the "type"
arguement to sa_switch() - it is all about generating
blocked upcalls.

Revision 1.29 / (download) - annotate - [select for diffs], Mon May 19 12:48:54 2008 UTC (15 years, 10 months ago) by rmind
Branch: MAIN
CVS Tags: hpcarm-cleanup-nbase
Changes since 1.28: +10 -6 lines
Diff to previous 1.28 (colored) to selected 1.1.2.15 (colored)

- Make periodical balancing mandatory.
- Fix priority raising in M2 (broken after making runqueues mandatory).

Revision 1.25.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:35:08 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.25: +6 -13 lines
Diff to previous 1.25 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.27.2.1 / (download) - annotate - [select for diffs], Fri May 16 02:25:25 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.27: +2 -9 lines
Diff to previous 1.27 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:03 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2
Branch point for: wrstuden-revivesa
Changes since 1.27: +2 -9 lines
Diff to previous 1.27 (colored) to selected 1.1.2.15 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.27 / (download) - annotate - [select for diffs], Thu Apr 24 18:39:24 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored) to selected 1.1.2.15 (colored)

Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Apr 22 12:04:22 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored) to selected 1.1.2.15 (colored)

Give callout_halt() an additional 'kmutex_t *interlock' argument. If there
is a need to block and wait for the callout to complete, and there is an
interlock, it will be dropped while waiting and reacquired before return.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Apr 12 17:02:08 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.24: +2 -9 lines
Diff to previous 1.24 (colored) to selected 1.1.2.15 (colored)

Take the run queue management code from the M2 scheduler, and make it
mandatory. Remove the 4BSD run queue code. Effects:

- Pluggable scheduler is only responsible for co-ordinating timeshared jobs.
- All systems run with per-CPU run queues.
- 4BSD scheduler gets processor sets / affinity.
- 4BSD scheduler gets a significant peformance boost on some workloads.

Discussed on tech-kern@.

Revision 1.24 / (download) - annotate - [select for diffs], Sat Apr 5 13:58:12 2008 UTC (15 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored) to selected 1.1.2.15 (colored)

assertions.

Revision 1.21.6.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:43:02 2008 UTC (15 years, 11 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.21: +15 -11 lines
Diff to previous 1.21 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Mar 28 20:48:36 2008 UTC (16 years ago) by ad
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored) to selected 1.1.2.15 (colored)

sleepq_block: use callout_halt, as we have to wait for the callout to
stop (it might be running on another CPU). Otherwise, 'curlwp' could
exit before it completes.

Revision 1.5.2.9 / (download) - annotate - [select for diffs], Mon Mar 24 09:39:02 2008 UTC (16 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5.2.8: +14 -10 lines
Diff to previous 1.5.2.8 (colored) next main 1.6 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.21.2.1 / (download) - annotate - [select for diffs], Mon Mar 24 07:16:13 2008 UTC (16 years ago) by keiichi
Branch: keiichi-mipv6
Changes since 1.21: +14 -10 lines
Diff to previous 1.21 (colored) next main 1.22 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.12.2.3 / (download) - annotate - [select for diffs], Sun Mar 23 02:04:59 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.12.2.2: +16 -12 lines
Diff to previous 1.12.2.2 (colored) next main 1.13 (colored) to selected 1.1.2.15 (colored)

sync with HEAD

Revision 1.22 / (download) - annotate - [select for diffs], Mon Mar 17 16:54:51 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Changes since 1.21: +14 -10 lines
Diff to previous 1.21 (colored) to selected 1.1.2.15 (colored)

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.

Revision 1.5.2.8 / (download) - annotate - [select for diffs], Wed Feb 27 08:36:55 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5.2.7: +4 -4 lines
Diff to previous 1.5.2.7 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.17.4.3 / (download) - annotate - [select for diffs], Mon Feb 18 21:06:46 2008 UTC (16 years, 1 month ago) by mjf
Branch: mjf-devfs
Changes since 1.17.4.2: +4 -5 lines
Diff to previous 1.17.4.2 (colored) to branchpoint 1.17 (colored) next main 1.18 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Feb 14 14:26:57 2008 UTC (16 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (colored) to selected 1.1.2.15 (colored)

Make schedstate_percpu::spc_lwplock an exernally allocated item. Remove
the hacks in sparc/cpu.c to reinitialize it. This should be in its own
cache line but that's another change.

Revision 1.5.2.7 / (download) - annotate - [select for diffs], Mon Jan 21 09:46:12 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5.2.6: +2 -3 lines
Diff to previous 1.5.2.6 (colored) to selected 1.1.2.15 (colored)

sync with head

Revision 1.12.2.2 / (download) - annotate - [select for diffs], Wed Jan 9 01:56:09 2008 UTC (16 years, 2 months ago) by matt
Branch: matt-armv6
Changes since 1.12.2.1: +4 -4 lines
Diff to previous 1.12.2.1 (colored) to selected 1.1.2.15 (colored)

sync with HEAD

Revision 1.19.4.1 / (download) - annotate - [select for diffs], Tue Jan 8 22:11:35 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.19: +2 -3 lines
Diff to previous 1.19 (colored) next main 1.20 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jan 4 21:18:10 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.19: +2 -3 lines
Diff to previous 1.19 (colored) to selected 1.1.2.15 (colored)

Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.

Revision 1.11.2.6 / (download) - annotate - [select for diffs], Sun Dec 9 19:38:20 2007 UTC (16 years, 3 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.11.2.5: +4 -3 lines
Diff to previous 1.11.2.5 (colored) to branchpoint 1.11 (colored) next main 1.12 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.17.4.2 / (download) - annotate - [select for diffs], Sat Dec 8 18:20:31 2007 UTC (16 years, 3 months ago) by mjf
Branch: mjf-devfs
Changes since 1.17.4.1: +4 -3 lines
Diff to previous 1.17.4.1 (colored) to branchpoint 1.17 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.18.2.1 / (download) - annotate - [select for diffs], Sat Dec 8 17:57:43 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.18: +4 -3 lines
Diff to previous 1.18 (colored) next main 1.19 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.5.2.6 / (download) - annotate - [select for diffs], Fri Dec 7 17:32:49 2007 UTC (16 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5.2.5: +4 -3 lines
Diff to previous 1.5.2.5 (colored) to selected 1.1.2.15 (colored)

sync with head

Revision 1.19 / (download) - annotate - [select for diffs], Wed Dec 5 07:06:53 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: bouyer-xeni386
Changes since 1.18: +4 -3 lines
Diff to previous 1.18 (colored) to selected 1.1.2.15 (colored)

Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.

Revision 1.17.4.1 / (download) - annotate - [select for diffs], Mon Nov 19 00:48:42 2007 UTC (16 years, 4 months ago) by mjf
Branch: mjf-devfs
Changes since 1.17: +17 -17 lines
Diff to previous 1.17 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.5.2.5 / (download) - annotate - [select for diffs], Thu Nov 15 11:44:44 2007 UTC (16 years, 4 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5.2.4: +17 -17 lines
Diff to previous 1.5.2.4 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.17.2.1 / (download) - annotate - [select for diffs], Tue Nov 13 16:02:11 2007 UTC (16 years, 4 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.17: +15 -15 lines
Diff to previous 1.17 (colored) next main 1.18 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD

Revision 1.12.2.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:31:57 2007 UTC (16 years, 4 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.12: +45 -27 lines
Diff to previous 1.12 (colored) to selected 1.1.2.15 (colored)

sync with HEAD

Revision 1.11.2.5 / (download) - annotate - [select for diffs], Tue Nov 6 19:25:30 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.11.2.4: +17 -17 lines
Diff to previous 1.11.2.4 (colored) to branchpoint 1.11 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Nov 6 00:42:42 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base1, vmlocking-nbase, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: vmlocking2
Changes since 1.17: +17 -17 lines
Diff to previous 1.17 (colored) to selected 1.1.2.15 (colored)

Merge scheduler changes from the vmlocking branch. All discussed on
tech-kern:

- Invert priority space so that zero is the lowest priority. Rearrange
  number and type of priority levels into bands. Add new bands like
  'kernel real time'.
- Ignore the priority level passed to tsleep. Compute priority for
  sleep dynamically.
- For SCHED_4BSD, make priority adjustment per-LWP, not per-process.

Revision 1.7.2.20 / (download) - annotate - [select for diffs], Thu Nov 1 21:58:19 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.19: +4 -8 lines
Diff to previous 1.7.2.19 (colored) next main 1.8 (colored) to selected 1.1.2.15 (colored)

- Fix interactivity problems under high load. Beacuse soft interrupts
  are being stacked on top of regular LWPs, more often than not aston()
  was being called on a soft interrupt thread instead of a user thread,
  meaning that preemption was not happening on EOI.

- Don't use bool in a couple of data structures. Sub-word writes are not
  always atomic and may clobber other fields in the containing word.

- For SCHED_4BSD, make p_estcpu per thread (l_estcpu). Rework how the
  dynamic priority level is calculated - it's much better behaved now.

- Kill the l_usrpri/l_priority split now that priorities are no longer
  directly assigned by tsleep(). There are three fields describing LWP
  priority:

        l_priority: Dynamic priority calculated by the scheduler.
                This does not change for kernel/realtime threads,
                and always stays within the correct band. Eg for
                timeshared LWPs it never moves out of the user
                priority range. This is basically what l_usrpri
                was before.

        l_inheritedprio: Lent to the LWP due to priority inheritance
                (turnstiles).

        l_kpriority: A boolean value set true the first time an LWP
                sleeps within the kernel. This indicates that the LWP
                should get a priority boost as compensation for blocking.
                lwp_eprio() now does the equivalent of sched_kpri() if
                the flag is set. The flag is cleared in userret().

- Keep track of scheduling class (OTHER, FIFO, RR) in struct lwp, and use
  this to make decisions in a few places where we previously tested for a
  kernel thread.

- Partially fix itimers and usr/sys/intr time accounting in the presence
  of software interrupts.

- Use kthread_create() to create idle LWPs. Move priority definitions
  from the various modules into sys/param.h.

- newlwp -> lwp_create

Revision 1.5.2.4 / (download) - annotate - [select for diffs], Sat Oct 27 11:35:27 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5.2.3: +33 -14 lines
Diff to previous 1.5.2.3 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.11.2.4 / (download) - annotate - [select for diffs], Fri Oct 26 15:48:35 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.11.2.3: +13 -5 lines
Diff to previous 1.11.2.3 (colored) to branchpoint 1.11 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.7.2.19 / (download) - annotate - [select for diffs], Tue Oct 23 20:17:12 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.18: +3 -4 lines
Diff to previous 1.7.2.18 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.14.2.2 / (download) - annotate - [select for diffs], Thu Oct 18 08:33:12 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.14.2.1: +3 -4 lines
Diff to previous 1.14.2.1 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.7.2.18 / (download) - annotate - [select for diffs], Tue Oct 16 15:34:05 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.17: +5 -9 lines
Diff to previous 1.7.2.17 (colored) to selected 1.1.2.15 (colored)

Restore previous wakeup/preemption behaviour. May fix problems with gxine.
This has very little effect with SCHED_M2, possibly because threads are less
likely to migrate, and because a number of issues with contention on user
space objects has been fixed.

Revision 1.7.2.17 / (download) - annotate - [select for diffs], Tue Oct 16 10:53:25 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.16: +4 -4 lines
Diff to previous 1.7.2.16 (colored) to selected 1.1.2.15 (colored)

Fix scheduler priority lossage. From rmind@.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Oct 14 14:23:12 2007 UTC (16 years, 5 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-x86pmap-base4
Branch point for: mjf-devfs, bouyer-xenamd64
Changes since 1.16: +3 -4 lines
Diff to previous 1.16 (colored) to selected 1.1.2.15 (colored)

sleepq_remove: remove a stale comment.

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Sun Oct 14 11:48:42 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.14: +12 -3 lines
Diff to previous 1.14 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.7.2.16 / (download) - annotate - [select for diffs], Sat Oct 13 01:16:57 2007 UTC (16 years, 5 months ago) by rmind
Branch: vmlocking
Changes since 1.7.2.15: +11 -9 lines
Diff to previous 1.7.2.15 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD (pull-up a fix).

Revision 1.16 / (download) - annotate - [select for diffs], Sat Oct 13 00:13:05 2007 UTC (16 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-x86pmap-base3, vmlocking-base
Changes since 1.15: +11 -9 lines
Diff to previous 1.15 (colored) to selected 1.1.2.15 (colored)

sleepq_remove: Do not call sched_wakeup() when thread is running.
This fixes a locking problem, when l_cpu is changed in LSONPROC state.
Possible case was noted by <ad>.

Revision 1.7.2.15 / (download) - annotate - [select for diffs], Wed Oct 10 23:03:23 2007 UTC (16 years, 5 months ago) by rmind
Branch: vmlocking
Changes since 1.7.2.14: +9 -2 lines
Diff to previous 1.7.2.14 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Oct 9 19:00:14 2007 UTC (16 years, 5 months ago) by rmind
Branch: MAIN
Changes since 1.14: +9 -2 lines
Diff to previous 1.14 (colored) to selected 1.1.2.15 (colored)

Import of SCHED_M2 - the implementation of new scheduler, which is based
on the original approach of SVR4 with some inspirations about balancing
and migration from Solaris.  It implements per-CPU runqueues, provides a
real-time (RT) and time-sharing (TS) queues, ready to support a POSIX
real-time extensions, and also prepared for the support of CPU affinity.

The following lines in the kernel config enables the SCHED_M2:

no options SCHED_4BSD
options SCHED_M2

The scheduler seems to be stable.  Further work will come soon.

http://mail-index.netbsd.org/tech-kern/2007/10/04/0001.html
http://www.netbsd.org/~rmind/m2/mysql_bench_ro_4x_local.png
Thanks <ad> for the benchmarks!

Revision 1.7.2.14 / (download) - annotate - [select for diffs], Tue Oct 9 15:22:20 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.13: +22 -23 lines
Diff to previous 1.7.2.13 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.7.2.13 / (download) - annotate - [select for diffs], Tue Oct 9 13:44:28 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.12: +5 -4 lines
Diff to previous 1.7.2.12 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.11.2.3 / (download) - annotate - [select for diffs], Tue Oct 2 18:29:02 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.11.2.2: +22 -11 lines
Diff to previous 1.11.2.2 (colored) to branchpoint 1.11 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.10.2.3 / (download) - annotate - [select for diffs], Mon Sep 10 10:56:00 2007 UTC (16 years, 6 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.10.2.2: +22 -11 lines
Diff to previous 1.10.2.2 (colored) to branchpoint 1.10 (colored) next main 1.11 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.7.2.12 / (download) - annotate - [select for diffs], Sun Sep 9 23:12:20 2007 UTC (16 years, 6 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.11: +25 -12 lines
Diff to previous 1.7.2.11 (colored) to selected 1.1.2.15 (colored)

Sync with _lwp_park/priority changes on HEAD.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Sep 6 23:59:01 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base2, yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap
Changes since 1.13: +22 -11 lines
Diff to previous 1.13 (colored) to selected 1.1.2.15 (colored)

- Fix sleepq_block() to return EINTR if the LWP is cancelled. Pointed out
  by yamt@.

- Introduce SOBJ_SLEEPQ_LIFO, and use for LWPs sleeping via _lwp_park.
  libpthread enqueues most waiters in LIFO order to try and wake LWPs that
  ran recently, since their working set is more likely to be in cache.
  Matching the order of insertion reduces the time spent searching queues
  in the kernel.

- Do not boost the priority of LWPs sleeping in _lwp_park, just let them
  sleep at their user priority level. LWPs waiting for some I/O event in
  the kernel still wait with kernel priority and get woken more quickly.
  This needs more evaluation and is to be revisited, but the effect on a
  variety of benchmarks is positive.

- When waking LWPs, do not send an IPI to remote CPUs or arrange for the
  current LWP to be preempted unless (a) the thread being awoken has kernel
  priority and has higher priority than the currently running thread or (b)
  the remote CPU is idle.

Revision 1.11.2.2 / (download) - annotate - [select for diffs], Mon Sep 3 16:48:48 2007 UTC (16 years, 6 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.11.2.1: +6 -7 lines
Diff to previous 1.11.2.1 (colored) to branchpoint 1.11 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.5.2.3 / (download) - annotate - [select for diffs], Mon Sep 3 14:40:55 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5.2.2: +93 -119 lines
Diff to previous 1.5.2.2 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.10.2.2 / (download) - annotate - [select for diffs], Mon Sep 3 10:23:00 2007 UTC (16 years, 6 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.10.2.1: +8 -19 lines
Diff to previous 1.10.2.1 (colored) to branchpoint 1.10 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Aug 31 15:27:18 2007 UTC (16 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.12: +6 -7 lines
Diff to previous 1.12 (colored) to selected 1.1.2.15 (colored)

pull the following change from vmlocking branch.

	revision 1.7.2.10
	date: 2007/08/27 12:51:13;  author: yamt;  state: Exp;  lines: +6 -7
	sleepq_block: don't call lwp_unsleep twice.
	(fix an assertion failure in lwp_unsleep.)

Revision 1.7.2.11 / (download) - annotate - [select for diffs], Thu Aug 30 12:59:52 2007 UTC (16 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.10: +8 -4 lines
Diff to previous 1.7.2.10 (colored) to selected 1.1.2.15 (colored)

When awakening a thread on a remote CPU, if it has kernel priority or higher
then use RESCHED_IMMED. This is important for rwlocks, since they do direct
handoff. If the owner does not run soon then other threads trying to acquire
the lock will back up waiting for the running thread to be preempted due to
some other event, and the lock can become a chokepoint. I suspect this may
also fix a loss of interactivity when the boot CPU (or whichever CPU is
handling most device interrupts) is taken offline with cpuctl on a busy
system.

Revision 1.7.2.10 / (download) - annotate - [select for diffs], Mon Aug 27 12:51:13 2007 UTC (16 years, 7 months ago) by yamt
Branch: vmlocking
Changes since 1.7.2.9: +6 -7 lines
Diff to previous 1.7.2.9 (colored) to selected 1.1.2.15 (colored)

sleepq_block: don't call lwp_unsleep twice.
(fix an assertion failure in lwp_unsleep.)

Revision 1.7.2.9 / (download) - annotate - [select for diffs], Wed Aug 22 11:42:41 2007 UTC (16 years, 7 months ago) by yamt
Branch: vmlocking
Changes since 1.7.2.8: +3 -3 lines
Diff to previous 1.7.2.8 (colored) to selected 1.1.2.15 (colored)

sleepq_block: fix a merge botch.  (s/error/early/)

Revision 1.7.2.8 / (download) - annotate - [select for diffs], Mon Aug 20 21:27:33 2007 UTC (16 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.7: +21 -31 lines
Diff to previous 1.7.2.7 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.11.2.1 / (download) - annotate - [select for diffs], Thu Aug 16 11:03:33 2007 UTC (16 years, 7 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.11: +4 -14 lines
Diff to previous 1.11 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Wed Aug 15 13:49:09 2007 UTC (16 years, 7 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.10: +19 -22 lines
Diff to previous 1.10 (colored) to selected 1.1.2.15 (colored)

Sync with HEAD.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Aug 15 12:07:33 2007 UTC (16 years, 7 months ago) by ad
Branch: MAIN
Branch point for: matt-armv6
Changes since 1.11: +4 -14 lines
Diff to previous 1.11 (colored) to selected 1.1.2.15 (colored)

Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.

Revision 1.11.4.2 / (download) - annotate - [select for diffs], Wed Aug 1 23:30:55 2007 UTC (16 years, 8 months ago) by ad
Branch: matt-mips64
Changes since 1.11.4.1: +471 -0 lines
Diff to previous 1.11.4.1 (colored) to branchpoint 1.11 (colored) next main 1.12 (colored) to selected 1.1.2.15 (colored)

sleepq_block: if a pending signal is detected but has already been taken
by the time the calling thread tries to take it, don't return EINTR.
Instead return zero leading to a spurious wakeup.

Revision 1.11.4.1, Wed Aug 1 23:30:54 2007 UTC (16 years, 8 months ago) by ad
Branch: matt-mips64
Changes since 1.11: +0 -471 lines
FILE REMOVED

file kern_sleepq.c was added on branch matt-mips64 on 2007-08-01 23:30:55 +0000

Revision 1.11 / (download) - annotate - [select for diffs], Wed Aug 1 23:30:54 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: matt-mips64-base
Branch point for: matt-mips64, jmcneill-pm
Changes since 1.10: +19 -22 lines
Diff to previous 1.10 (colored) to selected 1.1.2.15 (colored)

sleepq_block: if a pending signal is detected but has already been taken
by the time the calling thread tries to take it, don't return EINTR.
Instead return zero leading to a spurious wakeup.

Revision 1.7.4.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:09:56 2007 UTC (16 years, 8 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.7: +60 -106 lines
Diff to previous 1.7 (colored) next main 1.8 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Jul 9 21:10:53 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base, hpcarm-cleanup
Branch point for: nick-csl-alignment
Changes since 1.9: +4 -6 lines
Diff to previous 1.9 (colored) to selected 1.1.2.15 (colored)

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements

Revision 1.7.2.7 / (download) - annotate - [select for diffs], Sun Jul 1 21:50:40 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.6: +4 -6 lines
Diff to previous 1.7.2.6 (colored) to selected 1.1.2.15 (colored)

Adapt to callout API change.

Revision 1.7.2.6 / (download) - annotate - [select for diffs], Sun Jun 17 21:31:26 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.5: +4 -4 lines
Diff to previous 1.7.2.5 (colored) to selected 1.1.2.15 (colored)

- Increase the number of thread priorities from 128 to 256. How the space
  is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
  is provided, with hooks for fast-path MD code that can run the interrupt
  threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
  locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.

Revision 1.7.2.5 / (download) - annotate - [select for diffs], Fri Jun 8 14:17:22 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.4: +19 -32 lines
Diff to previous 1.7.2.4 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.9 / (download) - annotate - [select for diffs], Thu May 17 14:51:40 2007 UTC (16 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.8: +45 -91 lines
Diff to previous 1.8 (colored) to selected 1.1.2.15 (colored)

merge yamt-idlelwp branch.  asked by core@.  some ports still needs work.

from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.

Revision 1.4.2.15 / (download) - annotate - [select for diffs], Sun May 13 17:02:58 2007 UTC (16 years, 10 months ago) by ad
Branch: yamt-idlelwp
Changes since 1.4.2.14: +8 -8 lines
Diff to previous 1.4.2.14 (colored) next main 1.5 (colored) to selected 1.1.2.15 (colored)

Assign a per-CPU lock to LWPs as they transition into the ONPROC state.

http://mail-index.netbsd.org/tech-kern/2007/05/06/0003.html

Revision 1.4.2.14 / (download) - annotate - [select for diffs], Sat Apr 21 15:50:16 2007 UTC (16 years, 11 months ago) by ad
Branch: yamt-idlelwp
Changes since 1.4.2.13: +2 -3 lines
Diff to previous 1.4.2.13 (colored) to selected 1.1.2.15 (colored)

Some changes mainly for top/ps:

- Add an optional name field to struct lwp.
- Count the total number of context switches + involuntary,
  not voluntary + involuntary.
- Mark the idle threads as LSIDL when not running, otherwise
  they show up funny in a top(1) that shows threads.
- Make pctcpu and cpticks per-LWP attributes.
- Add to kinfo_lwp: cpticks, pctcpu, pid, name.

Revision 1.4.2.13 / (download) - annotate - [select for diffs], Thu Apr 19 04:19:44 2007 UTC (16 years, 11 months ago) by ad
Branch: yamt-idlelwp
Changes since 1.4.2.12: +28 -59 lines
Diff to previous 1.4.2.12 (colored) to selected 1.1.2.15 (colored)

Pull up a change from the vmlocking branch:

- Ensure that LWPs going to sleep are on the sleep queue before releasing
  any interlocks. This is so that calls to turnstile_wakeup will have the
  correct locks held when adjusting priority. Avoids another deadlock.
- Assume that LWPs blocked on a turnstile will never be swapped out.
- LWPs blocking on a turnstile must have kernel priority, as they
  are consuming kernel resources.

Revision 1.4.2.12 / (download) - annotate - [select for diffs], Mon Apr 16 23:31:20 2007 UTC (16 years, 11 months ago) by ad
Branch: yamt-idlelwp
Changes since 1.4.2.11: +5 -12 lines
Diff to previous 1.4.2.11 (colored) to selected 1.1.2.15 (colored)

- Nuke the seperate scheduler locking scheme for UP kernels - it has been
  at the root of too many bugs.
- Add a LW_BOUND flag that indicates an LWP is bound to a specific CPU.

Revision 1.4.2.11 / (download) - annotate - [select for diffs], Sun Apr 15 16:03:50 2007 UTC (16 years, 11 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.4.2.10: +21 -19 lines
Diff to previous 1.4.2.10 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.7.2.4 / (download) - annotate - [select for diffs], Tue Apr 10 18:34:04 2007 UTC (16 years, 11 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.3: +28 -59 lines
Diff to previous 1.7.2.3 (colored) to selected 1.1.2.15 (colored)

- Ensure that that LWPs going to sleep are on the sleep queue and so
  have their syncobj pointer updated, so that calls to turnstile_wakeup
  will have the correct locks held when adjusting the current LWP's
  priority. Avoids another deadlock.
- Assume that LWPs blocked on a turnstile will never be swapped out.
- LWPs blocking on a turnstile must have kernel priority, as they
  are consuming kernel resources.

Revision 1.7.2.3 / (download) - annotate - [select for diffs], Tue Apr 10 13:26:39 2007 UTC (16 years, 11 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.2: +22 -20 lines
Diff to previous 1.7.2.2 (colored) to selected 1.1.2.15 (colored)

Sync with head.

Revision 1.7.2.2 / (download) - annotate - [select for diffs], Tue Apr 10 11:41:11 2007 UTC (16 years, 11 months ago) by ad
Branch: vmlocking
Changes since 1.7.2.1: +2 -4 lines
Diff to previous 1.7.2.1 (colored) to selected 1.1.2.15 (colored)

kernel_lock isn't needed for memory allocation any more.

Revision 1.7.2.1 / (download) - annotate - [select for diffs], Thu Apr 5 21:38:37 2007 UTC (16 years, 11 months ago) by ad
Branch: vmlocking
Changes since 1.7: +2 -3 lines
Diff to previous 1.7 (colored) to selected 1.1.2.15 (colored)

- Make context switch counters 64-bit, and count the total number of
  context switches + voluntary, instead of involuntary + voluntary.
- Add lwp::l_swaplock for uvm.
- PHOLD/PRELE are replaced.

Revision 1.7.6.1 / (download) - annotate - [select for diffs], Thu Mar 29 19:27:57 2007 UTC (17 years ago) by reinoud
Branch: reinoud-bufcleanup
Changes since 1.7: +22 -20 lines
Diff to previous 1.7 (colored) next main 1.8 (colored) to selected 1.1.2.15 (colored)

Pullup to -current

Revision 1.8 / (download) - annotate - [select for diffs], Thu Mar 29 17:34:39 2007 UTC (17 years ago) by ad
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic
Changes since 1.7: +22 -20 lines
Diff to previous 1.7 (colored) to selected 1.1.2.15 (colored)

- cv_wakeup: remove this. There are ~zero situations where it's useful.
- cv_wait and friends: after resuming execution, check to see if we have
  been restarted as a result of cv_signal. If we have, but cannot take
  the wakeup (because of eg a pending Unix signal or timeout) then try to
  ensure that another LWP sees it. This is necessary because there may
  be multiple waiters, and at least one should take the wakeup if possible.
  Prompted by a discussion with pooka@.
- typedef struct lwp lwp_t;
- int -> bool, struct lwp -> lwp_t in a few places.

Revision 1.4.2.10 / (download) - annotate - [select for diffs], Sat Mar 24 17:10:47 2007 UTC (17 years ago) by ad
Branch: yamt-idlelwp
Changes since 1.4.2.9: +3 -3 lines
Diff to previous 1.4.2.9 (colored) to selected 1.1.2.15 (colored)

Fix UP kernels. Having the different locking scheme for UP/MP is turning
out to be more hassle than it's worth...

Revision 1.4.2.9 / (download) - annotate - [select for diffs], Sat Mar 24 00:43:07 2007 UTC (17 years ago) by rmind
Branch: yamt-idlelwp
Changes since 1.4.2.8: +11 -10 lines
Diff to previous 1.4.2.8 (colored) to selected 1.1.2.15 (colored)

Checkpoint:
- Abstract for per-CPU locking of runqueues.
  As a workaround for SCHED_4BSD global runqueue, covered by sched_mutex,
  spc_mutex is a pointer for now. After making SCHED_4BSD runqueues
  per-CPU, it will became a storage mutex.
- suspendsched: Locking is not necessary for cpu_need_resched().
- Remove mutex_spin_exit() prototype in patch.c and LOCK_ASSERT() check
  in runqueue_nextlwp() in sched_4bsd.c to make them compile again.

Revision 1.4.2.8 / (download) - annotate - [select for diffs], Fri Mar 23 14:46:24 2007 UTC (17 years ago) by yamt
Branch: yamt-idlelwp
Changes since 1.4.2.7: +2 -3 lines
Diff to previous 1.4.2.7 (colored) to selected 1.1.2.15 (colored)

remove a stale updatepri prototype.

Revision 1.4.2.7 / (download) - annotate - [select for diffs], Wed Mar 21 22:04:18 2007 UTC (17 years ago) by ad
Branch: yamt-idlelwp
Changes since 1.4.2.6: +7 -14 lines
Diff to previous 1.4.2.6 (colored) to selected 1.1.2.15 (colored)

Previously cpu_info::ci_curlwp was protected by the sched_mutex and this is
used in a few places to synchronise. Now the state of LWPs is protected
during switch by their current lock (which might be e.g. a sleep queue
lock). So ci_curlwp is unlocked, which is necessary to be able to do
preemption and to run interrupts as LWPs cheaply.

Add a (locked) flag to the lwp (LW_RUNNING) that indicates if it is on CPU
somewhere. More exactly, it means that the LWP's state is tied to a CPU, and
that the LWP has not yet switched away even if (l->l_cpu->ci_curcpu != l) or
(l->l_stat != LSONPROC).

Revision 1.4.2.6 / (download) - annotate - [select for diffs], Sat Mar 17 16:54:37 2007 UTC (17 years ago) by rmind
Branch: yamt-idlelwp
Changes since 1.4.2.5: +3 -3 lines
Diff to previous 1.4.2.5 (colored) to selected 1.1.2.15 (colored)

Do not do an implicit enqueue in sched_switch(), move enqueueing back to
the dispatcher. Rename sched_switch() back to sched_nextlwp(). Add for
sched_enqueue() new argument, which indicates the calling from mi_switch().

Requested by yamt@

Revision 1.4.2.5 / (download) - annotate - [select for diffs], Fri Mar 9 15:16:25 2007 UTC (17 years ago) by rmind
Branch: yamt-idlelwp
Changes since 1.4.2.4: +3 -3 lines
Diff to previous 1.4.2.4 (colored) to selected 1.1.2.15 (colored)

Checkpoint:

- Addition of scheduler-specific pointers in the struct proc, lwp and
  schedstate_percpu.
- Addition of sched_lwp_fork(), sched_lwp_exit() and sched_slept() hooks.
- mi_switch() now has only one argument.
- sched_nextlwp(void) becomes sched_switch(struct lwp *) and does an
  enqueueing of LWP.
- Addition of general kern.sched sysctl node.
- Remove twice called uvmexp.swtch++, other cleanups.

Discussed on tech-kern@

Revision 1.4.2.4 / (download) - annotate - [select for diffs], Tue Feb 27 16:54:24 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.4.2.3: +61 -27 lines
Diff to previous 1.4.2.3 (colored) to selected 1.1.2.15 (colored)

- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Feb 27 15:07:29 2007 UTC (17 years, 1 month ago) by yamt
Branch: MAIN
Branch point for: vmlocking, reinoud-bufcleanup, mjf-ufs-trans
Changes since 1.6: +6 -6 lines
Diff to previous 1.6 (colored) to selected 1.1.2.15 (colored)

typedef pri_t and use it instead of int and u_char.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Feb 26 09:20:53 2007 UTC (17 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.5: +52 -18 lines
Diff to previous 1.5 (colored) to selected 1.1.2.15 (colored)

implement priority inheritance.

Revision 1.4.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:18:08 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.4.2.2: +1 -1 lines
Diff to previous 1.4.2.2 (colored) to selected 1.1.2.15 (colored)

add an "immediate" flag for cpu_need_resched().  suggested by Andrew Doran.

Revision 1.5.2.2 / (download) - annotate - [select for diffs], Mon Feb 26 09:11:11 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5.2.1: +486 -0 lines
Diff to previous 1.5.2.1 (colored) to selected 1.1.2.15 (colored)

sync with head.

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Fri Feb 23 15:57:45 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.4.2.1: +3 -2 lines
Diff to previous 1.4.2.1 (colored) to selected 1.1.2.15 (colored)

- introduce sys/cpu.h which has cpu_idle and cpu_need_resched.
- use it where appropriate.
- while i'm here, remove several unnecessary #include.

Revision 1.4.2.1 / (download) - annotate - [select for diffs], Tue Feb 20 21:48:45 2007 UTC (17 years, 1 month ago) by rmind
Branch: yamt-idlelwp
Changes since 1.4: +4 -5 lines
Diff to previous 1.4 (colored) to selected 1.1.2.15 (colored)

General Common Scheduler Framework (CSF) patch import. Huge thanks for
Daniel Sieger <dsieger at TechFak.Uni-Bielefeld de> for this work.

Short abstract: Split the dispatcher from the scheduler in order to
make the scheduler more modular. Introduce initial API for other
schedulers' implementations.

Discussed in tech-kern@
OK: yamt@, ad@

Note: further work will go soon.

Revision 1.5.2.1, Sat Feb 17 22:31:43 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.5: +0 -486 lines
FILE REMOVED

file kern_sleepq.c was added on branch yamt-lazymbuf on 2007-02-26 09:11:11 +0000

Revision 1.5 / (download) - annotate - [select for diffs], Sat Feb 17 22:31:43 2007 UTC (17 years, 1 month ago) by pavel
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.4: +10 -10 lines
Diff to previous 1.4 (colored) to selected 1.1.2.15 (colored)

Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Feb 15 20:21:13 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
Branch point for: yamt-idlelwp
Changes since 1.3: +16 -16 lines
Diff to previous 1.3 (colored) to selected 1.1.2.15 (colored)

Add uvm_kick_scheduler() (MP safe) to replace wakeup(&proc0).

Revision 1.3 / (download) - annotate - [select for diffs], Sat Feb 10 14:02:01 2007 UTC (17 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.2: +2 -3 lines
Diff to previous 1.2 (colored) to selected 1.1.2.15 (colored)

remove function prototypes of sa_awaken.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:31 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge
Changes since 1.1: +487 -0 lines
Diff to previous 1.1 (colored) to selected 1.1.2.15 (colored)

Merge newlock2 to head.

Revision 1.1.2.15 / (download) - annotate - [selected], Fri Feb 9 19:58:10 2007 UTC (17 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.1.2.14: +8 -14 lines
Diff to previous 1.1.2.14 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

- Change syncobj_t::sobj_changepri() to alter both the user priority and
  the effective priority of LWPs. How the effective priority is adjusted
  depends on the type of object.
- Add a couple of comments to sched_kpri() and remrunqueue().

Revision 1.1.2.14 / (download) - annotate - [select for diffs], Mon Feb 5 17:58:13 2007 UTC (17 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.1.2.13: +6 -5 lines
Diff to previous 1.1.2.13 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

Try to reduce cache line ping-ponging.

Revision 1.1.2.13 / (download) - annotate - [select for diffs], Mon Feb 5 13:11:13 2007 UTC (17 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.1.2.12: +5 -3 lines
Diff to previous 1.1.2.12 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

sleepq_changepri(): don't forget to change l_priority..

Revision 1.1.2.12 / (download) - annotate - [select for diffs], Sun Feb 4 16:04:30 2007 UTC (17 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.1.2.11: +5 -10 lines
Diff to previous 1.1.2.11 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

Push the kernel_lock back in a couple of places. Sleep/wakeup and ktrace
are now MP safe.

Revision 1.1.2.11 / (download) - annotate - [select for diffs], Tue Jan 30 13:51:41 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.1.2.10: +4 -13 lines
Diff to previous 1.1.2.10 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

Remove support for SA. Ok core@.

Revision 1.1.2.10 / (download) - annotate - [select for diffs], Sat Jan 27 14:00:02 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.1.2.9: +4 -4 lines
Diff to previous 1.1.2.9 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

Rename some functions to better describe what they do.

Revision 1.1.2.9 / (download) - annotate - [select for diffs], Wed Jan 17 20:24:33 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.1.2.8: +3 -3 lines
Diff to previous 1.1.2.8 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

sleepq_timeout(): need to use lwp_unsleep() here.

Revision 1.1.2.8 / (download) - annotate - [select for diffs], Tue Jan 16 01:26:20 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.1.2.7: +3 -2 lines
Diff to previous 1.1.2.7 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

Minor corrections.

Revision 1.1.2.7 / (download) - annotate - [select for diffs], Fri Dec 29 20:27:44 2006 UTC (17 years, 3 months ago) by ad
Branch: newlock2
Changes since 1.1.2.6: +104 -134 lines
Diff to previous 1.1.2.6 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

Checkpoint work in progress.

Revision 1.1.2.6 / (download) - annotate - [select for diffs], Fri Nov 17 16:53:08 2006 UTC (17 years, 4 months ago) by ad
Branch: newlock2
Changes since 1.1.2.5: +5 -29 lines
Diff to previous 1.1.2.5 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

Fix an obvious sleep/wakeup bug introduced in previous.

Revision 1.1.2.5 / (download) - annotate - [select for diffs], Fri Nov 17 16:34:36 2006 UTC (17 years, 4 months ago) by ad
Branch: newlock2
Changes since 1.1.2.4: +157 -116 lines
Diff to previous 1.1.2.4 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

Checkpoint work in progress.

Revision 1.1.2.4 / (download) - annotate - [select for diffs], Tue Oct 24 21:10:21 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.1.2.3: +78 -71 lines
Diff to previous 1.1.2.3 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

- Redo LWP locking slightly and fix some races.
- Fix some locking botches.
- Make signal mask / stack per-proc for SA processes.
- Add _lwp_kill().

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Sat Oct 21 14:03:14 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.1.2.2: +5 -6 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

sleepq_sigtoerror: fix a locking botch.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Fri Oct 20 20:41:26 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.1.2.1: +4 -2 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored) to selected 1.1.2.15 (colored)

sleepq_block(): acquire sched_mutex before calling sleepq_remove()

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Fri Oct 20 19:38:44 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.1: +508 -0 lines
Diff to previous 1.1 (colored) to selected 1.1.2.15 (colored)

Add a sleep queue implementation.

Revision 1.1, Fri Oct 20 19:38:44 2006 UTC (17 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, yamt-splraiseipl-base2, newlock2-nbase, newlock2-base
Branch point for: newlock2
FILE REMOVED

file kern_sleepq.c was initially added on branch newlock2.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>