The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.269 / (download) - annotate - [select for diffs], Wed Dec 20 21:03:50 2023 UTC (3 months, 1 week ago) by andvar
Branch: MAIN
CVS Tags: HEAD
Changes since 1.268: +4 -4 lines
Diff to previous 1.268 (colored) to selected 1.40.2.15 (colored)

s/deatched/detached/ in comment. While here, fix an article before annoyance.

Revision 1.268 / (download) - annotate - [select for diffs], Wed Dec 20 20:35:37 2023 UTC (3 months, 1 week ago) by andvar
Branch: MAIN
Changes since 1.267: +3 -3 lines
Diff to previous 1.267 (colored) to selected 1.40.2.15 (colored)

fix tripple n typos in "running"/"domainname", also one missing n in comments.

Revision 1.267 / (download) - annotate - [select for diffs], Sun Oct 15 10:28:14 2023 UTC (5 months, 1 week ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Changes since 1.266: +25 -24 lines
Diff to previous 1.266 (colored) to selected 1.40.2.15 (colored)

kern_lwp: Sort includes.  No functional change intended.

Revision 1.266 / (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.265: +3 -2 lines
Diff to previous 1.265 (colored) to selected 1.40.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.265 / (download) - annotate - [select for diffs], Thu Oct 5 19:41:06 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.264: +16 -28 lines
Diff to previous 1.264 (colored) to selected 1.40.2.15 (colored)

Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).

Revision 1.264 / (download) - annotate - [select for diffs], Thu Oct 5 13:05:18 2023 UTC (5 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.263: +14 -3 lines
Diff to previous 1.263 (colored) to selected 1.40.2.15 (colored)

lwp_pctr(9): Make this a little more robust.

No substantive change to machine code on aarch64.  (Instructions and
registers got reordered a little but not in a way that matters.)

Revision 1.263 / (download) - annotate - [select for diffs], Wed Oct 4 22:17:09 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.262: +4 -5 lines
Diff to previous 1.262 (colored) to selected 1.40.2.15 (colored)

kauth_cred_hold(): return cred verbatim so that donating a reference to
another data structure can be done more elegantly.

Revision 1.262 / (download) - annotate - [select for diffs], Wed Oct 4 20:46:33 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.261: +5 -5 lines
Diff to previous 1.261 (colored) to selected 1.40.2.15 (colored)

Do cv_broadcast(&p->p_lwpcv) after dropping p->p_lock in a few places, to
reduce contention.

Revision 1.261 / (download) - annotate - [select for diffs], Wed Oct 4 20:45:13 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.260: +4 -3 lines
Diff to previous 1.260 (colored) to selected 1.40.2.15 (colored)

lwp_wait(): restart the loop if p->p_lock dropped to reap zombie (paranoid).

Revision 1.260 / (download) - annotate - [select for diffs], Wed Oct 4 20:44:15 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.259: +3 -2 lines
Diff to previous 1.259 (colored) to selected 1.40.2.15 (colored)

Sprinkle a bunch more calls to lwp_need_userret().  There should be no
functional change but it does get rid of a bunch of assumptions about how
mi_userret() works making it easier to adjust in that in the future, and
works as a kind of documentation too.

Revision 1.259 / (download) - annotate - [select for diffs], Wed Oct 4 20:42:38 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.258: +10 -3 lines
Diff to previous 1.258 (colored) to selected 1.40.2.15 (colored)

Sprinkle a bunch more calls to lwp_need_userret().  There should be no
functional change but it does get rid of a bunch of assumptions about how
mi_userret() works making it easier to adjust in that in the future, and
works as a kind of documentation too.

Revision 1.258 / (download) - annotate - [select for diffs], Wed Oct 4 20:28:06 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
Changes since 1.257: +4 -6 lines
Diff to previous 1.257 (colored) to selected 1.40.2.15 (colored)

Eliminate l->l_ncsw and l->l_nivcsw.  From memory think they were added
before we had per-LWP struct rusage; the same is now tracked there.

Revision 1.257 / (download) - annotate - [select for diffs], Sat Sep 23 20:23:07 2023 UTC (6 months ago) by ad
Branch: MAIN
Changes since 1.256: +11 -6 lines
Diff to previous 1.256 (colored) to selected 1.40.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.256 / (download) - annotate - [select for diffs], Sat Sep 23 18:48:04 2023 UTC (6 months ago) by ad
Branch: MAIN
Changes since 1.255: +112 -22 lines
Diff to previous 1.255 (colored) to selected 1.40.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.255 / (download) - annotate - [select for diffs], Sat Sep 23 18:21:11 2023 UTC (6 months ago) by ad
Branch: MAIN
Changes since 1.254: +6 -5 lines
Diff to previous 1.254 (colored) to selected 1.40.2.15 (colored)

Repply this change with a couple of bugs fixed:

- Do away with separate pool_cache for some kernel objects that have no special
  requirements and use the general purpose allocator instead. On one of my
  test systems this makes for a small (~1%) but repeatable reduction in system
  time during builds presumably because it decreases the kernel's cache /
  memory bandwidth footprint a little.
- vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment.

Revision 1.254 / (download) - annotate - [select for diffs], Tue Sep 12 16:17:21 2023 UTC (6 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.253: +5 -6 lines
Diff to previous 1.253 (colored) to selected 1.40.2.15 (colored)

Back out recent change to replace pool_cache with then general allocator.
Will return to this when I have time again.

Revision 1.253 / (download) - annotate - [select for diffs], Sun Sep 10 14:45:52 2023 UTC (6 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.252: +6 -5 lines
Diff to previous 1.252 (colored) to selected 1.40.2.15 (colored)

- Do away with separate pool_cache for some kernel objects that have no special
  requirements and use the general purpose allocator instead.  On one of my
  test systems this makes for a small (~1%) but repeatable reduction in system
  time during builds presumably because it decreases the kernel's cache /
  memory bandwidth footprint a little.
- vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment.

Revision 1.252 / (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.251: +4 -3 lines
Diff to previous 1.251 (colored) to selected 1.40.2.15 (colored)

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

Revision 1.251 / (download) - annotate - [select for diffs], Fri Jul 1 01:06:04 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.250: +3 -3 lines
Diff to previous 1.250 (colored) to selected 1.40.2.15 (colored)

kern: Fix comment about precondition of lwp_update_creds.

Revision 1.250 / (download) - annotate - [select for diffs], Sun May 22 11:27:36 2022 UTC (22 months, 1 week ago) by andvar
Branch: MAIN
Changes since 1.249: +3 -3 lines
Diff to previous 1.249 (colored) to selected 1.40.2.15 (colored)

fix various small typos, mainly in comments.

Revision 1.249 / (download) - annotate - [select for diffs], Sat May 7 19:44:40 2022 UTC (22 months, 3 weeks ago) by mrg
Branch: MAIN
Changes since 1.248: +14 -5 lines
Diff to previous 1.248 (colored) to selected 1.40.2.15 (colored)

bump maxthreads default.

bump the default MAXLWP to 4096 from 2048, and adjust the default
limits seen to be 2048 cur / 4096 max.  remove the linkage to
maxuprc entirely.

remove cpu_maxlwp() that isn't implemented anywhere.  instead,
grow the maxlwp for larger memory systems, picking 1 lwp per 1MiB
of ram, limited to 65535 like the system limit.

remove some magic numbers.


i've been having weird firefox issues for a few months now and
it turns out i was having pthread_create() failures and since
bumping the defaults i've had none of the recent issues.

Revision 1.248 / (download) - annotate - [select for diffs], Sat Apr 9 23:45:36 2022 UTC (23 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.247: +6 -8 lines
Diff to previous 1.247 (colored) to selected 1.40.2.15 (colored)

kern: Handle l_mutex with atomic_store_release, atomic_load_consume.

- Where the lock is held and known to be correct, no atomic.
- In loops to acquire the lock, use atomic_load_relaxed before we
  restart with atomic_load_consume.

Nix membar_exit.

(Who knows, using atomic_load_consume here might fix bugs on Alpha!)

Revision 1.247 / (download) - annotate - [select for diffs], Thu Mar 10 12:21:25 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.246: +16 -10 lines
Diff to previous 1.246 (colored) to selected 1.40.2.15 (colored)

kern: Fix synchronization of clearing LP_RUNNING and lwp_free.

1. membar_sync is not necessary here -- only a store-release is
   required.

2. membar_consumer _before_ loading l->l_pflag is not enough; a
   load-acquire is required.

Actually it's not really clear to me why any barriers are needed, since
the store-release and load-acquire should be implied by releasing and
acquiring the lwp lock (and maybe we could spin with the lock instead
of reading l->l_pflag unlocked).  But maybe there's something subtle
about access to l->l_mutex that's not obvious here.

Revision 1.246 / (download) - annotate - [select for diffs], Wed Dec 22 16:57:28 2021 UTC (2 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.245: +12 -21 lines
Diff to previous 1.245 (colored) to selected 1.40.2.15 (colored)

Do the last change differently:

Instead of having a pre-destruct hook, put knowledge of passive
serialization into the pool allocator directly, enabled by PR_PSERIALIZE
when the pool / pool_cache is initialized.  This will guarantee that
a passive serialization barrier will be performed before the object's
destructor is called, or before the page containing the object is freed
back to the system (in the case of no destructor).  Note that the internal
allocator overhead is different when PR_PSERIALIZE is used (it implies
PR_NOTOUCH, because the objects must remain in a valid state).

In the DRM Linux API shim, this allows us to remove the custom page
allocator for SLAB_TYPESAFE_BY_RCU.

Revision 1.245 / (download) - annotate - [select for diffs], Tue Dec 21 19:00:37 2021 UTC (2 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.244: +18 -10 lines
Diff to previous 1.244 (colored) to selected 1.40.2.15 (colored)

Rather than calling xc_barrier() in lwp_dtor(), set a pre-destruct hook
on the lwp_cache and invoke the barrier there.

Revision 1.243.12.1 / (download) - annotate - [select for diffs], Wed Nov 3 14:49:21 2021 UTC (2 years, 4 months ago) by thorpej
Branch: thorpej-futex2
Changes since 1.243: +3 -6 lines
Diff to previous 1.243 (colored) next main 1.244 (colored) to selected 1.40.2.15 (colored)

Cherry-pick this sys_futex.c revision and associated changes:

revision 1.13
date: 2021-09-28 08:05:42 -0700;  author: thorpej;  state: Exp;  lines: +11 -9;  commitid: FPndTp2ZDjYuyJaD;
futex_release_all_lwp(): No need to pass the "tid" argument separately; that
is a vestige of an older version of the code.  Also, move a KASSERT() that
both futex_release_all_lwp() call sites had inside of futex_release_all_lwp()
itself.

...so make this easier to test this sys_futex.c with trunk.

Revision 1.244 / (download) - annotate - [select for diffs], Tue Sep 28 15:05:42 2021 UTC (2 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.243: +3 -6 lines
Diff to previous 1.243 (colored) to selected 1.40.2.15 (colored)

futex_release_all_lwp(): No need to pass the "tid" argument separately; that
is a vestige of an older version of the code.  Also, move a KASSERT() that
both futex_release_all_lwp() call sites had inside of futex_release_all_lwp()
itself.

Revision 1.242.2.1 / (download) - annotate - [select for diffs], Sat Apr 3 22:29:00 2021 UTC (2 years, 11 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.242: +3 -3 lines
Diff to previous 1.242 (colored) next main 1.243 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.243 / (download) - annotate - [select for diffs], Wed Jan 13 07:36:56 2021 UTC (3 years, 2 months ago) by skrll
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-futex-base, 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
Branch point for: thorpej-futex2
Changes since 1.242: +3 -3 lines
Diff to previous 1.242 (colored) to selected 1.40.2.15 (colored)

Improve English in comments

Revision 1.242 / (download) - annotate - [select for diffs], Mon Jun 22 16:21:29 2020 UTC (3 years, 9 months ago) by maxv
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.241: +3 -5 lines
Diff to previous 1.241 (colored) to selected 1.40.2.15 (colored)

Permanent node doesn't need a log, plus the log gets leaked anyway. Found
by kLSan.

Revision 1.241 / (download) - annotate - [select for diffs], Sat Jun 6 22:26:47 2020 UTC (3 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.240: +4 -2 lines
Diff to previous 1.240 (colored) to selected 1.40.2.15 (colored)

lwp_exit(): add a warning about (l != curlwp)

Revision 1.240 / (download) - annotate - [select for diffs], Mon Jun 1 13:58:14 2020 UTC (3 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.239: +2 -3 lines
Diff to previous 1.239 (colored) to selected 1.40.2.15 (colored)

lwp_thread_cleanup(): Remove overly-aggressive assertion.

Revision 1.239 / (download) - annotate - [select for diffs], Sat May 23 23:42:43 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.238: +13 -13 lines
Diff to previous 1.238 (colored) to selected 1.40.2.15 (colored)

Move proc_lock into the data segment.  It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.

Revision 1.238 / (download) - annotate - [select for diffs], Sat May 23 20:45:10 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.237: +92 -65 lines
Diff to previous 1.237 (colored) to selected 1.40.2.15 (colored)

- Replace pid_table_lock with a lockless lookup covered by pserialize, with
  the "writer" side being pid_table expansion.  The basic idea is that when
  doing an LWP lookup there is usually already a lock held (p->p_lock), or a
  spin mutex that needs to be taken (l->l_mutex), and either can be used to
  get the found LWP stable and confidently determine that all is correct.

- For user processes LSLARVAL implies the same thing as LSIDL ("not visible
  by ID"), and lookup by ID in proc0 doesn't really happen.  In-tree the new
  state should be understood by top(1), the tty subsystem and so on, and
  would attract the attention of 3rd party kernel grovellers in time, so
  remove it and just rely on LSIDL.

Revision 1.237 / (download) - annotate - [select for diffs], Wed Apr 29 01:52:26 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.236: +70 -135 lines
Diff to previous 1.236 (colored) to selected 1.40.2.15 (colored)

- proc_find() retains traditional semantics of requiring the canonical
  PID to look up a proc.  Add a separate proc_find_lwpid() to look up a
  proc by the ID of any of its LWPs.
- Add proc_find_lwp_acquire_proc(), which enables looking up the LWP
  *and* a proc given the ID of any LWP.  Returns with the proc::p_lock
  held.
- Rewrite lwp_find2() in terms of proc_find_lwp_acquire_proc(), and add
  allow the proc to be wildcarded, rather than just curproc or specific
  proc.
- lwp_find2() now subsumes the original intent of lwp_getref_lwpid(), but
  in a much nicer way, so garbage-collect the remnants of that recently
  added mechanism.

Revision 1.236 / (download) - annotate - [select for diffs], Sun Apr 26 18:53:33 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.235: +12 -2 lines
Diff to previous 1.235 (colored) to selected 1.40.2.15 (colored)

Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.

Revision 1.233.2.2 / (download) - annotate - [select for diffs], Sat Apr 25 11:24:05 2020 UTC (3 years, 11 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.233.2.1: +85 -302 lines
Diff to previous 1.233.2.1 (colored) to branchpoint 1.233 (colored) next main 1.234 (colored) to selected 1.40.2.15 (colored)

Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.235 / (download) - annotate - [select for diffs], Fri Apr 24 03:22:06 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.234: +85 -302 lines
Diff to previous 1.234 (colored) to selected 1.40.2.15 (colored)

Overhaul the way LWP IDs are allocated.  Instead of each LWP having it's
own LWP ID space, LWP IDs came from the same number space as PIDs.  The
lead LWP of a process gets the PID as its LID.  If a multi-LWP process's
lead LWP exits, the PID persists for the process.

In addition to providing system-wide unique thread IDs, this also lets us
eliminate the per-process LWP radix tree, and some associated locks.

Remove the separate "global thread ID" map added previously; it is no longer
needed to provide this functionality.

Nudged in this direction by ad@ and chs@.

Revision 1.192.2.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.192.2.2: +4 -6 lines
Diff to previous 1.192.2.2 (colored) to branchpoint 1.192 (colored) next main 1.193 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.233.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.233: +6 -8 lines
Diff to previous 1.233 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.234 / (download) - annotate - [select for diffs], Sun Apr 19 23:05:04 2020 UTC (3 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base1
Changes since 1.233: +6 -8 lines
Diff to previous 1.233 (colored) to selected 1.40.2.15 (colored)

lwp_wait(): don't need to check for process exit, cv_wait_sig() does it.

Revision 1.192.2.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:03 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.192.2.1: +622 -252 lines
Diff to previous 1.192.2.1 (colored) to branchpoint 1.192 (colored) to selected 1.40.2.15 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.233 / (download) - annotate - [select for diffs], Sat Apr 4 20:20:12 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.232: +272 -14 lines
Diff to previous 1.232 (colored) to selected 1.40.2.15 (colored)

Add support for lazily generating a "global thread ID" for a LWP.  This
identifier uniquely identifies an LWP across the entire system, and will
be used in future improvements in user-space synchronization primitives.

(Test disabled and libc stub not included intentionally so as to avoid
multiple libc version bumps.)

Revision 1.232 / (download) - annotate - [select for diffs], Sat Apr 4 06:51:46 2020 UTC (3 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.231: +4 -2 lines
Diff to previous 1.231 (colored) to selected 1.40.2.15 (colored)

Drop specificdata from KCOV, kMSan doesn't interact well with it. Also
reduces the overhead.

Revision 1.231 / (download) - annotate - [select for diffs], Thu Mar 26 21:31:55 2020 UTC (4 years ago) by ad
Branch: MAIN
Changes since 1.230: +23 -17 lines
Diff to previous 1.230 (colored) to selected 1.40.2.15 (colored)

Fix crash observed with procfs on current-users by David Hopper.  LWP refcnt
and p_zomblwp both must reach the needed state, and LSZOMB be set, under a
single hold of p_lock.

Revision 1.230 / (download) - annotate - [select for diffs], Thu Mar 26 20:19:06 2020 UTC (4 years ago) by ad
Branch: MAIN
Changes since 1.229: +2 -8 lines
Diff to previous 1.229 (colored) to selected 1.40.2.15 (colored)

softint_overlay() (slow case) gains ~nothing but creates potential headaches.
In the interests of simplicity remove it and always use the kthreads.

Revision 1.229 / (download) - annotate - [select for diffs], Sun Mar 8 17:04:45 2020 UTC (4 years ago) by ad
Branch: MAIN
Changes since 1.228: +7 -6 lines
Diff to previous 1.228 (colored) to selected 1.40.2.15 (colored)

PR kern/55020: dbregs_dr?_dont_inherit_lwp test cases fail on real hardware

lwp_wait(): make the check for deadlock much more permissive.

Revision 1.217.2.3 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:02 2020 UTC (4 years ago) by ad
Branch: ad-namecache
Changes since 1.217.2.2: +188 -113 lines
Diff to previous 1.217.2.2 (colored) to branchpoint 1.217 (colored) next main 1.218 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.228 / (download) - annotate - [select for diffs], Thu Feb 27 20:52:25 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.227: +3 -7 lines
Diff to previous 1.227 (colored) to selected 1.40.2.15 (colored)

Remove an unneeded ifdef MULTIPROCESSOR.

Revision 1.227 / (download) - annotate - [select for diffs], Sat Feb 15 18:12:15 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.226: +20 -12 lines
Diff to previous 1.226 (colored) to selected 1.40.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.226 / (download) - annotate - [select for diffs], Sat Feb 15 17:13:55 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.225: +36 -2 lines
Diff to previous 1.225 (colored) to selected 1.40.2.15 (colored)

PR kern/54922: 9.99.45@20200202 panic: diagnostic assertion linux ldconfig triggers vpp != NULL in exit1()->radixtree.c line 674

Create an lwp_renumber() from the code in emulexec() and use in
linux_e_proc_exec() and linux_e_proc_fork() too.

Revision 1.202.2.3 / (download) - annotate - [select for diffs], Wed Feb 12 19:35:31 2020 UTC (4 years, 1 month ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE
Changes since 1.202.2.2: +5 -2 lines
Diff to previous 1.202.2.2 (colored) to branchpoint 1.202 (colored) next main 1.203 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by maya in ticket #697):

	sys/kern/kern_lwp.c: revision 1.224
	sys/kern/kern_lwp.c: revision 1.225

Preserve pcu(9) state in fork.

There should perhaps be a pcu_fork operation to keep this factored
neatly but this will be simpler to pull up.

In practical terms, this may not affect most architecture that use
pcu(9) -- alpha, arm32, mips, powerpc, riscv -- but it does affect
aarch64, in which v8-v15 are callee-saves, and GCC actually takes
advantage of them, and for more than just floating-point data too.

XXX pullup

fix compilation failure for arches without l_pcu_valid
ok riastradh

Revision 1.225 / (download) - annotate - [select for diffs], Tue Feb 11 06:09:48 2020 UTC (4 years, 1 month ago) by dogcow
Branch: MAIN
Changes since 1.224: +4 -2 lines
Diff to previous 1.224 (colored) to selected 1.40.2.15 (colored)

fix compilation failure for arches without l_pcu_valid
ok riastradh

Revision 1.224 / (download) - annotate - [select for diffs], Tue Feb 11 03:14:49 2020 UTC (4 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.223: +3 -2 lines
Diff to previous 1.223 (colored) to selected 1.40.2.15 (colored)

Preserve pcu(9) state in fork.

There should perhaps be a pcu_fork operation to keep this factored
neatly but this will be simpler to pull up.

In practical terms, this may not affect most architecture that use
pcu(9) -- alpha, arm32, mips, powerpc, riscv -- but it does affect
aarch64, in which v8-v15 are callee-saves, and GCC actually takes
advantage of them, and for more than just floating-point data too.

XXX pullup

Revision 1.223 / (download) - annotate - [select for diffs], Wed Jan 29 15:47:52 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.222: +125 -93 lines
Diff to previous 1.222 (colored) to selected 1.40.2.15 (colored)

- Track LWPs in a per-process radixtree.  It uses no extra memory in the
  single threaded case.  Replace scans of p->p_lwps with lookups in the
  tree.  Find free LIDs for new LWPs in the tree.  Replace the hashed sleep
  queues for park/unpark with lookups in the tree under cover of a RW lock.

- lwp_wait(): if waiting on a specific LWP, find the LWP via tree lookup and
  return EINVAL if it's detached, not ESRCH.

- Group the locks in struct proc at the end of the struct in their own cache
  line.

- Add some comments.

Revision 1.222 / (download) - annotate - [select for diffs], Mon Jan 27 21:58:16 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.221: +9 -8 lines
Diff to previous 1.221 (colored) to selected 1.40.2.15 (colored)

- lwp_wait(): if the process is exiting and no progress is being made, wake
  every clock tick and kick all the LWPs again.

- lwp_create(): copy the LW_WEXIT etc flags while holding the parent's
  p_lock.  Copy only LW_WREBOOT in the case of fork(), since a pending
  coredump or exit() in the parent process isn't for the child.

Revision 1.221 / (download) - annotate - [select for diffs], Sun Jan 26 19:06:24 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.220: +4 -3 lines
Diff to previous 1.220 (colored) to selected 1.40.2.15 (colored)

Update a comment.

Revision 1.217.2.2 / (download) - annotate - [select for diffs], Sat Jan 25 22:38:51 2020 UTC (4 years, 2 months ago) by ad
Branch: ad-namecache
Changes since 1.217.2.1: +6 -5 lines
Diff to previous 1.217.2.1 (colored) to branchpoint 1.217 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.220 / (download) - annotate - [select for diffs], Wed Jan 22 12:23:04 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base2
Changes since 1.219: +6 -5 lines
Diff to previous 1.219 (colored) to selected 1.40.2.15 (colored)

Catch a leaked hold of kernel_lock sooner with DIAGNOSTIC and make the
message a bit more informative.

Revision 1.217.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.217: +37 -45 lines
Diff to previous 1.217 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.219 / (download) - annotate - [select for diffs], Sun Jan 12 13:15:08 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base1
Changes since 1.218: +4 -10 lines
Diff to previous 1.218 (colored) to selected 1.40.2.15 (colored)

Remove some unneeded kernel_lock handling.

Revision 1.218 / (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.217: +37 -39 lines
Diff to previous 1.217 (colored) to selected 1.40.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.217 / (download) - annotate - [select for diffs], Fri Dec 6 21:36:10 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base
Branch point for: ad-namecache
Changes since 1.216: +3 -2 lines
Diff to previous 1.216 (colored) to selected 1.40.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.216 / (download) - annotate - [select for diffs], Tue Dec 3 05:07:48 2019 UTC (4 years, 3 months ago) by riastradh
Branch: MAIN
Changes since 1.215: +2 -6 lines
Diff to previous 1.215 (colored) to selected 1.40.2.15 (colored)

Rip out pserialize(9) logic now that the RCU patent has expired.

pserialize_perform() is now basically just xc_barrier(XC_HIGHPRI).
No more tentacles throughout the scheduler.  Simplify the psz read
count for diagnostic assertions by putting it unconditionally into
cpu_info.

From rmind@, tidied up by me.

Revision 1.215 / (download) - annotate - [select for diffs], Sun Dec 1 15:27:58 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.214: +20 -21 lines
Diff to previous 1.214 (colored) to selected 1.40.2.15 (colored)

Fix a longstanding problem with LWP limits.  When changing the user's
LWP count, we must use the process credentials because that's what
the accounting entity is tied to.

Reported-by: syzbot+d193266676f635661c62@syzkaller.appspotmail.com

Revision 1.214 / (download) - annotate - [select for diffs], Sun Nov 24 13:23:57 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.213: +2 -3 lines
Diff to previous 1.213 (colored) to selected 1.40.2.15 (colored)

lwp_start(): don't try to change the target CPU.  Fixes potential panic
in setrunnable(). Oops, experimental change that escaped.

Revision 1.213 / (download) - annotate - [select for diffs], Sun Nov 24 13:14:23 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.212: +3 -3 lines
Diff to previous 1.212 (colored) to selected 1.40.2.15 (colored)

Put section attribute for turnstile0 in the correct place.  For LLVM.

Revision 1.212 / (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.211: +46 -22 lines
Diff to previous 1.211 (colored) to selected 1.40.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.211 / (download) - annotate - [select for diffs], Thu Nov 21 19:47:21 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.210: +8 -6 lines
Diff to previous 1.210 (colored) to selected 1.40.2.15 (colored)

lwp_setlock(): return pointer to the kmutex_t that we replaced

Revision 1.210 / (download) - annotate - [select for diffs], Thu Nov 21 18:22:05 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.209: +14 -20 lines
Diff to previous 1.209 (colored) to selected 1.40.2.15 (colored)

lwp_create:
- Don't need to check for PK_SYSTEM when inheriting an affinity mask.
- Inherit processor set ID under proc_lock, to sync with pset syscalls.

Revision 1.209 / (download) - annotate - [select for diffs], Thu Nov 21 18:17:36 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.208: +21 -10 lines
Diff to previous 1.208 (colored) to selected 1.40.2.15 (colored)

- lwp_need_userret(): only do it if ONPROC and !curlwp, and explain why.
- Use signotify() in a couple more places.

Revision 1.208 / (download) - annotate - [select for diffs], Thu Nov 14 16:23:52 2019 UTC (4 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.207: +5 -2 lines
Diff to previous 1.207 (colored) to selected 1.40.2.15 (colored)

Add support for Kernel Memory Sanitizer (kMSan). It detects uninitialized
memory used by the kernel at run time, and just like kASan and kCSan, it
is an excellent feature. It has already detected 38 uninitialized variables
in the kernel during my testing, which I have since discreetly fixed.

We use two shadows:
 - "shad", to track uninitialized memory with a bit granularity (1:1).
   Each bit set to 1 in the shad corresponds to one uninitialized bit of
   real kernel memory.
 - "orig", to track the origin of the memory with a 4-byte granularity
   (1:1). Each uint32_t cell in the orig indicates the origin of the
   associated uint32_t of real kernel memory.

The memory consumption of these shadows is consequent, so at least 4GB of
RAM is recommended to run kMSan.

The compiler inserts calls to specific __msan_* functions on each memory
access, to manage both the shad and the orig and detect uninitialized
memory accesses that change the execution flow (like an "if" on an
uninitialized variable).

We mark as uninit several types of memory buffers (stack, pools, kmem,
malloc, uvm_km), and check each buffer passed to copyout, copyoutstr,
bwrite, if_transmit_lock and DMA operations, to detect uninitialized memory
that leaves the system. This allows us to detect kernel info leaks in a way
that is more efficient and also more user-friendly than KLEAK.

Contrary to kASan, kMSan requires comprehensive coverage, ie we cannot
tolerate having one non-instrumented function, because this could cause
false positives. kMSan cannot instrument ASM functions, so I converted
most of them to __asm__ inlines, which kMSan is able to instrument. Those
that remain receive special treatment.

Contrary to kASan again, kMSan uses a TLS, so we must context-switch this
TLS during interrupts. We use different contexts depending on the interrupt
level.

The orig tracks precisely the origin of a buffer. We use a special encoding
for the orig values, and pack together in each uint32_t cell of the orig:
 - a code designating the type of memory (Stack, Pool, etc), and
 - a compressed pointer, which points either (1) to a string containing
   the name of the variable associated with the cell, or (2) to an area
   in the kernel .text section which we resolve to a symbol name + offset.

This encoding allows us not to consume extra memory for associating
information with each cell, and produces a precise output, that can tell
for example the name of an uninitialized variable on the stack, the
function in which it was pushed on the stack, and the function where we
accessed this uninitialized variable.

kMSan is available with LLVM, but not with GCC.

The code is organized in a way that is similar to kASan and kCSan, so it
means that other architectures than amd64 can be supported.

Revision 1.207 / (download) - annotate - [select for diffs], Sun Nov 10 23:39:03 2019 UTC (4 years, 4 months ago) by joerg
Branch: MAIN
Changes since 1.206: +7 -2 lines
Diff to previous 1.206 (colored) to selected 1.40.2.15 (colored)

Ensure that the second LWP of a new process uses a free LWP ID.
Document overflow behavior.

Revision 1.206 / (download) - annotate - [select for diffs], Thu Nov 7 19:45:18 2019 UTC (4 years, 4 months ago) by joerg
Branch: MAIN
Changes since 1.205: +4 -2 lines
Diff to previous 1.205 (colored) to selected 1.40.2.15 (colored)

Preserve the LWP ID of the calling thread on (v)fork. This ensures that
_lwp_self() remains invariant as necessary for the locking in the
dynamic linker. Otherwise if a process creates a thread and forks from
it, the main thread of the parent would share the LWP ID of the main
thread of the child, even though they have different origins.

Partial fix for pkg/54192.

Revision 1.202.2.2 / (download) - annotate - [select for diffs], Tue Oct 15 19:01:06 2019 UTC (4 years, 5 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.202.2.1: +10 -3 lines
Diff to previous 1.202.2.1 (colored) to branchpoint 1.202 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by kamil in ticket #320):

	sys/kern/kern_synch.c: revision 1.324
	sys/kern/kern_sig.c: revision 1.366
	sys/kern/kern_exit.c: revision 1.277
	sys/kern/kern_lwp.c: revision 1.204
	sys/kern/sys_ptrace_common.c: revision 1.62

Separate flag for suspended by _lwp_suspend and suspended by a debugger

Once a thread was stopped with ptrace(2), userland process must not
be able to unstop it deliberately or by an accident.

This was a Windows-style behavior that makes threading tracing fragile.

Revision 1.202.2.1 / (download) - annotate - [select for diffs], Tue Oct 15 18:32:13 2019 UTC (4 years, 5 months ago) by martin
Branch: netbsd-9
Changes since 1.202: +4 -4 lines
Diff to previous 1.202 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by kamil in ticket #311):

	sys/sys/siginfo.h: revision 1.34
	sys/kern/sys_ptrace_common.c: revision 1.59
	sys/kern/sys_lwp.c: revision 1.70
	sys/compat/sys/siginfo.h: revision 1.8
	sys/kern/kern_sig.c: revision 1.365
	sys/kern/kern_lwp.c: revision 1.203
	sys/sys/signalvar.h: revision 1.96
	sys/kern/kern_exec.c: revision 1.482
	sys/kern/kern_fork.c: revision 1.214

Move TRAP_CHLD/TRAP_LWP ptrace information from struct proc to siginfo

Storing struct ptrace_state information inside struct proc was vulnerable
to synchronization bugs, as multiple events emitted in the same time were
overwritting other ones.

Cache the original parent process id in p_oppid. Reusing here p_opptr is
in theory prone to slight race codition.

Change the semantics of PT_GET_PROCESS_STATE, reutning EINVAL for calls
prompting for the value in cases when there wasn't registered an
appropriate event.

Add an alternative approach to check the ptrace_state information, directly
from the siginfo_t value returned from PT_GET_SIGINFO. The original
PT_GET_PROCESS_STATE approach is kept for compat with older NetBSD and
OpenBSD. New code is recommended to keep using PT_GET_PROCESS_STATE.
Add a couple of compile-time asserts for assumptions in the code.

No functional change intended in existing ptrace(2) software.

All ATF ptrace(2) and ATF GDB tests pass.

This change improves reliability of the threading ptrace(2) code.

Revision 1.205 / (download) - annotate - [select for diffs], Sun Oct 6 15:11:17 2019 UTC (4 years, 5 months ago) by uwe
Branch: MAIN
Changes since 1.204: +3 -5 lines
Diff to previous 1.204 (colored) to selected 1.40.2.15 (colored)

xc_barrier - convenience function to xc_broadcast() a nop.

Make the intent more clear and also avoid a bunch of (xcfunc_t)nullop
casts that gcc 8 -Wcast-function-type is not happy about.

Revision 1.204 / (download) - annotate - [select for diffs], Thu Oct 3 22:48:44 2019 UTC (4 years, 5 months ago) by kamil
Branch: MAIN
Changes since 1.203: +10 -3 lines
Diff to previous 1.203 (colored) to selected 1.40.2.15 (colored)

Separate flag for suspended by _lwp_suspend and suspended by a debugger

Once a thread was stopped with ptrace(2), userland process must not
be able to unstop it deliberately or by an accident.

This was a Windows-style behavior that makes threading tracing fragile.

Revision 1.203 / (download) - annotate - [select for diffs], Mon Sep 30 21:13:33 2019 UTC (4 years, 5 months ago) by kamil
Branch: MAIN
Changes since 1.202: +4 -4 lines
Diff to previous 1.202 (colored) to selected 1.40.2.15 (colored)

Move TRAP_CHLD/TRAP_LWP ptrace information from struct proc to siginfo

Storing struct ptrace_state information inside struct proc was vulnerable
to synchronization bugs, as multiple events emitted in the same time were
overwritting other ones.

Cache the original parent process id in p_oppid. Reusing here p_opptr is
in theory prone to slight race codition.

Change the semantics of PT_GET_PROCESS_STATE, reutning EINVAL for calls
prompting for the value in cases when there wasn't registered an
appropriate event.

Add an alternative approach to check the ptrace_state information, directly
from the siginfo_t value returned from PT_GET_SIGINFO. The original
PT_GET_PROCESS_STATE approach is kept for compat with older NetBSD and
OpenBSD. New code is recommended to keep using PT_GET_PROCESS_STATE.

Add a couple of compile-time asserts for assumptions in the code.

No functional change intended in existing ptrace(2) software.

All ATF ptrace(2) and ATF GDB tests pass.

This change improves reliability of the threading ptrace(2) code.

Revision 1.192.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:03 2019 UTC (4 years, 9 months ago) by christos
Branch: phil-wifi
Changes since 1.192: +31 -41 lines
Diff to previous 1.192 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.202 / (download) - annotate - [select for diffs], Tue Jun 4 11:54:03 2019 UTC (4 years, 9 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base
Branch point for: netbsd-9
Changes since 1.201: +13 -5 lines
Diff to previous 1.201 (colored) to selected 1.40.2.15 (colored)

Stop trying to inform debugger about events from an exiting child

Do not emit signals to parent for if a process is demising:

 - fork/vfork/similar
 - lwp created/exited
 - exec
 - syscall entry/exit

With these changes Go applications can be traced without a clash under
a debugger, at least without deadlocking always. The culprit reason was
an attempt to inform a debugger in the middle of exit1() call about
a dying LWP. Go applications perform exit(2) without collecting threads
first. Verified with GDB and picotrace-based utilities like sigtracer.

PR kern/53120
PR port-arm/51677
PR bin/54060
PR bin/49662
PR kern/52548

Revision 1.201 / (download) - annotate - [select for diffs], Fri May 17 03:34:26 2019 UTC (4 years, 10 months ago) by ozaki-r
Branch: MAIN
Changes since 1.200: +4 -2 lines
Diff to previous 1.200 (colored) to selected 1.40.2.15 (colored)

Implement an aggressive psref leak detector

It is yet another psref leak detector that enables to tell where a leak occurs
while a simpler version that is already committed just tells an occurrence of a
leak.

Investigating of psref leaks is hard because once a leak occurs a percpu list of
psref that tracks references can be corrupted.  A reference to a tracking object
is memorized in the list via an intermediate object (struct psref) that is
normally allocated on a stack of a thread.  Thus, the intermediate object can be
overwritten on a leak resulting in corruption of the list.

The tracker makes a shadow entry to an intermediate object and stores some hints
into it (currently it's a caller address of psref_acquire).  We can detect a
leak by checking the entries on certain points where any references should be
released such as the return point of syscalls and the end of each softint
handler.

The feature is expensive and enabled only if the kernel is built with
PSREF_DEBUG.

Proposed on tech-kern

Revision 1.200 / (download) - annotate - [select for diffs], Fri May 3 22:34:21 2019 UTC (4 years, 10 months ago) by kamil
Branch: MAIN
Changes since 1.199: +3 -5 lines
Diff to previous 1.199 (colored) to selected 1.40.2.15 (colored)

Register KTR events for debugger related signals

Register signals for:

 - crashes (FPE, SEGV, FPE, ILL, BUS)
 - LWP events
 - CHLD (FORK/VFORK/VFORK_DONE) events -- temporarily disabled
 - EXEC events

While there refactor related functions in order to simplify the code.

Add missing comment documentation for recently added kernel functions.

Revision 1.199 / (download) - annotate - [select for diffs], Thu May 2 22:23:49 2019 UTC (4 years, 10 months ago) by kamil
Branch: MAIN
Changes since 1.198: +3 -3 lines
Diff to previous 1.198 (colored) to selected 1.40.2.15 (colored)

Introduce fixes for ptrace(2)

Stop disabling LWP create and exit events for PT_SYSCALL tracing.
PT_SYSCALL disabled EXEC reporting for legacy reasons, there is no need
to repeat it for LWP and CHLD events.

Pass full siginfo from trapsignal events (SEGV, BUS, ILL, TRAP, FPE).
This adds missing information about signals like fault address.

Set ps_lwp always.

Before passing siginfo to userland through p_sigctx.ps_info, make sure
that it was zeroed for unused bytes. LWP and CHLD events do not set si_addr
and si_trap, these pieces of information are passed for crashes (like
software breakpoint).

LLDB crash reporting works now correctly:

(lldb) r
Process 552 launched: '/tmp/a.out' (x86_64)
Process 552 stopped
* thread #1, stop reason = signal SIGSEGV: invalid address (fault address: 0x123456)

Revision 1.198 / (download) - annotate - [select for diffs], Wed May 1 21:57:34 2019 UTC (4 years, 10 months ago) by kamil
Branch: MAIN
Changes since 1.197: +15 -38 lines
Diff to previous 1.197 (colored) to selected 1.40.2.15 (colored)

Correct passing debugger related events for LWP create and exit

Add MI toplevel startlwp function.

Switch all userland LWPs to go through lwp_create using a shared
mi_startlwp() function between all MD ABIs.

Add debugger related event handling in mi_startlwp() and continue with
standard p->p_emul->e_startlwp at the end of this routine.

Use eventswitch() to notify the event of LWP exit in lwp_exit().

ATF ptrace(2) tests signal9 and signal10 now pass.

Revision 1.197 / (download) - annotate - [select for diffs], Fri Apr 19 01:52:55 2019 UTC (4 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.196: +3 -2 lines
Diff to previous 1.196 (colored) to selected 1.40.2.15 (colored)

Implement a simple psref leak detector

It detects leaks by counting up the number of held psref by an LWP and checking
its zeroness at the end of syscalls and softint handlers.  For the counter, a
unused field of struct lwp is reused.

The detector runs only if DIAGNOSTIC is turned on.

Revision 1.196 / (download) - annotate - [select for diffs], Fri Mar 1 09:02:03 2019 UTC (5 years ago) by hannken
Branch: MAIN
Changes since 1.195: +6 -2 lines
Diff to previous 1.195 (colored) to selected 1.40.2.15 (colored)

Move pointer to fstrans private data into "struct lwp".

Ride NetBSD 8.99.35

Revision 1.191.2.3 / (download) - annotate - [select for diffs], Wed Dec 26 14:02:03 2018 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.191.2.2: +3 -3 lines
Diff to previous 1.191.2.2 (colored) to branchpoint 1.191 (colored) next main 1.192 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.195 / (download) - annotate - [select for diffs], Mon Nov 26 17:18:01 2018 UTC (5 years, 4 months ago) by skrll
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.194: +3 -3 lines
Diff to previous 1.194 (colored) to selected 1.40.2.15 (colored)

Use cpu_index(). NFC.

Revision 1.191.2.2 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:08 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.191.2.1: +4 -4 lines
Diff to previous 1.191.2.1 (colored) to branchpoint 1.191 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.194 / (download) - annotate - [select for diffs], Wed Jul 4 18:15:27 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728
Changes since 1.193: +1 -1 lines
Diff to previous 1.193 (colored) to selected 1.40.2.15 (colored)

Avoid undefined behavior in lwp_ctl_free()

Do not left shift signed integer in a way that the signedness bit is
changed.

sys/kern/kern_lwp.c:1892:29, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with Kernel Undefined Behavior Sanitizer.

Reported by <Harry Pantazis>

Revision 1.193 / (download) - annotate - [select for diffs], Wed Jul 4 18:13:01 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.192: +3 -3 lines
Diff to previous 1.192 (colored) to selected 1.40.2.15 (colored)

Avoid undefined behavior in lwp_ctl_alloc()

Do not left shift signed integer in a way that the signedness bit is
changed.

sys/kern/kern_lwp.c:1849:27, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with Kernel Undefined Behavior Sanitizer.

Reported by <Harry Pantazis>

Revision 1.189.2.2 / (download) - annotate - [select for diffs], Mon May 14 19:11:21 2018 UTC (5 years, 10 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2
Changes since 1.189.2.1: +4 -5 lines
Diff to previous 1.189.2.1 (colored) to branchpoint 1.189 (colored) next main 1.190 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by gson in ticket #805):

	sys/kern/kern_lwp.c: revision 1.192

PR/kern/53202: Kernel hangs running t_ptrace_wait:resume1 test, revert
previous.

Revision 1.191.2.1 / (download) - annotate - [select for diffs], Wed May 2 07:20:22 2018 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.191: +4 -5 lines
Diff to previous 1.191 (colored) to selected 1.40.2.15 (colored)

Synch with HEAD

Revision 1.192 / (download) - annotate - [select for diffs], Mon Apr 23 15:51:00 2018 UTC (5 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502
Branch point for: phil-wifi
Changes since 1.191: +4 -5 lines
Diff to previous 1.191 (colored) to selected 1.40.2.15 (colored)

PR/kern/53202: Kernel hangs running t_ptrace_wait:resume1 test, revert
previous.

Revision 1.189.2.1 / (download) - annotate - [select for diffs], Sun Dec 10 09:35:03 2017 UTC (6 years, 3 months ago) by snj
Branch: netbsd-8
CVS Tags: netbsd-8-0-RC1
Changes since 1.189: +5 -4 lines
Diff to previous 1.189 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by christos in ticket #417):
	sys/kern/kern_lwp.c: revision 1.191
Also wait interruptibly when exiting. Avoids deadlocked on exit processes
create by golang.

Revision 1.172.2.5 / (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.172.2.4: +70 -41 lines
Diff to previous 1.172.2.4 (colored) next main 1.173 (colored) to selected 1.40.2.15 (colored)

update from HEAD

Revision 1.191 / (download) - annotate - [select for diffs], Sat Dec 2 22:51:22 2017 UTC (6 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.190: +5 -4 lines
Diff to previous 1.190 (colored) to selected 1.40.2.15 (colored)

Also wait interruptibly when exiting. Avoids deadlocked on exit processes
create by golang.

Revision 1.179.2.5 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:07 2017 UTC (6 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.179.2.4: +9 -12 lines
Diff to previous 1.179.2.4 (colored) to branchpoint 1.179 (colored) next main 1.180 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.190 / (download) - annotate - [select for diffs], Thu Jun 22 09:05:09 2017 UTC (6 years, 9 months ago) by skrll
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825
Changes since 1.189: +3 -4 lines
Diff to previous 1.189 (colored) to selected 1.40.2.15 (colored)

Unwrap two lines. NFC.

Revision 1.189 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:13 2017 UTC (6 years, 9 months ago) by chs
Branch: MAIN
CVS Tags: netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: netbsd-8
Changes since 1.188: +3 -6 lines
Diff to previous 1.188 (colored) to selected 1.40.2.15 (colored)

remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.185.2.2 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:26 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.185.2.1: +7 -6 lines
Diff to previous 1.185.2.1 (colored) to branchpoint 1.185 (colored) next main 1.186 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.187.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:02 2017 UTC (6 years, 11 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.187: +7 -6 lines
Diff to previous 1.187 (colored) next main 1.188 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.188 / (download) - annotate - [select for diffs], Fri Apr 21 15:10:34 2017 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, bouyer-socketcan-base1
Changes since 1.187: +7 -6 lines
Diff to previous 1.187 (colored) to selected 1.40.2.15 (colored)

- Propagate the signal mask from the ucontext_t to the newly created thread
  as specified by _lwp_create(2)
- Reset the signal stack for threads created with _lwp_create(2)

Revision 1.185.2.1 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:47 2017 UTC (7 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.185: +38 -2 lines
Diff to previous 1.185 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.179.2.4 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:56 2017 UTC (7 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.179.2.3: +44 -8 lines
Diff to previous 1.179.2.3 (colored) to branchpoint 1.179 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.187 / (download) - annotate - [select for diffs], Sat Jan 14 19:32:10 2017 UTC (7 years, 2 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320, nick-nhusb-base-20170204, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.186: +3 -3 lines
Diff to previous 1.186 (colored) to selected 1.40.2.15 (colored)

Fix generation of PTRACE_LWP_EXIT event

Set p_lwp_exited instead of p_lwp_created for PTRACE_LWP_EXIT.

This made the lwp_exit1 ATF test passing.

Sponsored by <The NetBSD Foundation>

Revision 1.186 / (download) - annotate - [select for diffs], Sat Jan 14 06:36:52 2017 UTC (7 years, 2 months ago) by kamil
Branch: MAIN
Changes since 1.185: +38 -2 lines
Diff to previous 1.185 (colored) to selected 1.40.2.15 (colored)

Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5)

Add interface in ptrace(2) to track thread (LWP) events:
 - birth,
 - termination.

The purpose of this thread is to keep track of the current thread state in
a tracee and apply e.g. per-thread designed hardware assisted watchpoints.

This interface reuses the EVENT_MASK and PROCESS_STATE interface, and
shares it with PTRACE_FORK, PTRACE_VFORK and PTRACE_VFORK_DONE.

Change the following structure:

typedef struct ptrace_state {
        int     pe_report_event;
        pid_t   pe_other_pid;
} ptrace_state_t;

to

typedef struct ptrace_state {
        int     pe_report_event;
        union {
                pid_t   _pe_other_pid;
                lwpid_t _pe_lwp;
        } _option;
} ptrace_state_t;

#define pe_other_pid    _option._pe_other_pid
#define pe_lwp          _option._pe_lwp

This keeps size of ptrace_state_t unchanged as both pid_t and lwpid_t are
defined as int32_t-like integer. This change does not break existing
prebuilt software and has minimal effect on necessity for source-code
changes. In summary, this change should be binary compatible and shouldn't
break build of existing software.


Introduce new siginfo(5) type for LWP events under the SIGTRAP signal:
TRAP_LWP. This change will help debuggers to distinguish exact source of
SIGTRAP.


Add two basic t_ptrace_wait* tests:
lwp_create1:
    Verify that 1 LWP creation is intercepted by ptrace(2) with
    EVENT_MASK set to PTRACE_LWP_CREATE

lwp_exit1:
    Verify that 1 LWP creation is intercepted by ptrace(2) with
    EVENT_MASK set to PTRACE_LWP_EXIT

All tests are passing.


Surfing the previous kernel ABI bump to 7.99.59 for PTRACE_VFORK{,_DONE}.

Sponsored by <The NetBSD Foundation>

Revision 1.179.2.3 / (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.179.2.2: +4 -2 lines
Diff to previous 1.179.2.2 (colored) to branchpoint 1.179 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.185 / (download) - annotate - [select for diffs], Sun Jul 3 14:24:58 2016 UTC (7 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.184: +4 -2 lines
Diff to previous 1.184 (colored) to selected 1.40.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.179.2.2 / (download) - annotate - [select for diffs], Fri Apr 22 15:44:16 2016 UTC (7 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.179.2.1: +4 -4 lines
Diff to previous 1.179.2.1 (colored) to branchpoint 1.179 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.184 / (download) - annotate - [select for diffs], Mon Apr 4 23:07:06 2016 UTC (7 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422
Changes since 1.183: +3 -3 lines
Diff to previous 1.183 (colored) to selected 1.40.2.15 (colored)

no need to pass the coredump flag to exit1() since it is set and known
in one place.

Revision 1.183 / (download) - annotate - [select for diffs], Mon Apr 4 20:47:57 2016 UTC (7 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.182: +4 -4 lines
Diff to previous 1.182 (colored) to selected 1.40.2.15 (colored)

Split p_xstat (composite wait(2) status code, or signal number depending
on context) into:
1. p_xexit:		exit code
2. p_xsig:		signal number
3. p_sflag & WCOREFLAG	bit to indicated that the process core-dumped.

Fix the documentation of the flag bits in <sys/proc.h>

Revision 1.179.2.1 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:05 2015 UTC (8 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.179: +13 -19 lines
Diff to previous 1.179 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.182 / (download) - annotate - [select for diffs], Thu Nov 26 13:15:34 2015 UTC (8 years, 4 months ago) by martin
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.181: +4 -3 lines
Diff to previous 1.181 (colored) to selected 1.40.2.15 (colored)

We never exec(2) with a kernel vmspace, so do not test for that, but instead
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.

Revision 1.181 / (download) - annotate - [select for diffs], Thu Nov 12 10:47:30 2015 UTC (8 years, 4 months ago) by skrll
Branch: MAIN
Changes since 1.180: +3 -3 lines
Diff to previous 1.180 (colored) to selected 1.40.2.15 (colored)

Drop to spl0 after the pmap_activate call.  Should address

PR port-arm/50420: curcpu()->ci_pmap_cur != pm || pm->pm_pai[0].pai_asid == curcpu()->ci_pmap_asid_cur" failed

Discussed with matt@ and rmind@

Revision 1.180 / (download) - annotate - [select for diffs], Fri Oct 2 16:54:15 2015 UTC (8 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.179: +10 -17 lines
Diff to previous 1.179 (colored) to selected 1.40.2.15 (colored)

Change SDT (Statically Defined Tracing) probes to use link sets so that it
is easier to add probes. (From FreeBSD)

Revision 1.179 / (download) - annotate - [select for diffs], Sat Oct 18 08:33:29 2014 UTC (9 years, 5 months ago) by snj
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored) to selected 1.40.2.15 (colored)

src is too big these days to tolerate superfluous apostrophes.  It's
"its", people!

Revision 1.178 / (download) - annotate - [select for diffs], Fri Sep 5 05:57:21 2014 UTC (9 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.177: +15 -15 lines
Diff to previous 1.177 (colored) to selected 1.40.2.15 (colored)

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

Revision 1.172.2.4 / (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.172.2.3: +8 -2 lines
Diff to previous 1.172.2.3 (colored) to selected 1.40.2.15 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.164.2.4 / (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.164.2.3: +13 -7 lines
Diff to previous 1.164.2.3 (colored) to branchpoint 1.164 (colored) next main 1.165 (colored) to selected 1.40.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.175.2.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.175: +10 -4 lines
Diff to previous 1.175 (colored) next main 1.176 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.177 / (download) - annotate - [select for diffs], Mon Nov 25 16:29:25 2013 UTC (10 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, 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.176: +9 -3 lines
Diff to previous 1.176 (colored) to selected 1.40.2.15 (colored)

Use the process credentials instead of the lwp credentials because if the
process just did a setuid() call, the lwp might not have had a chance to
refresh l->l_cred (still has LPR_CRMOD), and we don't want to bother spending
time syncing the creds of a dying lwp. Should fix the problem with hald
people have been observing.

Revision 1.176 / (download) - annotate - [select for diffs], Fri Nov 22 21:04:11 2013 UTC (10 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.175: +3 -3 lines
Diff to previous 1.175 (colored) to selected 1.40.2.15 (colored)

convert vmem, signals, powerhooks from CIRCLEQ -> TAILQ.

Revision 1.172.2.3 / (download) - annotate - [select for diffs], Sun Jun 23 06:18:57 2013 UTC (10 years, 9 months ago) by tls
Branch: tls-maxphys
Changes since 1.172.2.2: +5 -5 lines
Diff to previous 1.172.2.2 (colored) to selected 1.40.2.15 (colored)

resync from head

Revision 1.175 / (download) - annotate - [select for diffs], Sun Jun 9 01:13:47 2013 UTC (10 years, 9 months ago) by riz
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.174: +5 -5 lines
Diff to previous 1.174 (colored) to selected 1.40.2.15 (colored)

Add another field to the SDT_PROBE_DEFINE macro, so our DTrace probes
can named the same as those on other platforms.

For example, proc:::exec-success, not proc:::exec_success.

Implementation follows the same basic principle as FreeBSD's; add
another field to the SDT_PROBE_DEFINE macro which is the name
as exposed to userland.

Revision 1.172.2.2 / (download) - annotate - [select for diffs], Mon Feb 25 00:29:51 2013 UTC (11 years, 1 month ago) by tls
Branch: tls-maxphys
Changes since 1.172.2.1: +75 -8 lines
Diff to previous 1.172.2.1 (colored) to selected 1.40.2.15 (colored)

resync with head

Revision 1.164.2.3 / (download) - annotate - [select for diffs], Wed Jan 23 00:06:21 2013 UTC (11 years, 2 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.164.2.2: +75 -8 lines
Diff to previous 1.164.2.2 (colored) to branchpoint 1.164 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.174 / (download) - annotate - [select for diffs], Sun Dec 16 22:21:03 2012 UTC (11 years, 3 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-pagecache-base8, khorben-n900, agc-symver-base, agc-symver
Changes since 1.173: +75 -8 lines
Diff to previous 1.173 (colored) to selected 1.40.2.15 (colored)

The lwp_id in a process are supposed to be non-zero and unique.
This stops being true once a process has allocated (and freed) 2^32 lwps.
(I've not timed it!)
There is also some code lurking (eg ld.elf_so) that doesn't expect the
  high be be set.
Once the lwp_id wraps, scan the list to find the first free id higher
  than the last one allocated.
Maintain the sort order to make the possible.
Note that if some lwp (but not all) are allocated numbers from the pid
  space it will go horribly wrong.
Tested by setting the limit to 128 and getting firefox to create threads.

Revision 1.172.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:42 2012 UTC (11 years, 4 months ago) by tls
Branch: tls-maxphys
Changes since 1.172: +14 -17 lines
Diff to previous 1.172 (colored) to selected 1.40.2.15 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.166.4.1 / (download) - annotate - [select for diffs], Thu Nov 1 16:45:03 2012 UTC (11 years, 4 months ago) by matt
Branch: matt-nb6-plus
Changes since 1.166: +14 -17 lines
Diff to previous 1.166 (colored) next main 1.167 (colored) to selected 1.40.2.15 (colored)

sync with netbsd-6-0-RELEASE.

Revision 1.164.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:29 2012 UTC (11 years, 5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.164.2.1: +86 -17 lines
Diff to previous 1.164.2.1 (colored) to branchpoint 1.164 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.166.2.1 / (download) - annotate - [select for diffs], Mon Oct 1 23:07:08 2012 UTC (11 years, 5 months ago) by riz
Branch: netbsd-6
CVS Tags: 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-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, matt-nb6-plus-nbase, matt-nb6-plus-base
Changes since 1.166: +14 -17 lines
Diff to previous 1.166 (colored) next main 1.167 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by rmind in ticket #583):
	sys/kern/sys_lwp.c: revision 1.55
	sys/sys/lwp.h: revision 1.164
	sys/kern/kern_exit.c: revision 1.242
	sys/kern/kern_lwp.c: revision 1.173
exit_lwps, lwp_wait: fix a race condition by re-trying if p_lock was dropped
in a case of process exit.  Necessary to re-flag all LWPs for exit, as their
state might have changed or new LWPs spawned.
Should fix PR/46168 and PR/46402.

Revision 1.173 / (download) - annotate - [select for diffs], Thu Sep 27 20:43:15 2012 UTC (11 years, 6 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6
Changes since 1.172: +14 -17 lines
Diff to previous 1.172 (colored) to selected 1.40.2.15 (colored)

exit_lwps, lwp_wait: fix a race condition by re-trying if p_lock was dropped
in a case of process exit.  Necessary to re-flag all LWPs for exit, as their
state might have changed or new LWPs spawned.

Should fix PR/46168 and PR/46402.

Revision 1.172 / (download) - annotate - [select for diffs], Thu Aug 30 02:26:02 2012 UTC (11 years, 7 months ago) by matt
Branch: MAIN
Branch point for: tls-maxphys
Changes since 1.171: +4 -2 lines
Diff to previous 1.171 (colored) to selected 1.40.2.15 (colored)

A few more KASSERT/KASSERTMSG.

Revision 1.171 / (download) - annotate - [select for diffs], Sun Jul 22 22:40:19 2012 UTC (11 years, 8 months ago) by rmind
Branch: MAIN
Changes since 1.170: +5 -2 lines
Diff to previous 1.170 (colored) to selected 1.40.2.15 (colored)

fork1: fix use-after-free problems.  Addresses PR/46128 from Andrew Doran.
Note: PL_PPWAIT should be fully replaced and modificaiton of l_pflag by
other LWP is undesirable, but this is enough for netbsd-6.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Jun 9 02:55:32 2012 UTC (11 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.169: +5 -10 lines
Diff to previous 1.169 (colored) to selected 1.40.2.15 (colored)

Remove debugging.

Revision 1.169 / (download) - annotate - [select for diffs], Sat Jun 9 02:31:14 2012 UTC (11 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.168: +74 -2 lines
Diff to previous 1.168 (colored) to selected 1.40.2.15 (colored)

Add a new resource to limit the number of lwps per user, RLIMIT_NTHR. There
is a global sysctl kern.maxlwp to control this, which is by default 2048.
The first lwp of each process or kernel threads are not counted against the
limit. To show the current resource usage per user, I added a new sysctl
that dumps the uidinfo structure fields.

Revision 1.164.6.3 / (download) - annotate - [select for diffs], Sun Apr 29 23:05:04 2012 UTC (11 years, 11 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.164.6.2: +3 -3 lines
Diff to previous 1.164.6.2 (colored) to branchpoint 1.164 (colored) next main 1.165 (colored) to selected 1.40.2.15 (colored)

sync to latest -current.

Revision 1.164.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:24 2012 UTC (11 years, 11 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.164: +9 -35 lines
Diff to previous 1.164 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.168 / (download) - annotate - [select for diffs], Fri Apr 13 15:32:43 2012 UTC (11 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Changes since 1.167: +3 -3 lines
Diff to previous 1.167 (colored) to selected 1.40.2.15 (colored)

comment

Revision 1.164.6.2 / (download) - annotate - [select for diffs], Fri Feb 24 09:11:46 2012 UTC (12 years, 1 month ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.164.6.1: +5 -33 lines
Diff to previous 1.164.6.1 (colored) to branchpoint 1.164 (colored) to selected 1.40.2.15 (colored)

sync to -current.

Revision 1.167 / (download) - annotate - [select for diffs], Sun Feb 19 21:06:51 2012 UTC (12 years, 1 month ago) by rmind
Branch: MAIN
CVS Tags: jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3
Changes since 1.166: +5 -33 lines
Diff to previous 1.166 (colored) to selected 1.40.2.15 (colored)

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

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

merge to -current.

Revision 1.166 / (download) - annotate - [select for diffs], Sat Feb 11 23:16:17 2012 UTC (12 years, 1 month ago) by martin
Branch: MAIN
CVS Tags: netbsd-6-base, netbsd-6-0-RC2, netbsd-6-0-RC1, jmcneill-usbmp-base2
Branch point for: netbsd-6, matt-nb6-plus
Changes since 1.165: +4 -3 lines
Diff to previous 1.165 (colored) to selected 1.40.2.15 (colored)

Add a posix_spawn syscall, as discussed on tech-kern.
Based on the summer of code project by Charles Zhang, heavily reworked
later by me - all bugs are likely mine.
Ok: core, releng.

Revision 1.165 / (download) - annotate - [select for diffs], Thu Dec 15 00:05:18 2011 UTC (12 years, 3 months ago) by jmcneill
Branch: MAIN
Changes since 1.164: +3 -2 lines
Diff to previous 1.164 (colored) to selected 1.40.2.15 (colored)

In lwp_create, copy l_sigstk from the template. Previously sigaltstack wasn't
inherited across fork (but SA_ONSTACK handlers was), causing the child
process to crash when the handler is invoked. ok martin@, christos@

Revision 1.164 / (download) - annotate - [select for diffs], Wed Oct 19 10:51:47 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.163: +3 -2 lines
Diff to previous 1.163 (colored) to selected 1.40.2.15 (colored)

don't forget to call kdtrace_thread_ctor for lwp0

Revision 1.163 / (download) - annotate - [select for diffs], Wed Aug 31 16:04:39 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.162: +5 -2 lines
Diff to previous 1.162 (colored) to selected 1.40.2.15 (colored)

make lwp_unstop look like proc_unstop. If p->p_xstat is set, then make it
runnable so that it can receive the signal.

Revision 1.162 / (download) - annotate - [select for diffs], Sun Aug 7 21:13:05 2011 UTC (12 years, 7 months ago) by rmind
Branch: MAIN
Changes since 1.161: +19 -19 lines
Diff to previous 1.161 (colored) to selected 1.40.2.15 (colored)

Remove LW_AFFINITY flag and fix some bugs affinity mask handling.

Revision 1.161 / (download) - annotate - [select for diffs], Sat Jul 30 17:01:04 2011 UTC (12 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.160: +7 -2 lines
Diff to previous 1.160 (colored) to selected 1.40.2.15 (colored)

Add an implementation of passive serialization as described in expired
US patent 4809168. This is a reader / writer synchronization mechanism,
designed for lock-less read operations.

Revision 1.160 / (download) - annotate - [select for diffs], Tue Jul 26 13:03:57 2011 UTC (12 years, 8 months ago) by yamt
Branch: MAIN
Changes since 1.159: +3 -2 lines
Diff to previous 1.159 (colored) to selected 1.40.2.15 (colored)

assertion

Revision 1.157.2.1 / (download) - annotate - [select for diffs], Thu Jun 23 14:20:19 2011 UTC (12 years, 9 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.157: +21 -8 lines
Diff to previous 1.157 (colored) next main 1.158 (colored) to selected 1.40.2.15 (colored)

Catchup with rmind-uvmplock merge.

Revision 1.159 / (download) - annotate - [select for diffs], Mon Jun 13 21:32:42 2011 UTC (12 years, 9 months ago) by matt
Branch: MAIN
Changes since 1.158: +10 -8 lines
Diff to previous 1.158 (colored) to selected 1.40.2.15 (colored)

Deal with PCU state when performing coredumps.  As the kernel moves each LWP
into LSSUSPENDED state, have that LWP save its PCU state for the coredump and
release its PCU status since its probably going to be exiting very soon.
Make pcu_save_all tolerate for being called for non-curlwp if that lwp belongs
to the same process, has a state of LSSUSPENDED, and no PCUs are in use.

Make the MD coredump code use pcu_save_all(l) since it'll need to save all
the PCU state anyways and can take advantage of the above tests.

Revision 1.141.2.5 / (download) - annotate - [select for diffs], Sun Jun 12 00:24:29 2011 UTC (12 years, 9 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.141.2.4: +11 -0 lines
Diff to previous 1.141.2.4 (colored) to branchpoint 1.141 (colored) next main 1.142 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.158 / (download) - annotate - [select for diffs], Mon Jun 6 22:04:34 2011 UTC (12 years, 9 months ago) by matt
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base
Changes since 1.157: +13 -2 lines
Diff to previous 1.157 (colored) to selected 1.40.2.15 (colored)

Add some more MI hook points for PCU.  Discard the PCU state at lwp_exit and
at exec time.  Before forking, save the PCU state so that cpu_lwp_fork
doesn't have.  Remove MD code which did that before.

Revision 1.153.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:29 2011 UTC (12 years, 9 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.153: +61 -4 lines
Diff to previous 1.153 (colored) next main 1.154 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.126.2.2.4.2 / (download) - annotate - [select for diffs], Fri Apr 29 08:20:15 2011 UTC (12 years, 11 months ago) by matt
Branch: matt-nb5-mips64
Changes since 1.126.2.2.4.1: +17 -2 lines
Diff to previous 1.126.2.2.4.1 (colored) to branchpoint 1.126.2.2 (colored) next main 1.127 (colored) to selected 1.40.2.15 (colored)

Pull in lwp_setprivate/cpu_lwp_setprivate from -current.
Also pull in lwp_getpcb

Revision 1.141.2.4 / (download) - annotate - [select for diffs], Thu Apr 21 01:42:08 2011 UTC (12 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.141.2.3: +24 -1 lines
Diff to previous 1.141.2.3 (colored) to branchpoint 1.141 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.157 / (download) - annotate - [select for diffs], Sun Mar 20 23:19:16 2011 UTC (13 years ago) by rmind
Branch: MAIN
CVS Tags: cherry-xenmp-base
Branch point for: cherry-xenmp
Changes since 1.156: +26 -3 lines
Diff to previous 1.156 (colored) to selected 1.40.2.15 (colored)

Optimise mutex_onproc() and rw_onproc() by making them O(1), instead
of O(ncpu) for adaptive paths.  Add an LWP destructor, lwp_dtor() with
a comment describing the principle of this barrier.

Reviewed by yamt@ and ad@.

Revision 1.141.2.3 / (download) - annotate - [select for diffs], Sat Mar 5 20:55:15 2011 UTC (13 years ago) by rmind
Branch: rmind-uvmplock
Changes since 1.141.2.2: +79 -75 lines
Diff to previous 1.141.2.2 (colored) to branchpoint 1.141 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.154.2.1 / (download) - annotate - [select for diffs], Sat Mar 5 15:10:39 2011 UTC (13 years ago) by bouyer
Branch: bouyer-quota2
Changes since 1.154: +34 -3 lines
Diff to previous 1.154 (colored) next main 1.155 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.156 / (download) - annotate - [select for diffs], Mon Feb 21 20:23:28 2011 UTC (13 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: bouyer-quota2-nbase
Changes since 1.155: +33 -3 lines
Diff to previous 1.155 (colored) to selected 1.40.2.15 (colored)

Borrow the lwpctl data area from the parent for the vfork() child.
Otherwise the child will incorrectly see it is not running on any
CPU.  Among other things, this fixes crashes from having
LD_PRELOAD=libpthread.so set in the env.

reviewed by tech-kern

Revision 1.155 / (download) - annotate - [select for diffs], Thu Feb 17 18:50:02 2011 UTC (13 years, 1 month ago) by matt
Branch: MAIN
Changes since 1.154: +3 -2 lines
Diff to previous 1.154 (colored) to selected 1.40.2.15 (colored)

When freeing a lwp, make sure it's biglock count is 0.

Revision 1.126.2.2.4.1 / (download) - annotate - [select for diffs], Sat Feb 5 06:00:13 2011 UTC (13 years, 1 month ago) by cliff
Branch: matt-nb5-mips64
Changes since 1.126.2.2: +3 -2 lines
Diff to previous 1.126.2.2 (colored) to selected 1.40.2.15 (colored)

- include opt_multiprocessor.h for explicit MULTIPROCESSOR dependency

Revision 1.154 / (download) - annotate - [select for diffs], Mon Jan 17 08:26:58 2011 UTC (13 years, 2 months ago) by matt
Branch: MAIN
CVS Tags: bouyer-quota2-base
Branch point for: bouyer-quota2
Changes since 1.153: +5 -2 lines
Diff to previous 1.153 (colored) to selected 1.40.2.15 (colored)

If LWP0_MD_INITIALIZER is defined, use it to initalize .l_md (avoid runtime
to do it if possible).

Revision 1.153 / (download) - annotate - [select for diffs], Fri Jan 14 02:06:34 2011 UTC (13 years, 2 months ago) by rmind
Branch: MAIN
CVS Tags: jruoho-x86intr-base
Branch point for: jruoho-x86intr
Changes since 1.152: +4 -2 lines
Diff to previous 1.152 (colored) to selected 1.40.2.15 (colored)

Retire struct user, remove sys/user.h inclusions.  Note sys/user.h header
as obsolete.  Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.

Revision 1.152 / (download) - annotate - [select for diffs], Sat Dec 18 01:36:19 2010 UTC (13 years, 3 months ago) by rmind
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231
Changes since 1.151: +10 -61 lines
Diff to previous 1.151 (colored) to selected 1.40.2.15 (colored)

- Fix a few possible locking issues in execve1() and exit1().  Add a note
  that scheduler locks are special in this regard - adaptive locks cannot
  be in the path due to turnstiles.  Randomly spotted/reported by uebayasi@.
- Remove unused lwp_relock() and replace lwp_lock_retry() by simplifying
  lwp_lock() and sleepq_enter() a little.
- Give alllwp its own cache-line and mark lwp_cache pointer as read-mostly.

OK ad@

Revision 1.137.2.2 / (download) - annotate - [select for diffs], Tue Aug 17 06:47:27 2010 UTC (13 years, 7 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.137.2.1: +97 -27 lines
Diff to previous 1.137.2.1 (colored) to branchpoint 1.137 (colored) next main 1.138 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.106.2.7 / (download) - annotate - [select for diffs], Wed Aug 11 22:54:39 2010 UTC (13 years, 7 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.106.2.6: +157 -127 lines
Diff to previous 1.106.2.6 (colored) to branchpoint 1.106 (colored) next main 1.107 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.151 / (download) - annotate - [select for diffs], Wed Jul 7 01:30:37 2010 UTC (13 years, 8 months ago) by chs
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2
Changes since 1.150: +38 -19 lines
Diff to previous 1.150 (colored) to selected 1.40.2.15 (colored)

many changes for COMPAT_LINUX:
 - update the linux syscall table for each platform.
 - support new-style (NPTL) linux pthreads on all platforms.
   clone() with CLONE_THREAD uses 1 process with many LWPs
   instead of separate processes.
 - move the contents of sys__lwp_setprivate() into a new
   lwp_setprivate() and use that everywhere.
 - update linux_release[] and linux32_release[] to "2.6.18".
 - adjust placement of emul fork/exec/exit hooks as needed
   and adjust other emul code to match.
 - convert all struct emul definitions to use named initializers.
 - change the pid allocator to allow multiple pids to refer to the same proc.
 - remove a few fields from struct proc that are no longer needed.
 - disable the non-functional "vdso" code in linux32/amd64,
   glibc works fine without it.
 - fix a race in the futex code where we could miss a wakeup after
   a requeue operation.
 - redo futex locking to be a little more efficient.

Revision 1.141.2.2 / (download) - annotate - [select for diffs], Sat Jul 3 01:19:53 2010 UTC (13 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.141.2.1: +63 -12 lines
Diff to previous 1.141.2.1 (colored) to branchpoint 1.141 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.150 / (download) - annotate - [select for diffs], Thu Jul 1 02:38:30 2010 UTC (13 years, 9 months ago) by rmind
Branch: MAIN
Changes since 1.149: +19 -12 lines
Diff to previous 1.149 (colored) to selected 1.40.2.15 (colored)

Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.

Revision 1.149 / (download) - annotate - [select for diffs], Sun Jun 13 04:13:31 2010 UTC (13 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.148: +3 -2 lines
Diff to previous 1.148 (colored) to selected 1.40.2.15 (colored)

increment p_nrlwps in lwp_create rather than letting callers do so
as it's always decremented by lwp_exit.  this fixes error recovery of
eg. aio_procinit.

Revision 1.148 / (download) - annotate - [select for diffs], Fri Jun 11 07:32:32 2010 UTC (13 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.147: +3 -3 lines
Diff to previous 1.147 (colored) to selected 1.40.2.15 (colored)

Fix DIAGNOSTIC.  Moral of the story: don't comment xen kernels out of the
build even if you'd like to go to sleep earlier.

Revision 1.147 / (download) - annotate - [select for diffs], Thu Jun 10 20:54:53 2010 UTC (13 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.146: +45 -2 lines
Diff to previous 1.146 (colored) to selected 1.40.2.15 (colored)

lwp0 seems like an lwp instead of a process, so move bits related
to it from kern_proc.c to kern_lwp.c.  This makes kern_proc
"scheduling-clean" and more easily usable in environments with a
non-integrated scheduler (like, to take a random example, rump).

Revision 1.141.2.1 / (download) - annotate - [select for diffs], Sun May 30 05:17:56 2010 UTC (13 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.141: +60 -100 lines
Diff to previous 1.141 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.137.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:44:09 2010 UTC (13 years, 11 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.137: +84 -99 lines
Diff to previous 1.137 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.146 / (download) - annotate - [select for diffs], Fri Apr 23 19:18:09 2010 UTC (13 years, 11 months ago) by rmind
Branch: MAIN
CVS Tags: uebayasi-xip-base1
Changes since 1.145: +4 -9 lines
Diff to previous 1.145 (colored) to selected 1.40.2.15 (colored)

Remove lwp_uc_pool, replace it with kmem(9), plus add some consistency.
As discussed, a while ago, with ad@.

Revision 1.145 / (download) - annotate - [select for diffs], Mon Apr 12 23:20:18 2010 UTC (13 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.144: +3 -3 lines
Diff to previous 1.144 (colored) to selected 1.40.2.15 (colored)

tyop

Revision 1.144 / (download) - annotate - [select for diffs], Mon Apr 12 22:15:31 2010 UTC (13 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.143: +4 -91 lines
Diff to previous 1.143 (colored) to selected 1.40.2.15 (colored)

Separate lwp specificdata data structure management from lwp cpu/vm
management.

No functional change.

(specificdata routines went from kern_lwp.c to subr_lwp_specificdata.c)

Revision 1.143 / (download) - annotate - [select for diffs], Fri Apr 9 11:47:17 2010 UTC (13 years, 11 months ago) by njoly
Branch: MAIN
Changes since 1.142: +3 -3 lines
Diff to previous 1.142 (colored) to selected 1.40.2.15 (colored)

Make lwp_ctl_alloc() return 0 instead of EINVAL, when lwpctl user
address already exists. This allow calling _lwp_ctl(2) more than once
on the same LWP.

Revision 1.142 / (download) - annotate - [select for diffs], Tue Apr 6 13:50:22 2010 UTC (13 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.141: +55 -3 lines
Diff to previous 1.141 (colored) to selected 1.40.2.15 (colored)

PR/43128: Paul Koning: Threads support in ptrace() is insufficient for gdb to
debug threaded live apps: Add an optional lwpid in PT_STEP and PT_CONTINUE to
indicate which lwp to operate on, and implement the glue required to make it
work.

Revision 1.106.2.6 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:16 2010 UTC (14 years ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.106.2.5: +39 -32 lines
Diff to previous 1.106.2.5 (colored) to branchpoint 1.106 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.141 / (download) - annotate - [select for diffs], Mon Mar 1 21:10:17 2010 UTC (14 years, 1 month ago) by darran
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Changes since 1.140: +23 -2 lines
Diff to previous 1.140 (colored) to selected 1.40.2.15 (colored)

DTrace: Add an SDT (Statically Defined Tracing) provider framework, and
implement most of the proc provider.  Adds proc:::create, exec,
exec_success, exec_faillure, signal_send, signal_discard, signal_handle,
lwp_create, lwp_start, lwp_exit.

Revision 1.140 / (download) - annotate - [select for diffs], Tue Feb 23 22:19:27 2010 UTC (14 years, 1 month ago) by darran
Branch: MAIN
Changes since 1.139: +2 -9 lines
Diff to previous 1.139 (colored) to selected 1.40.2.15 (colored)

DTrace: Get rid of the KDTRACE_HOOKS ifdefs in the kernel.  Replace the
functions with inline function that are empty when KDTRACE_HOOKS is not
defined.

Revision 1.139 / (download) - annotate - [select for diffs], Sun Feb 21 07:01:57 2010 UTC (14 years, 1 month ago) by darran
Branch: MAIN
Changes since 1.138: +3 -2 lines
Diff to previous 1.138 (colored) to selected 1.40.2.15 (colored)

Added a defflag option for KDTRACE_HOOKS and included opt_dtrace.h in the
relevant files. (Per Quentin Garnier - thanks!).

Revision 1.138 / (download) - annotate - [select for diffs], Sun Feb 21 02:11:40 2010 UTC (14 years, 1 month ago) by darran
Branch: MAIN
Changes since 1.137: +12 -2 lines
Diff to previous 1.137 (colored) to selected 1.40.2.15 (colored)

Add the DTrace hooks to the kernel (KDTRACE_HOOKS config option).
DTrace adds a pointer to the lwp and proc structures which it uses to
manage its state.  These are opaque from the kernel perspective to keep
the kernel free of CDDL code. The state arenas are kmem_alloced and freed
as proccesses and threads are created and destoyed.

Also add a check for trap06 (privileged/illegal instruction) so that
DTrace can check for D scripts that may have triggered the trap so it
can clean up after them and resume normal operation.

Ok with core@.

Revision 1.137 / (download) - annotate - [select for diffs], Thu Dec 17 01:25:10 2009 UTC (14 years, 3 months ago) by rmind
Branch: MAIN
CVS Tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Changes since 1.136: +3 -4 lines
Diff to previous 1.136 (colored) to selected 1.40.2.15 (colored)

Replace few USER_TO_UAREA/UAREA_TO_USER uses, reduce sys/user.h inclusions.

Revision 1.136 / (download) - annotate - [select for diffs], Tue Oct 27 02:58:28 2009 UTC (14 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase
Changes since 1.135: +3 -3 lines
Diff to previous 1.135 (colored) to selected 1.40.2.15 (colored)

- Amend fd_hold() to take an argument and add assert (reflects two cases,
  fork1() and the rest, e.g. kthread_create(), when creating from lwp0).

- lwp_create(): do not touch filedesc internals, use fd_hold().

Revision 1.135 / (download) - annotate - [select for diffs], Thu Oct 22 22:28:57 2009 UTC (14 years, 5 months ago) by rmind
Branch: MAIN
Changes since 1.134: +3 -6 lines
Diff to previous 1.134 (colored) to selected 1.40.2.15 (colored)

Avoid #ifndef __NO_CPU_LWP_FREE, only ia64 is missing cpu_lwp_free
routines and it can/should provide stubs.

Revision 1.134 / (download) - annotate - [select for diffs], Wed Oct 21 21:12:06 2009 UTC (14 years, 5 months ago) by rmind
Branch: MAIN
Changes since 1.133: +11 -25 lines
Diff to previous 1.133 (colored) to selected 1.40.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.106.2.5 / (download) - annotate - [select for diffs], Wed Sep 16 13:38:00 2009 UTC (14 years, 6 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.106.2.4: +5 -4 lines
Diff to previous 1.106.2.4 (colored) to branchpoint 1.106 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.133 / (download) - annotate - [select for diffs], Sun Sep 13 18:45:11 2009 UTC (14 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8
Changes since 1.132: +5 -4 lines
Diff to previous 1.132 (colored) to selected 1.40.2.15 (colored)

Wipe out the last vestiges of POOL_INIT with one swift stroke.  In
most cases, use a proper constructor.  For proplib, give a local
equivalent of POOL_INIT for the kernel object implementation.  This
way the code structure can be preserved, and a local link set is
not hazardous anyway (unless proplib is split to several modules,
but that'll be the day).

tested by booting a kernel in qemu and compile-testing i386/ALL

Revision 1.127.2.2 / (download) - annotate - [select for diffs], Thu Jul 23 23:32:34 2009 UTC (14 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.127.2.1: +31 -3 lines
Diff to previous 1.127.2.1 (colored) to branchpoint 1.127 (colored) next main 1.128 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.106.2.4 / (download) - annotate - [select for diffs], Sat Jul 18 14:53:23 2009 UTC (14 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.106.2.3: +3 -3 lines
Diff to previous 1.106.2.3 (colored) to branchpoint 1.106 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.132 / (download) - annotate - [select for diffs], Fri Jul 10 23:07:54 2009 UTC (14 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base7, yamt-nfs-mp-base6, jymxensuspend-base
Changes since 1.131: +3 -3 lines
Diff to previous 1.131 (colored) to selected 1.40.2.15 (colored)

In lwp_create(), take a reference to l2's filedesc_t instead of
taking a reference to curlwp's by calling fd_hold().  If lwp_create()
is called from fork1(), then l2 != curlwp, but l2's and not curlwp's
filedesc_t whose reference we should take.

This change stops the problem I describe in
<http://mail-index.netbsd.org/tech-kern/2009/07/09/msg005422.html>,
where /dev/rsd0a is never properly closed after fsck / runs on it.
This change seems to quiet my USB backup drive, sd0 at scsibus0 at
umass0, which had stopped spinning down when it was not in use:
The unit probably stayed open after mount(8) tried (and failed:
errant fstab entry) to mount it.

I am confident that this change is an improvement, but I doubt that
it is the last word on the matter.  I hate to get under the filedesc_t
abstraction by fiddling with fd_refcnt, and there may be something
I have missed, so somebody with greater understanding of the file
descriptors code should have a look.

Revision 1.106.2.3 / (download) - annotate - [select for diffs], Sat Jun 20 07:20:31 2009 UTC (14 years, 9 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.106.2.2: +31 -3 lines
Diff to previous 1.106.2.2 (colored) to branchpoint 1.106 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.131 / (download) - annotate - [select for diffs], Sat May 23 18:28:06 2009 UTC (14 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base5
Changes since 1.130: +19 -3 lines
Diff to previous 1.130 (colored) to selected 1.40.2.15 (colored)

Make descriptor access and file allocation cheaper in many cases,
mostly by avoiding a bunch of atomic operations.

Revision 1.130 / (download) - annotate - [select for diffs], Sat May 23 18:21:20 2009 UTC (14 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.129: +14 -2 lines
Diff to previous 1.129 (colored) to selected 1.40.2.15 (colored)

- Add lwp_pctr(), get an LWP's preemption/ctxsw counter.
- Fix a preemption bug in CURCPU_IDLE_P() that can lead to a bogus
  assertion failure on DEBUG kernels.
- Fix MP/preemption races with timecounter detachment.

Revision 1.127.2.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.127: +36 -29 lines
Diff to previous 1.127 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

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

Revision 1.106.2.2 / (download) - annotate - [select for diffs], Mon May 4 08:13:46 2009 UTC (14 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.106.2.1: +184 -189 lines
Diff to previous 1.106.2.1 (colored) to branchpoint 1.106 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.125.2.3 / (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.125.2.2: +36 -29 lines
Diff to previous 1.125.2.2 (colored) to branchpoint 1.125 (colored) next main 1.126 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.129 / (download) - annotate - [select for diffs], Sat Apr 4 22:34:03 2009 UTC (14 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jym-xensuspend-base
Changes since 1.128: +18 -14 lines
Diff to previous 1.128 (colored) to selected 1.40.2.15 (colored)

Update the big comment block.

Revision 1.126.2.2 / (download) - annotate - [select for diffs], Sun Mar 8 03:15:36 2009 UTC (15 years ago) by snj
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, 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-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, 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-nb4-mips64-k7-u2a-k9b
Branch point for: matt-nb5-mips64
Changes since 1.126.2.1: +20 -17 lines
Diff to previous 1.126.2.1 (colored) to branchpoint 1.126 (colored) next main 1.127 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by rmind in ticket #546):
	sys/kern/kern_lwp.c: revision 1.128
	sys/kern/sys_pset.c: revision 1.12
	sys/kern/sys_sched.c: revision 1.33
lwp_create: fix the locking bugs on affinity ingerition path (mea culpa).
pset_assign: traverse the list of LWPs safely.
sched_setaffinity: free cpuset (unused path) outside the lock.
Reviewed (with feedback) by <ad>.

Revision 1.128 / (download) - annotate - [select for diffs], Tue Mar 3 21:55:06 2009 UTC (15 years ago) by rmind
Branch: MAIN
Changes since 1.127: +20 -17 lines
Diff to previous 1.127 (colored) to selected 1.40.2.15 (colored)

lwp_create: fix the locking bugs on affinity ingerition path (mea culpa).
pset_assign: traverse the list of LWPs safely.
sched_setaffinity: free cpuset (unused path) outside the lock.

Reviewed (with feedback) by <ad>.

Revision 1.125.2.2 / (download) - annotate - [select for diffs], Tue Mar 3 18:32:56 2009 UTC (15 years ago) by skrll
Branch: nick-hppapmap
Changes since 1.125.2.1: +44 -3 lines
Diff to previous 1.125.2.1 (colored) to branchpoint 1.125 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.126.2.1 / (download) - annotate - [select for diffs], Fri Feb 6 01:54:09 2009 UTC (15 years, 1 month ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-0-RC2
Changes since 1.126: +44 -3 lines
Diff to previous 1.126 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by ad in ticket #414):
	sys/kern/kern_lwp.c: revision 1.127
	sys/kern/sys_process.c: revision 1.146
	sys/sys/lwp.h: revision 1.117
PR kern/36183 problem with ptrace and multithreaded processes
Fix the crashy test case that Thor provided.

Revision 1.127 / (download) - annotate - [select for diffs], Wed Feb 4 21:17:39 2009 UTC (15 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Branch point for: jym-xensuspend
Changes since 1.126: +44 -3 lines
Diff to previous 1.126 (colored) to selected 1.40.2.15 (colored)

PR kern/36183 problem with ptrace and multithreaded processes

Fix the crashy test case that Thor provided.

Revision 1.125.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:19:38 2009 UTC (15 years, 2 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.125: +6 -6 lines
Diff to previous 1.125 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.93.6.6 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:18 2009 UTC (15 years, 2 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.93.6.5: +28 -2 lines
Diff to previous 1.93.6.5 (colored) to branchpoint 1.93 (colored) next main 1.94 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.121.2.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:15:08 2008 UTC (15 years, 3 months ago) by haad
Branch: haad-dm
Changes since 1.121.2.1: +16 -3 lines
Diff to previous 1.121.2.1 (colored) next main 1.122 (colored) to selected 1.40.2.15 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.126 / (download) - annotate - [select for diffs], Tue Oct 28 22:11:36 2008 UTC (15 years, 5 months ago) by wrstuden
Branch: MAIN
CVS Tags: netbsd-5-base, netbsd-5-0-RC1, mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: netbsd-5
Changes since 1.125: +6 -6 lines
Diff to previous 1.125 (colored) to selected 1.40.2.15 (colored)

Tweak change to move SA support from userret() to lwp_userret().

1) Since we want to check for upcalls only once, take LW_SA_UPCALL
out of the while(l->l_flags & LW_USERRET) loop.

2) since the goal is to keep SA code out of userret() (and especially
all the emulations that include userret() but will never do SA),
ALWAYS set LW_SA_UPCALL when we set SAVP_FLAG_NOUPCALLS. Drop the
test for it in lwp_userret() since it will never be set bare.

3) Adapt sa_upcall_userret() to clear LW_SA_UPCALL if it's no longer
needed. If we have gained upcalls since sa_yield(), we will deliver
them next time around.

Tested by skrll at.

Revision 1.125 / (download) - annotate - [select for diffs], Tue Oct 21 11:51:23 2008 UTC (15 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: matt-mips64-base2
Branch point for: nick-hppapmap
Changes since 1.124: +15 -2 lines
Diff to previous 1.124 (colored) to selected 1.40.2.15 (colored)

Undo revivesa damage to userret().

Revision 1.121.2.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:17:27 2008 UTC (15 years, 5 months ago) by haad
Branch: haad-dm
Changes since 1.121: +34 -11 lines
Diff to previous 1.121 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.124 / (download) - annotate - [select for diffs], Wed Oct 15 06:51:20 2008 UTC (15 years, 5 months ago) by wrstuden
Branch: MAIN
CVS Tags: haad-dm-base1
Changes since 1.123: +16 -2 lines
Diff to previous 1.123 (colored) to selected 1.40.2.15 (colored)

Merge wrstuden-revivesa into HEAD.

Revision 1.110.2.7 / (download) - annotate - [select for diffs], Fri Oct 10 22:34:14 2008 UTC (15 years, 5 months ago) by skrll
Branch: wrstuden-revivesa
Changes since 1.110.2.6: +2 -3 lines
Diff to previous 1.110.2.6 (colored) to branchpoint 1.110 (colored) next main 1.111 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.123 / (download) - annotate - [select for diffs], Tue Oct 7 09:48:27 2008 UTC (15 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4
Changes since 1.122: +2 -3 lines
Diff to previous 1.122 (colored) to selected 1.40.2.15 (colored)

- Replace lwp_t::l_sched_info with union: pointer and timeslice.
- Change minimal time-quantum to ~20 ms.
- Thus remove unneeded pool in M2, and unused sched_lwp_exit().
- Do not increase l_slptime twice for SCHED_4BSD (regression fix).

Revision 1.93.6.5 / (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.93.6.4: +27 -120 lines
Diff to previous 1.93.6.4 (colored) to branchpoint 1.93 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.110.2.6 / (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.110.2.5: +29 -122 lines
Diff to previous 1.110.2.5 (colored) to branchpoint 1.110 (colored) to selected 1.40.2.15 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.110.2.5 / (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.110.2.4: +5 -2 lines
Diff to previous 1.110.2.4 (colored) to branchpoint 1.110 (colored) to selected 1.40.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.116.2.3 / (download) - annotate - [select for diffs], Fri Jul 18 16:37:49 2008 UTC (15 years, 8 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.116.2.2: +20 -10 lines
Diff to previous 1.116.2.2 (colored) to branchpoint 1.116 (colored) next main 1.117 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.122 / (download) - annotate - [select for diffs], Mon Jul 14 01:19:37 2008 UTC (15 years, 8 months ago) by rmind
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base
Changes since 1.121: +20 -10 lines
Diff to previous 1.121 (colored) to selected 1.40.2.15 (colored)

- Disallow setting of affinity for zombie LWPs.
- Fix the possible NULL dereference when LWP exiting.
- Fix the inhertance of affinity.

Revision 1.116.2.2 / (download) - annotate - [select for diffs], Thu Jul 3 18:38:11 2008 UTC (15 years, 8 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.116.2.1: +11 -114 lines
Diff to previous 1.116.2.1 (colored) to branchpoint 1.116 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.121 / (download) - annotate - [select for diffs], Wed Jul 2 19:53:12 2008 UTC (15 years, 8 months ago) by rmind
Branch: MAIN
Branch point for: haad-dm
Changes since 1.120: +11 -5 lines
Diff to previous 1.120 (colored) to selected 1.40.2.15 (colored)

lwp_migrate: if LWP is still on the CPU (LP_RUNNING), it must be handled
like LSONPROC.  Should fix PR/38588.  OK by <ad>.

Revision 1.120 / (download) - annotate - [select for diffs], Wed Jul 2 19:49:58 2008 UTC (15 years, 8 months ago) by rmind
Branch: MAIN
Changes since 1.119: +2 -111 lines
Diff to previous 1.119 (colored) to selected 1.40.2.15 (colored)

Remove proc_representative_lwp(), use a simple LIST_FIRST() instead.
OK by <ad>.

Revision 1.93.6.4 / (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.93.6.3: +12 -2 lines
Diff to previous 1.93.6.3 (colored) to branchpoint 1.93 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.110.2.4 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:50 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.110.2.3: +71 -57 lines
Diff to previous 1.110.2.3 (colored) to branchpoint 1.110 (colored) to selected 1.40.2.15 (colored)

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

Revision 1.116.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.116: +14 -4 lines
Diff to previous 1.116 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.101.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.101.2.2: +14 -4 lines
Diff to previous 1.101.2.2 (colored) to branchpoint 1.101 (colored) next main 1.102 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.119 / (download) - annotate - [select for diffs], Mon Jun 16 09:45:20 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Changes since 1.118: +5 -3 lines
Diff to previous 1.118 (colored) to selected 1.40.2.15 (colored)

lwp_lock_retry: return a pointer to the lock acquired. No functional change.

Revision 1.118 / (download) - annotate - [select for diffs], Mon Jun 16 01:41:20 2008 UTC (15 years, 9 months ago) by rmind
Branch: MAIN
Changes since 1.117: +4 -4 lines
Diff to previous 1.117 (colored) to selected 1.40.2.15 (colored)

- Add general cpuset macros.
- Use kcpuset name for kernel-only functions.
- Use cpuid_t to specify CPU ID.
- Unify all cpuset users.

API is expected to be stable now.

Revision 1.117 / (download) - annotate - [select for diffs], Sun Jun 15 20:32:57 2008 UTC (15 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.116: +11 -3 lines
Diff to previous 1.116 (colored) to selected 1.40.2.15 (colored)

Don't expose struct cpuset, share the l_affinity flag and only allocate it
if we need to. This is not a compatible change, but the syscalls are new
enough and they don't need to be versioned. Approved by rmind.

Revision 1.93.6.3 / (download) - annotate - [select for diffs], Thu Jun 5 19:14:36 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.93.6.2: +7 -1 lines
Diff to previous 1.93.6.2 (colored) to branchpoint 1.93 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Also fix build.

Revision 1.101.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.101.2.1: +59 -55 lines
Diff to previous 1.101.2.1 (colored) to branchpoint 1.101 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.116 / (download) - annotate - [select for diffs], Mon Jun 2 13:58:07 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base3
Branch point for: simonb-wapbl
Changes since 1.115: +9 -3 lines
Diff to previous 1.115 (colored) to selected 1.40.2.15 (colored)

If vfork(), we want the LWP to run fast and on the same CPU
as its parent, so that it can reuse the VM context and cache
footprint on the local CPU.

Revision 1.93.6.2 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:08 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.93.6.1: +176 -178 lines
Diff to previous 1.93.6.1 (colored) to branchpoint 1.93 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.115 / (download) - annotate - [select for diffs], Sat May 31 21:26:01 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.114: +6 -6 lines
Diff to previous 1.114 (colored) to selected 1.40.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.114 / (download) - annotate - [select for diffs], Thu May 29 22:33:27 2008 UTC (15 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.113: +46 -17 lines
Diff to previous 1.113 (colored) to selected 1.40.2.15 (colored)

Simplifcation for running LWP migration.  Removes double-locking in
mi_switch(), migration for LSONPROC is now performed via idle loop.
Handles/fixes on-CPU case in lwp_migrate(), misc.

Closes PR/38169, idea of migration via idle loop by Andrew Doran.

Revision 1.113 / (download) - annotate - [select for diffs], Tue May 27 17:51:17 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.112: +2 -28 lines
Diff to previous 1.112 (colored) to selected 1.40.2.15 (colored)

Move lwp_exit_switchaway() into kern_synch.c. Instead of always switching
to the idle loop, pick a new LWP from the run queue.

Revision 1.110.2.3 / (download) - annotate - [select for diffs], Tue May 27 03:16:30 2008 UTC (15 years, 10 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.110.2.2: +11 -2 lines
Diff to previous 1.110.2.2 (colored) to branchpoint 1.110 (colored) to selected 1.40.2.15 (colored)

First cut at porting SA timer code to -current. Slightly modified
so that we now use the timer_intr soft interrupt to do what we used
to do in itimerfire(). Also, use sa_mutex and p_lock instead of
the kernel lock.

Open question about what locks we can lock while holding
the timer lock.

Revision 1.112 / (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.111: +4 -4 lines
Diff to previous 1.111 (colored) to selected 1.40.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.111 / (download) - annotate - [select for diffs], Mon May 19 17:06:02 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: hpcarm-cleanup-nbase
Changes since 1.110: +3 -8 lines
Diff to previous 1.110 (colored) to selected 1.40.2.15 (colored)

Reduce ifdefs due to MULTIPROCESSOR slightly.

Revision 1.101.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.101: +74 -74 lines
Diff to previous 1.101 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.106.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.106: +19 -16 lines
Diff to previous 1.106 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.110.2.2 / (download) - annotate - [select for diffs], Wed May 14 19:54:12 2008 UTC (15 years, 10 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.110.2.1: +3 -7 lines
Diff to previous 1.110.2.1 (colored) to branchpoint 1.110 (colored) to selected 1.40.2.15 (colored)

Per discussion with ad at n dot o, revert signal mask handling
changes.

The l_sigstk changes are most likely totally un-needed as SA will
never use a signal stack - we send an upcall (or will as other
diffs are brought in).

The l_sigmask changes were too controvertial. In all honesty, I
think it's probably best to revert them. The main reason they were
there is the fact that in an SA process, we don't mask signals per
kernel thread, we mask them per user thread. In the kernel, we want
them all to get turned into upcalls. Thus the normal state of
l_sigmask in an SA process is for it to always be empty.

While we are in the process of delivering a signal, we want to
temporarily mask a signal (so we don't recursively exhaust our
upcall stacks). However signal delivery is rare (important, but
rare), and delivering back-to-back signals is even rarer. So rather
than cause every user of a signal mask to be prepared for this very
rare case, we will just add a second check later in the signal
delivery code. Said change is not in this diff.

This also un-compensates all of our compatability code for dealing
with SA. SA is a NetBSD-specific thing, so there's no need for
Irix, Linux, Solaris, SVR4 and so on to cope with it.

As previously, everything other than kern_sa.c compiles in i386
GENERIC as of this checkin. I will switch to ALL soon for compile
testing.

Revision 1.110.2.1 / (download) - annotate - [select for diffs], Sat May 10 23:49:04 2008 UTC (15 years, 10 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.110: +9 -3 lines
Diff to previous 1.110 (colored) to selected 1.40.2.15 (colored)

Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.

Revision 1.110 / (download) - annotate - [select for diffs], Tue May 6 18:40:57 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2
Branch point for: wrstuden-revivesa
Changes since 1.109: +3 -2 lines
Diff to previous 1.109 (colored) to selected 1.40.2.15 (colored)

LOCKDEBUG: try to speed it up a bit by not using so much global state.

This will break the build briefly but will be followed by another commit
to fix that..

Revision 1.109 / (download) - annotate - [select for diffs], Thu May 1 21:25:23 2008 UTC (15 years, 11 months ago) by rmind
Branch: MAIN
Changes since 1.108: +3 -3 lines
Diff to previous 1.108 (colored) to selected 1.40.2.15 (colored)

lwp_suspend: check for LW_* flags in l_flag, not l_stat.

Revision 1.108 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:03 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
Changes since 1.107: +2 -9 lines
Diff to previous 1.107 (colored) to selected 1.40.2.15 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.107 / (download) - annotate - [select for diffs], Mon Apr 28 15:36:01 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.106: +17 -8 lines
Diff to previous 1.106 (colored) to selected 1.40.2.15 (colored)

Add MI code to support in-kernel preemption. Preemption is deferred by
one of the following:

- Holding kernel_lock (indicating that the code is not MT safe).
- Bracketing critical sections with kpreempt_disable/kpreempt_enable.
- Holding the interrupt priority level above IPL_NONE.

Statistics on kernel preemption are reported via event counters, and
where preemption is deferred for some reason, it's also reported via
lockstat. The LWP priority at which preemption is triggered is tuneable
via sysctl.

Revision 1.106 / (download) - annotate - [select for diffs], Sun Apr 27 11:39:20 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.105: +3 -4 lines
Diff to previous 1.105 (colored) to selected 1.40.2.15 (colored)

Disable preemption during the final stages of LWP exit.

Revision 1.105 / (download) - annotate - [select for diffs], Fri Apr 25 14:34:41 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored) to selected 1.40.2.15 (colored)

lwp_startup: spl0 after pmap_activate, otherwise we could be preempted
without a pmap active.

Revision 1.104 / (download) - annotate - [select for diffs], Thu Apr 24 21:47:11 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.103: +4 -2 lines
Diff to previous 1.103 (colored) to selected 1.40.2.15 (colored)

lwp_userret: don't drop p_lock while holding a scheduler lock.

Revision 1.103 / (download) - annotate - [select for diffs], Thu Apr 24 18:39:24 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.102: +51 -53 lines
Diff to previous 1.102 (colored) to selected 1.40.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.102 / (download) - annotate - [select for diffs], Thu Apr 24 15:35:29 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.101: +7 -9 lines
Diff to previous 1.101 (colored) to selected 1.40.2.15 (colored)

Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.

Revision 1.101 / (download) - annotate - [select for diffs], Tue Apr 15 18:54:30 2008 UTC (15 years, 11 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.100: +56 -56 lines
Diff to previous 1.100 (colored) to selected 1.40.2.15 (colored)

Adjust comments: spc_mutex is now always a per-CPU lock, L_INMEM -> LW_INMEM,
L_WSUSPEND -> LW_WSUSPEND, and remove white-spaces, while here.

Revision 1.93.6.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:43:01 2008 UTC (15 years, 11 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.93: +33 -10 lines
Diff to previous 1.93 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.100 / (download) - annotate - [select for diffs], Thu Mar 27 19:06:52 2008 UTC (16 years ago) by ad
Branch: MAIN
Changes since 1.99: +7 -2 lines
Diff to previous 1.99 (colored) to selected 1.40.2.15 (colored)

Make rusage collection per-LWP and collate in the appropriate places.
cloned threads need a little bit more work but the locking needs to
be fixed first.

Revision 1.29.6.12 / (download) - annotate - [select for diffs], Mon Mar 24 09:39:01 2008 UTC (16 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.11: +18 -5 lines
Diff to previous 1.29.6.11 (colored) to branchpoint 1.29 (colored) next main 1.30 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.93.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.93: +22 -7 lines
Diff to previous 1.93 (colored) next main 1.94 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.99 / (download) - annotate - [select for diffs], Sun Mar 23 16:39:34 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, ad-socklock-base1
Changes since 1.98: +3 -2 lines
Diff to previous 1.98 (colored) to selected 1.40.2.15 (colored)

lwp_ctl_alloc: initialize lcp_kaddr to vm_map_min(kernel_map), in order to
prevent uvm_map() from spuriously failing.

Revision 1.69.4.5 / (download) - annotate - [select for diffs], Sun Mar 23 02:04:59 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.69.4.4: +109 -12 lines
Diff to previous 1.69.4.4 (colored) to branchpoint 1.69 (colored) next main 1.70 (colored) to selected 1.40.2.15 (colored)

sync with HEAD

Revision 1.98 / (download) - annotate - [select for diffs], Sat Mar 22 17:53:34 2008 UTC (16 years ago) by ad
Branch: MAIN
Changes since 1.97: +5 -2 lines
Diff to previous 1.97 (colored) to selected 1.40.2.15 (colored)

LWP_CACHE_CREDS: instead of testing (l_cred != p_cred), use a per-LWP
flag bit to indicate a pending cred update. Avoids touching one item of
shared state in the syscall path.

Revision 1.97 / (download) - annotate - [select for diffs], Fri Mar 21 21:55:00 2008 UTC (16 years ago) by ad
Branch: MAIN
Changes since 1.96: +4 -5 lines
Diff to previous 1.96 (colored) to selected 1.40.2.15 (colored)

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Mar 17 16:54:51 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base
Changes since 1.95: +12 -2 lines
Diff to previous 1.95 (colored) to selected 1.40.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.29.6.11 / (download) - annotate - [select for diffs], Mon Mar 17 09:15:33 2008 UTC (16 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.10: +4 -3 lines
Diff to previous 1.29.6.10 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.95 / (download) - annotate - [select for diffs], Fri Mar 7 18:06:04 2008 UTC (16 years ago) by ad
Branch: MAIN
Changes since 1.94: +4 -3 lines
Diff to previous 1.94 (colored) to selected 1.40.2.15 (colored)

lwp_ctl_exit: fix a use-after-free that caused the following:

_lwp_ctl()	<- works
execve()	<- tears down lwpctl state
_lwp_ctl()	<- fails erroneously

Revision 1.29.6.10 / (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.29.6.9: +10 -6 lines
Diff to previous 1.29.6.9 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.94 / (download) - annotate - [select for diffs], Fri Feb 22 22:32:49 2008 UTC (16 years, 1 month ago) by rmind
Branch: MAIN
CVS Tags: hpcarm-cleanup-base
Changes since 1.93: +10 -6 lines
Diff to previous 1.93 (colored) to selected 1.40.2.15 (colored)

sys__sched_getparam and sys__sched_getaffinity: Do not assume that LWP
with LID=1 exists, use LIST_FIRST(&p->p_lwps) instead.
Fixes PR/37987 by <yamt>.

While here, adjust license.

Revision 1.74.4.4 / (download) - annotate - [select for diffs], Mon Feb 18 21:06:45 2008 UTC (16 years, 1 month ago) by mjf
Branch: mjf-devfs
Changes since 1.74.4.3: +110 -28 lines
Diff to previous 1.74.4.3 (colored) to branchpoint 1.74 (colored) next main 1.75 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.29.6.9 / (download) - annotate - [select for diffs], Mon Feb 4 09:24:13 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.8: +7 -3 lines
Diff to previous 1.29.6.8 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.93 / (download) - annotate - [select for diffs], Mon Jan 28 12:23:42 2008 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.92: +4 -3 lines
Diff to previous 1.92 (colored) to selected 1.40.2.15 (colored)

wrap a long line.

Revision 1.92 / (download) - annotate - [select for diffs], Mon Jan 28 10:24:45 2008 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.91: +5 -2 lines
Diff to previous 1.91 (colored) to selected 1.40.2.15 (colored)

lwp_free: add assertions.

Revision 1.29.6.8 / (download) - annotate - [select for diffs], Mon Jan 21 09:46:06 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.7: +127 -28 lines
Diff to previous 1.29.6.7 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.83.6.4 / (download) - annotate - [select for diffs], Sat Jan 19 12:15:21 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.83.6.3: +86 -8 lines
Diff to previous 1.83.6.3 (colored) to branchpoint 1.83 (colored) next main 1.84 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.91 / (download) - annotate - [select for diffs], Tue Jan 15 03:37:11 2008 UTC (16 years, 2 months ago) by rmind
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.90: +84 -10 lines
Diff to previous 1.90 (colored) to selected 1.40.2.15 (colored)

Implementation of processor-sets, affinity and POSIX real-time extensions.
Add schedctl(8) - a program to control scheduling of processes and threads.

Notes:
- This is supported only by SCHED_M2;
- Migration of LWP mechanism will be revisited;

Proposed on: <tech-kern>. Reviewed by: <ad>.

Revision 1.90 / (download) - annotate - [select for diffs], Sat Jan 12 18:06:40 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.89: +6 -2 lines
Diff to previous 1.89 (colored) to selected 1.40.2.15 (colored)

- lwp_exit: if the LWP has a name, rename it to "(zombie)".
- lwp_free: don't leak l_name.

Revision 1.69.4.4 / (download) - annotate - [select for diffs], Wed Jan 9 01:56:04 2008 UTC (16 years, 2 months ago) by matt
Branch: matt-armv6
Changes since 1.69.4.3: +251 -44 lines
Diff to previous 1.69.4.3 (colored) to branchpoint 1.69 (colored) to selected 1.40.2.15 (colored)

sync with HEAD

Revision 1.83.6.3 / (download) - annotate - [select for diffs], Tue Jan 8 22:11:34 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.83.6.2: +9 -3 lines
Diff to previous 1.83.6.2 (colored) to branchpoint 1.83 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.89 / (download) - annotate - [select for diffs], Mon Jan 7 11:41:29 2008 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.88: +11 -5 lines
Diff to previous 1.88 (colored) to selected 1.40.2.15 (colored)

lwp_ctl_alloc: fix error handling.

Revision 1.83.6.2 / (download) - annotate - [select for diffs], Wed Jan 2 21:55:53 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.83.6.1: +9 -15 lines
Diff to previous 1.83.6.1 (colored) to branchpoint 1.83 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.88 / (download) - annotate - [select for diffs], Wed Jan 2 11:48:50 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.87: +5 -12 lines
Diff to previous 1.87 (colored) to selected 1.40.2.15 (colored)

Merge vmlocking2 to head.

Revision 1.74.4.3 / (download) - annotate - [select for diffs], Thu Dec 27 00:46:00 2007 UTC (16 years, 3 months ago) by mjf
Branch: mjf-devfs
Changes since 1.74.4.2: +24 -3 lines
Diff to previous 1.74.4.2 (colored) to branchpoint 1.74 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.83.2.4 / (download) - annotate - [select for diffs], Wed Dec 26 23:05:53 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.83.2.3: +3 -2 lines
Diff to previous 1.83.2.3 (colored) to branchpoint 1.83 (colored) next main 1.84 (colored) to selected 1.40.2.15 (colored)

- Push kernel_lock back into exit, wait and sysctl system calls, mainly
  for visibility.
- Serialize calls to brk() from within the same process.
- Mark more syscalls MPSAFE.

Revision 1.83.2.3 / (download) - annotate - [select for diffs], Wed Dec 26 21:39:40 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.83.2.2: +24 -3 lines
Diff to previous 1.83.2.2 (colored) to branchpoint 1.83 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.87 / (download) - annotate - [select for diffs], Wed Dec 26 16:01:36 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.86: +7 -6 lines
Diff to previous 1.86 (colored) to selected 1.40.2.15 (colored)

Merge more changes from vmlocking2, mainly:

- Locking improvements.
- Use pool_cache for more items.

Revision 1.86 / (download) - annotate - [select for diffs], Sat Dec 22 01:14:54 2007 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored) to selected 1.40.2.15 (colored)

use binuptime for l_stime/l_rtime.

Revision 1.83.2.2 / (download) - annotate - [select for diffs], Sat Dec 15 03:16:56 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.83.2.1: +7 -6 lines
Diff to previous 1.83.2.1 (colored) to branchpoint 1.83 (colored) to selected 1.40.2.15 (colored)

- Use pool_cache for a few more items and make those caches static.
- Mark another 10 syscalls MPSAFE including execve(). A small bit of
  work is required to fix a couple of issues (tty, kqueue).

Revision 1.83.6.1 / (download) - annotate - [select for diffs], Thu Dec 13 21:56:53 2007 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.83: +23 -2 lines
Diff to previous 1.83 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.85 / (download) - annotate - [select for diffs], Thu Dec 13 05:25:03 2007 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.84: +3 -2 lines
Diff to previous 1.84 (colored) to selected 1.40.2.15 (colored)

include <sys/user.h>.

Revision 1.83.4.1 / (download) - annotate - [select for diffs], Thu Dec 13 05:06:00 2007 UTC (16 years, 3 months ago) by yamt
Branch: yamt-kmem
Changes since 1.83: +22 -2 lines
Diff to previous 1.83 (colored) next main 1.84 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.84 / (download) - annotate - [select for diffs], Thu Dec 13 02:45:10 2007 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-kmem-base3
Changes since 1.83: +22 -2 lines
Diff to previous 1.83 (colored) to selected 1.40.2.15 (colored)

add ddb "whatis" command.  inspired from solaris ::whatis dcmd.

Revision 1.69.2.7 / (download) - annotate - [select for diffs], Sun Dec 9 19:38:17 2007 UTC (16 years, 3 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.69.2.6: +3 -4 lines
Diff to previous 1.69.2.6 (colored) to branchpoint 1.69 (colored) next main 1.70 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.74.4.2 / (download) - annotate - [select for diffs], Sat Dec 8 18:20:29 2007 UTC (16 years, 3 months ago) by mjf
Branch: mjf-devfs
Changes since 1.74.4.1: +19 -9 lines
Diff to previous 1.74.4.1 (colored) to branchpoint 1.74 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.29.6.7 / (download) - annotate - [select for diffs], Fri Dec 7 17:32:44 2007 UTC (16 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.6: +19 -9 lines
Diff to previous 1.29.6.6 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.83.2.1 / (download) - annotate - [select for diffs], Tue Dec 4 13:03:14 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.83: +4 -12 lines
Diff to previous 1.83 (colored) to selected 1.40.2.15 (colored)

Pull the vmlocking changes into a new branch.

Revision 1.83 / (download) - annotate - [select for diffs], Mon Dec 3 20:26:25 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base2, yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: yamt-kmem, vmlocking2, bouyer-xeni386
Changes since 1.82: +2 -4 lines
Diff to previous 1.82 (colored) to selected 1.40.2.15 (colored)

Soft interrupts can now take proclist_lock, so there is no need to
double-lock alllwp or allproc.

Revision 1.82 / (download) - annotate - [select for diffs], Mon Dec 3 17:14:59 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking-nbase
Changes since 1.81: +3 -2 lines
Diff to previous 1.81 (colored) to selected 1.40.2.15 (colored)

For the slow path soft interrupts, arrange to have the priority of a
borrowed user LWP raised into the 'kernel RT' range if the LWP sleeps
(which is unlikely).

Revision 1.69.2.6 / (download) - annotate - [select for diffs], Mon Dec 3 16:14:49 2007 UTC (16 years, 3 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.69.2.5: +18 -7 lines
Diff to previous 1.69.2.5 (colored) to branchpoint 1.69 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Dec 2 14:55:32 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.80: +18 -7 lines
Diff to previous 1.80 (colored) to selected 1.40.2.15 (colored)

- mi_switch: adjust so that we don't have to hold the old LWP locked across
  context switch, since cpu_switchto() can be slow under certain conditions.
  From rmind@ with adjustments by me.
- lwpctl: allow LWPs to reregister instead of returning EINVAL. Just return
  their existing lwpctl user address.

Revision 1.74.4.1 / (download) - annotate - [select for diffs], Mon Nov 19 00:48:39 2007 UTC (16 years, 4 months ago) by mjf
Branch: mjf-devfs
Changes since 1.74: +232 -36 lines
Diff to previous 1.74 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.29.6.6 / (download) - annotate - [select for diffs], Thu Nov 15 11:44:42 2007 UTC (16 years, 4 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.5: +232 -36 lines
Diff to previous 1.29.6.5 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.69.2.5 / (download) - annotate - [select for diffs], Wed Nov 14 19:04:41 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.69.2.4: +199 -23 lines
Diff to previous 1.69.2.4 (colored) to branchpoint 1.69 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.74.2.1 / (download) - annotate - [select for diffs], Tue Nov 13 16:02:05 2007 UTC (16 years, 4 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.74: +232 -36 lines
Diff to previous 1.74 (colored) next main 1.75 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.80 / (download) - annotate - [select for diffs], Tue Nov 13 11:38:35 2007 UTC (16 years, 4 months ago) by skrll
Branch: MAIN
CVS Tags: bouyer-xenamd64-base2, bouyer-xenamd64-base
Changes since 1.79: +3 -2 lines
Diff to previous 1.79 (colored) to selected 1.40.2.15 (colored)

Explicitly include <uvm/uvm_object.h>

Revision 1.79 / (download) - annotate - [select for diffs], Tue Nov 13 08:38:06 2007 UTC (16 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.78: +5 -3 lines
Diff to previous 1.78 (colored) to selected 1.40.2.15 (colored)

lwp_ctl_alloc: fix a mutex_enter/exit mismatch.

Revision 1.78 / (download) - annotate - [select for diffs], Mon Nov 12 23:11:59 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.77: +195 -22 lines
Diff to previous 1.77 (colored) to selected 1.40.2.15 (colored)

Add _lwp_ctl() system call: provides a bidirectional, per-LWP communication
area between processes and the kernel.

Revision 1.77 / (download) - annotate - [select for diffs], Sun Nov 11 23:22:23 2007 UTC (16 years, 4 months ago) by matt
Branch: MAIN
Changes since 1.76: +3 -3 lines
Diff to previous 1.76 (colored) to selected 1.40.2.15 (colored)

Change some initialization of static queues to compile time.
(xxx_INIT to xxx_HEAD_INITIALIZER).  Drop code which inits
non-auto (global or static) variables to 0 since that's
already implied by being non-auto.  Init some static/global
cpu_simple_locks at compile time.

Revision 1.69.2.4 / (download) - annotate - [select for diffs], Sun Nov 11 16:48:03 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.69.2.3: +6 -6 lines
Diff to previous 1.69.2.3 (colored) to branchpoint 1.69 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.69.4.3 / (download) - annotate - [select for diffs], Thu Nov 8 11:00:01 2007 UTC (16 years, 4 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.69.4.2: +6 -6 lines
Diff to previous 1.69.4.2 (colored) to branchpoint 1.69 (colored) to selected 1.40.2.15 (colored)

sync with -HEAD

Revision 1.76 / (download) - annotate - [select for diffs], Wed Nov 7 00:23:21 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.75: +6 -6 lines
Diff to previous 1.75 (colored) to selected 1.40.2.15 (colored)

Merge from vmlocking:

- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.

Revision 1.69.4.2 / (download) - annotate - [select for diffs], Tue Nov 6 23:31:40 2007 UTC (16 years, 4 months ago) by matt
Branch: matt-armv6
Changes since 1.69.4.1: +45 -17 lines
Diff to previous 1.69.4.1 (colored) to branchpoint 1.69 (colored) to selected 1.40.2.15 (colored)

sync with HEAD

Revision 1.69.2.3 / (download) - annotate - [select for diffs], Tue Nov 6 19:25:29 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.69.2.2: +31 -11 lines
Diff to previous 1.69.2.2 (colored) to branchpoint 1.69 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Nov 6 00:42:41 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: jmcneill-base
Changes since 1.74: +31 -11 lines
Diff to previous 1.74 (colored) to selected 1.40.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.61.2.27 / (download) - annotate - [select for diffs], Mon Nov 5 17:13:02 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.26: +2 -4 lines
Diff to previous 1.61.2.26 (colored) next main 1.62 (colored) to selected 1.40.2.15 (colored)

Don't acquire kernel_lock for uvm_lwp_fork().

Revision 1.61.2.26 / (download) - annotate - [select for diffs], Mon Nov 5 15:04:42 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.25: +4 -11 lines
Diff to previous 1.61.2.25 (colored) to selected 1.40.2.15 (colored)

- Locking tweaks for estcpu/nice. XXX The schedclock musn't run above
  IPL_SCHED.
- Hide most references to l_estcpu.
- l_policy was here first, but l_class is referenced in more places now.

Revision 1.61.2.25 / (download) - annotate - [select for diffs], Thu Nov 1 21:58:18 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.24: +32 -12 lines
Diff to previous 1.61.2.24 (colored) to selected 1.40.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.29.6.5 / (download) - annotate - [select for diffs], Sat Oct 27 11:35:24 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.4: +17 -9 lines
Diff to previous 1.29.6.4 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.69.2.2 / (download) - annotate - [select for diffs], Fri Oct 26 15:48:32 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.69.2.1: +14 -6 lines
Diff to previous 1.69.2.1 (colored) to branchpoint 1.69 (colored) to selected 1.40.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.61.2.24 / (download) - annotate - [select for diffs], Thu Oct 25 19:43:10 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.23: +4 -4 lines
Diff to previous 1.61.2.23 (colored) to selected 1.40.2.15 (colored)

- Simplify debugger/procfs reference counting of processes. Use a per-proc
  rwlock: rw_tryenter(RW_READER) to gain a reference, and rw_enter(RW_WRITER)
  by the process itself to drain out reference holders before major changes
  like exiting.
- Fix numerous bugs and locking issues in procfs.
- Mark procfs MPSAFE.

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

Sync with head.

Revision 1.61.2.22 / (download) - annotate - [select for diffs], Thu Oct 18 15:47:33 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.21: +9 -2 lines
Diff to previous 1.61.2.21 (colored) to selected 1.40.2.15 (colored)

Update for soft interrupt changes. See kern_softint.c 1.1.2.17 for details.

Revision 1.70.2.2 / (download) - annotate - [select for diffs], Sun Oct 14 11:48:40 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.70.2.1: +14 -6 lines
Diff to previous 1.70.2.1 (colored) to branchpoint 1.70 (colored) next main 1.71 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.74 / (download) - annotate - [select for diffs], Sat Oct 13 00:30:26 2007 UTC (16 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3
Branch point for: mjf-devfs, bouyer-xenamd64
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored) to selected 1.40.2.15 (colored)

- Fix a comment: LSIDL is covered by spc_mutex, not spc_lwplock.
- mi_switch: Add a comment that spc_lwplock might not necessary be held.

Revision 1.61.2.21 / (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.61.2.20: +8 -4 lines
Diff to previous 1.61.2.20 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.73 / (download) - annotate - [select for diffs], Tue Oct 9 19:00:13 2007 UTC (16 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: vmlocking-base
Changes since 1.72: +8 -4 lines
Diff to previous 1.72 (colored) to selected 1.40.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.61.2.20 / (download) - annotate - [select for diffs], Tue Oct 9 13:44:26 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.19: +5 -5 lines
Diff to previous 1.61.2.19 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.72 / (download) - annotate - [select for diffs], Mon Oct 8 18:11:11 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
Changes since 1.71: +6 -2 lines
Diff to previous 1.71 (colored) to selected 1.40.2.15 (colored)

Merge from vmlocking: fix LWP reference counting problems.

Revision 1.70.2.1 / (download) - annotate - [select for diffs], Sat Oct 6 15:28:42 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.70: +2 -3 lines
Diff to previous 1.70 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.69.2.1 / (download) - annotate - [select for diffs], Tue Oct 2 18:29:00 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.69: +5 -5 lines
Diff to previous 1.69 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.71 / (download) - annotate - [select for diffs], Tue Sep 25 21:38:56 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base2
Changes since 1.70: +2 -3 lines
Diff to previous 1.70 (colored) to selected 1.40.2.15 (colored)

curlwp appears to be set by all active copies of cpu_switchto - remove
the MI assignments and assert that it's set in mi_switch().

Revision 1.65.2.2 / (download) - annotate - [select for diffs], Mon Sep 10 10:55:58 2007 UTC (16 years, 6 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.65.2.1: +5 -4 lines
Diff to previous 1.65.2.1 (colored) to branchpoint 1.65 (colored) next main 1.66 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.70 / (download) - annotate - [select for diffs], Thu Sep 6 23:58:56 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap
Changes since 1.69: +5 -4 lines
Diff to previous 1.69 (colored) to selected 1.40.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.29.6.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:40:50 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.3: +289 -166 lines
Diff to previous 1.29.6.3 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.61.2.19 / (download) - annotate - [select for diffs], Sat Sep 1 12:56:48 2007 UTC (16 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.18: +4 -4 lines
Diff to previous 1.61.2.18 (colored) to selected 1.40.2.15 (colored)

Update for pool_cache API changes.

Revision 1.69.4.1 / (download) - annotate - [select for diffs], Tue Aug 28 18:43:44 2007 UTC (16 years, 7 months ago) by matt
Branch: matt-armv6
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored) to selected 1.40.2.15 (colored)

Pre-init the static structures (lwp0,proc0,session0,etc.) whenever possible.
Use curlwp_set()

Revision 1.61.2.18 / (download) - annotate - [select for diffs], Thu Aug 23 19:28:15 2007 UTC (16 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.17: +3 -2 lines
Diff to previous 1.61.2.17 (colored) to selected 1.40.2.15 (colored)

- Remove most calls to get kernel_lock during fault handling.
- By default start new LWPs without kernel_lock. Those returning to
  userspace don't need it.

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

Sync with HEAD.

Revision 1.61.2.16 / (download) - annotate - [select for diffs], Sat Aug 18 05:41:49 2007 UTC (16 years, 7 months ago) by yamt
Branch: vmlocking
Changes since 1.61.2.15: +4 -2 lines
Diff to previous 1.61.2.15 (colored) to selected 1.40.2.15 (colored)

lwp_delref: add assertions.

Revision 1.61.2.15 / (download) - annotate - [select for diffs], Sat Aug 18 05:40:53 2007 UTC (16 years, 7 months ago) by yamt
Branch: vmlocking
Changes since 1.61.2.14: +4 -2 lines
Diff to previous 1.61.2.14 (colored) to selected 1.40.2.15 (colored)

lwp_exit: fix the case that another LWP acquires l_refcnt while
we are dropping the mutex.  ok'ed by Andrew Doran.

Revision 1.65.2.1 / (download) - annotate - [select for diffs], Wed Aug 15 13:49:08 2007 UTC (16 years, 7 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.65: +41 -53 lines
Diff to previous 1.65 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.69.6.2 / (download) - annotate - [select for diffs], Thu Aug 2 01:48:45 2007 UTC (16 years, 8 months ago) by rmind
Branch: matt-mips64
Changes since 1.69.6.1: +1409 -0 lines
Diff to previous 1.69.6.1 (colored) to branchpoint 1.69 (colored) next main 1.70 (colored) to selected 1.40.2.15 (colored)

sys__lwp_suspend: implement waiting for target LWP status changes (or
process exiting). Removes XXXLWP.

Reviewed by <ad> some time ago..

Revision 1.69.6.1, Thu Aug 2 01:48:44 2007 UTC (16 years, 8 months ago) by rmind
Branch: matt-mips64
Changes since 1.69: +0 -1409 lines
FILE REMOVED

file kern_lwp.c was added on branch matt-mips64 on 2007-08-02 01:48:45 +0000

Revision 1.69 / (download) - annotate - [select for diffs], Thu Aug 2 01:48:44 2007 UTC (16 years, 8 months ago) by rmind
Branch: MAIN
CVS Tags: matt-mips64-base
Branch point for: matt-mips64, matt-armv6, jmcneill-pm
Changes since 1.68: +3 -12 lines
Diff to previous 1.68 (colored) to selected 1.40.2.15 (colored)

sys__lwp_suspend: implement waiting for target LWP status changes (or
process exiting). Removes XXXLWP.

Reviewed by <ad> some time ago..

Revision 1.68 / (download) - annotate - [select for diffs], Tue Jul 31 09:56:31 2007 UTC (16 years, 8 months ago) by tnn
Branch: MAIN
Changes since 1.67: +3 -3 lines
Diff to previous 1.67 (colored) to selected 1.40.2.15 (colored)

Fix previous; lwp status are states, not flags.

Revision 1.67 / (download) - annotate - [select for diffs], Tue Jul 31 00:52:04 2007 UTC (16 years, 8 months ago) by tnn
Branch: MAIN
Changes since 1.66: +3 -7 lines
Diff to previous 1.66 (colored) to selected 1.40.2.15 (colored)

proc_representative_lwp:
 - Correct expression for checking if the lwp is running.
 - Remove dead code. Ok'd by Andrew Doran.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Jul 28 00:12:26 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: hpcarm-cleanup
Changes since 1.65: +39 -38 lines
Diff to previous 1.65 (colored) to selected 1.40.2.15 (colored)

Update the blurb to match reality.

Revision 1.61.2.14 / (download) - annotate - [select for diffs], Sun Jul 15 15:52:54 2007 UTC (16 years, 8 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.13: +5 -4 lines
Diff to previous 1.61.2.13 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.62.2.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:09:50 2007 UTC (16 years, 8 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.62: +229 -119 lines
Diff to previous 1.62 (colored) next main 1.63 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.65 / (download) - annotate - [select for diffs], Mon Jul 9 21:10:52 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base
Branch point for: nick-csl-alignment
Changes since 1.64: +38 -21 lines
Diff to previous 1.64 (colored) to selected 1.40.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.61.2.13 / (download) - annotate - [select for diffs], Sun Jul 1 21:50:39 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.12: +4 -3 lines
Diff to previous 1.61.2.12 (colored) to selected 1.40.2.15 (colored)

Adapt to callout API change.

Revision 1.61.2.12 / (download) - annotate - [select for diffs], Sun Jun 17 21:31:22 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.11: +6 -6 lines
Diff to previous 1.61.2.11 (colored) to selected 1.40.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.61.2.11 / (download) - annotate - [select for diffs], Fri Jun 8 14:17:19 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.10: +66 -50 lines
Diff to previous 1.61.2.10 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.61.2.10 / (download) - annotate - [select for diffs], Sun May 27 00:12:09 2007 UTC (16 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.9: +20 -15 lines
Diff to previous 1.61.2.9 (colored) to selected 1.40.2.15 (colored)

Allow lwp_exit() to operate when (l != curlwp) if the LWP is in state IDL.

Revision 1.64 / (download) - annotate - [select for diffs], Thu May 17 14:51:39 2007 UTC (16 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.63: +69 -53 lines
Diff to previous 1.63 (colored) to selected 1.40.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.55.2.14 / (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.55.2.13: +13 -11 lines
Diff to previous 1.55.2.13 (colored) next main 1.56 (colored) to selected 1.40.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.61.2.9 / (download) - annotate - [select for diffs], Sat Apr 28 22:40:03 2007 UTC (16 years, 11 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.8: +2 -3 lines
Diff to previous 1.61.2.8 (colored) to selected 1.40.2.15 (colored)

select/poll:

- Don't try to awaken LWPs more than once. Prevents unnecessary locking.
- Tidy slightly.

Revision 1.55.2.13 / (download) - annotate - [select for diffs], Sat Apr 21 15:50:15 2007 UTC (16 years, 11 months ago) by ad
Branch: yamt-idlelwp
Changes since 1.55.2.12: +3 -2 lines
Diff to previous 1.55.2.12 (colored) to selected 1.40.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.55.2.12 / (download) - annotate - [select for diffs], Mon Apr 16 23:45:53 2007 UTC (16 years, 11 months ago) by ad
Branch: yamt-idlelwp
Changes since 1.55.2.11: +7 -7 lines
Diff to previous 1.55.2.11 (colored) to selected 1.40.2.15 (colored)

lwp_exit, lwp_free: also use the LW_RUNNING flag to synchronize collection
of the dead LWP. If an interrupt handler changes curlwp, it could be reaped
while still on the CPU.

Revision 1.55.2.11 / (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.55.2.10: +3 -26 lines
Diff to previous 1.55.2.10 (colored) to selected 1.40.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.61.2.8 / (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.61.2.7: +120 -43 lines
Diff to previous 1.61.2.7 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.61.2.7 / (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.61.2.6: +2 -4 lines
Diff to previous 1.61.2.6 (colored) to selected 1.40.2.15 (colored)

kernel_lock isn't needed for memory allocation any more.

Revision 1.61.2.6 / (download) - annotate - [select for diffs], Tue Apr 10 00:22:11 2007 UTC (16 years, 11 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.5: +3 -2 lines
Diff to previous 1.61.2.5 (colored) to selected 1.40.2.15 (colored)

Changes to select/poll:

- Make them MP safe and decouple from the proc locks.
- selwakeup: don't call p_find, or traverse per-proc LWP lists (ouch).
- selwakeup: don't lock the sleep queue unless we need to.

Revision 1.61.2.5 / (download) - annotate - [select for diffs], Mon Apr 9 22:10:03 2007 UTC (16 years, 11 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.4: +2 -6 lines
Diff to previous 1.61.2.4 (colored) to selected 1.40.2.15 (colored)

- Add two new arguments to kthread_create1: pri_t pri, bool mpsafe.
- Fork kthreads off proc0 as new LWPs, not new processes.

Revision 1.61.2.4 / (download) - annotate - [select for diffs], Thu Apr 5 21:38:36 2007 UTC (16 years, 11 months ago) by ad
Branch: vmlocking
Changes since 1.61.2.3: +14 -2 lines
Diff to previous 1.61.2.3 (colored) to selected 1.40.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.49.2.1 / (download) - annotate - [select for diffs], Sun Apr 1 16:16:20 2007 UTC (17 years ago) by bouyer
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.49: +3 -2 lines
Diff to previous 1.49 (colored) next main 1.50 (colored) to selected 1.40.2.15 (colored)

Apply patch (requested by chs in ticket #554):
	sys/kern/kern_exit.c	patch
	sys/kern/kern_lwp.c	patch
	sys/kern/kern_proc.c	patch
	sys/sys/proc.h		patch
Add a new SDYING process state. In exit1() release structures before curlwp is
NULL. It should fix the problem described in PR 34892.

Revision 1.62.4.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.62: +133 -56 lines
Diff to previous 1.62 (colored) next main 1.63 (colored) to selected 1.40.2.15 (colored)

Pullup to -current

Revision 1.55.2.10 / (download) - annotate - [select for diffs], Sat Mar 24 17:13:14 2007 UTC (17 years ago) by ad
Branch: yamt-idlelwp
Changes since 1.55.2.9: +24 -4 lines
Diff to previous 1.55.2.9 (colored) to selected 1.40.2.15 (colored)

- Ensure that context switch always happens at least at IPL_SCHED, even
  if no spin lock is held. Should fix the assertion failure seen on hppa.
- Reduce the amount of spl frobbing in mi_switch.
- Add some comments.

Reviewed by yamt@.

Revision 1.55.2.9 / (download) - annotate - [select for diffs], Sat Mar 24 14:56:01 2007 UTC (17 years ago) by yamt
Branch: yamt-idlelwp
Changes since 1.55.2.8: +135 -58 lines
Diff to previous 1.55.2.8 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.55.2.8 / (download) - annotate - [select for diffs], Sat Mar 24 00:43:06 2007 UTC (17 years ago) by rmind
Branch: yamt-idlelwp
Changes since 1.55.2.7: +13 -9 lines
Diff to previous 1.55.2.7 (colored) to selected 1.40.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.61.2.3 / (download) - annotate - [select for diffs], Wed Mar 21 20:10:20 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.61.2.2: +15 -15 lines
Diff to previous 1.61.2.2 (colored) to selected 1.40.2.15 (colored)

GC the simplelock/spinlock debugging stuff.

Revision 1.63 / (download) - annotate - [select for diffs], Wed Mar 21 18:26:00 2007 UTC (17 years ago) by ad
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic
Changes since 1.62: +133 -56 lines
Diff to previous 1.62 (colored) to selected 1.40.2.15 (colored)

Improvements to lwp_wait1(), for PR kern/35932:

- Better detect simple cycles of threads calling _lwp_wait and return
  EDEADLK. Does not handle deeper cycles like t1 -> t2 -> t3 -> t1.
- If there are multiple threads in _lwp_wait, then make sure that
  targeted waits take precedence over waits for any LWP to exit.
- When checking for deadlock, also count the number of zombies currently
  in the process as potentially reapable. Whenever a zombie is murdered,
  kick all waiters to make them check again for deadlock.
- Add more comments.

Also, while here:

- LOCK_ASSERT -> KASSERT in some places
- lwp_free: change boolean arguments to type 'bool'.
- proc_free: let lwp_free spin waiting for the last LWP to exit, there's
  no reason to do it here.

Revision 1.61.2.2 / (download) - annotate - [select for diffs], Tue Mar 13 17:50:53 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.61.2.1: +5 -8 lines
Diff to previous 1.61.2.1 (colored) to selected 1.40.2.15 (colored)

Pull in the initial set of changes for the vmlocking branch.

Revision 1.61.2.1 / (download) - annotate - [select for diffs], Tue Mar 13 16:51:53 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.61: +4 -4 lines
Diff to previous 1.61 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.62 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:33 2007 UTC (17 years ago) by ad
Branch: MAIN
Branch point for: reinoud-bufcleanup, mjf-ufs-trans
Changes since 1.61: +4 -4 lines
Diff to previous 1.61 (colored) to selected 1.40.2.15 (colored)

Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.55.2.7 / (download) - annotate - [select for diffs], Mon Mar 12 05:58:35 2007 UTC (17 years ago) by rmind
Branch: yamt-idlelwp
Changes since 1.55.2.6: +6 -5 lines
Diff to previous 1.55.2.6 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.55.2.6 / (download) - annotate - [select for diffs], Fri Mar 9 15:16:24 2007 UTC (17 years ago) by rmind
Branch: yamt-idlelwp
Changes since 1.55.2.5: +9 -5 lines
Diff to previous 1.55.2.5 (colored) to selected 1.40.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.61 / (download) - annotate - [select for diffs], Sun Mar 4 20:59:00 2007 UTC (17 years ago) by ad
Branch: MAIN
Branch point for: vmlocking
Changes since 1.60: +6 -5 lines
Diff to previous 1.60 (colored) to selected 1.40.2.15 (colored)

lwp_userret: if the process is exiting, don't bother looking for signals.

Revision 1.55.2.5 / (download) - annotate - [select for diffs], Tue Feb 27 16:54:22 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.55.2.4: +50 -26 lines
Diff to previous 1.55.2.4 (colored) to selected 1.40.2.15 (colored)

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

Revision 1.60 / (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.59: +26 -2 lines
Diff to previous 1.59 (colored) to selected 1.40.2.15 (colored)

implement priority inheritance.

Revision 1.29.6.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:11:07 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.2: +913 -478 lines
Diff to previous 1.29.6.2 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.55.2.4 / (download) - annotate - [select for diffs], Sun Feb 25 13:57:15 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.55.2.3: +1 -0 lines
Diff to previous 1.55.2.3 (colored) to selected 1.40.2.15 (colored)

move cpu_switchto to sys/cpu.h from sys/sched.h.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Feb 21 23:48:13 2007 UTC (17 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.58: +3 -3 lines
Diff to previous 1.58 (colored) to selected 1.40.2.15 (colored)

Pick up some additional files that were missed before due to conflicts
with newlock2 merge:

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.58 / (download) - annotate - [select for diffs], Tue Feb 20 17:47:03 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.57: +2 -5 lines
Diff to previous 1.57 (colored) to selected 1.40.2.15 (colored)

When sending signals, only boost the priority of the receiving LWP if
the process is being killed.

Revision 1.57 / (download) - annotate - [select for diffs], Sun Feb 18 16:58:15 2007 UTC (17 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.56: +5 -2 lines
Diff to previous 1.56 (colored) to selected 1.40.2.15 (colored)

Add code to support per-system call statistics:
option SYSCALL_STATS	counts the number of times each system call is made
option SYSCALL_TIMES	counts the amount of time spent in each system call
Currently the counting hooks have only been added to the i386 system call
handler, and the time spent in interrupts is not subtracted.
It ought also be possible to add the times to the processes profiling
counters in order to get a more accurate user/system/interrupt split.
The counts themselves are readable via the sysctl interface.

Revision 1.55.2.3 / (download) - annotate - [select for diffs], Sun Feb 18 13:32:34 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.55.2.2: +0 -11 lines
Diff to previous 1.55.2.2 (colored) to selected 1.40.2.15 (colored)

remove unused lwp_exit2.

Revision 1.55.2.2 / (download) - annotate - [select for diffs], Sun Feb 18 13:09:03 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.55.2.1: +2 -2 lines
Diff to previous 1.55.2.1 (colored) to selected 1.40.2.15 (colored)

update a comment.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Feb 17 22:31:43 2007 UTC (17 years, 1 month ago) by pavel
Branch: MAIN
Changes since 1.55: +21 -21 lines
Diff to previous 1.55 (colored) to selected 1.40.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.55.2.1 / (download) - annotate - [select for diffs], Sat Feb 17 10:30:57 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.55: +21 -3 lines
Diff to previous 1.55 (colored) to selected 1.40.2.15 (colored)

- separate context switching and thread scheduling.
- introduce idle lwp.
- change some related MD/MI interfaces and implement i386 version.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Feb 16 00:35:45 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
Branch point for: yamt-idlelwp
Changes since 1.54: +4 -4 lines
Diff to previous 1.54 (colored) to selected 1.40.2.15 (colored)

lwp_free(): pass curlwp to KERNEL_LOCK(), not 'l'.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Feb 15 15:13:10 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.53: +13 -2 lines
Diff to previous 1.53 (colored) to selected 1.40.2.15 (colored)

Restore proc::p_userret in a limited way for Linux compat. XXX

Revision 1.53 / (download) - annotate - [select for diffs], Thu Feb 15 15:08:42 2007 UTC (17 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.52: +6 -3 lines
Diff to previous 1.52 (colored) to selected 1.40.2.15 (colored)

newlwp: ensure not to assign lid 0.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:30 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge
Changes since 1.51: +897 -476 lines
Diff to previous 1.51 (colored) to selected 1.40.2.15 (colored)

Merge newlock2 to head.

Revision 1.40.2.20 / (download) - annotate - [select for diffs], Mon Feb 5 13:16:49 2007 UTC (17 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.40.2.19: +18 -10 lines
Diff to previous 1.40.2.19 (colored) to branchpoint 1.40 (colored) next main 1.41 (colored) to selected 1.40.2.15 (colored)

- When clearing signals dequeue siginfo first and free later, once
  outside the lock permiter.
- Push kernel_lock back in a a couple of places.
- Adjust limcopy() to be MP safe (this needs redoing).
- Fix a couple of bugs noticed along the way.
- Catch up with condvar changes.

Revision 1.40.2.19 / (download) - annotate - [select for diffs], Sat Feb 3 16:32:50 2007 UTC (17 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.40.2.18: +5 -8 lines
Diff to previous 1.40.2.18 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

- Require that cv_signal/cv_broadcast be called with the interlock held.
- Provide 'async' versions that's don't need the interlock.

Revision 1.40.2.18 / (download) - annotate - [select for diffs], Thu Feb 1 06:21:07 2007 UTC (17 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.40.2.17: +3 -3 lines
Diff to previous 1.40.2.17 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Get sh3 compiling.

Revision 1.40.2.17 / (download) - annotate - [select for diffs], Wed Jan 31 19:56:38 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.40.2.16: +8 -4 lines
Diff to previous 1.40.2.16 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

- Have callers to mi_switch() drop the kernel lock.
- Fix a deadlock and some typos.
- Unbreak ptrace().

Revision 1.40.2.16 / (download) - annotate - [select for diffs], Tue Jan 30 13:51:40 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.40.2.15: +3 -21 lines
Diff to previous 1.40.2.15 (colored) to branchpoint 1.40 (colored)

Remove support for SA. Ok core@.

Revision 1.40.2.15 / (download) - annotate - [selected], Sun Jan 28 07:20:38 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.40.2.14: +3 -3 lines
Diff to previous 1.40.2.14 (colored) to branchpoint 1.40 (colored)

- Fix sequence error between saving/raising the SPL.
- Changes for JavaStation.
- Fix bugs with mips & sparc support routines.

Revision 1.40.2.14 / (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.40.2.13: +7 -7 lines
Diff to previous 1.40.2.13 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Rename some functions to better describe what they do.

Revision 1.40.2.13 / (download) - annotate - [select for diffs], Sat Jan 27 00:27:41 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.40.2.12: +4 -3 lines
Diff to previous 1.40.2.12 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

lwp_need_userret(): don't adjust l_priority if the LWP has kernel priority.

Revision 1.40.2.12 / (download) - annotate - [select for diffs], Thu Jan 25 20:18:37 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.40.2.11: +4 -2 lines
Diff to previous 1.40.2.11 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Eliminate some uses of mtsleep().

Revision 1.40.2.11 / (download) - annotate - [select for diffs], Fri Jan 19 13:36:08 2007 UTC (17 years, 2 months ago) by yamt
Branch: newlock2
Changes since 1.40.2.10: +3 -3 lines
Diff to previous 1.40.2.10 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

newlwp: don't blindly set L_INMEM for kernel lwps.
fixes double faults observed when an lwp uses more than one page
of its stack.

Revision 1.40.2.10 / (download) - annotate - [select for diffs], Tue Jan 16 05:21:30 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.40.2.9: +10 -5 lines
Diff to previous 1.40.2.9 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

lwp_exit(): don't delay signal delivery if the LWP has been elected to
take a process-wide signal.

Revision 1.40.2.9 / (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.40.2.8: +13 -16 lines
Diff to previous 1.40.2.8 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Minor corrections.

Revision 1.40.2.8 / (download) - annotate - [select for diffs], Fri Jan 12 01:04:06 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.40.2.7: +2 -2 lines
Diff to previous 1.40.2.7 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.40.2.7 / (download) - annotate - [select for diffs], Thu Jan 11 22:22:59 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.40.2.6: +22 -19 lines
Diff to previous 1.40.2.6 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Checkpoint work in progress.

Revision 1.29.6.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:50:05 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29.6.1: +152 -5 lines
Diff to previous 1.29.6.1 (colored) to branchpoint 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.40.2.6 / (download) - annotate - [select for diffs], Fri Dec 29 20:27:43 2006 UTC (17 years, 3 months ago) by ad
Branch: newlock2
Changes since 1.40.2.5: +389 -291 lines
Diff to previous 1.40.2.5 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Checkpoint work in progress.

Revision 1.51 / (download) - annotate - [select for diffs], Sat Dec 23 08:39:47 2006 UTC (17 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: newlock2-nbase, newlock2-base
Changes since 1.50: +4 -2 lines
Diff to previous 1.50 (colored) to selected 1.40.2.15 (colored)

lwp_update_creds(): acquire the kernel lock to avoid potential deadlock.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Dec 22 08:04:01 2006 UTC (17 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.49: +3 -8 lines
Diff to previous 1.49 (colored) to selected 1.40.2.15 (colored)

lwp::l_acflag is no longer useful.

Revision 1.40.4.2 / (download) - annotate - [select for diffs], Sun Dec 10 07:18:44 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.40.4.1: +22 -12 lines
Diff to previous 1.40.4.1 (colored) to branchpoint 1.40 (colored) next main 1.41 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.40.2.5 / (download) - annotate - [select for diffs], Sat Nov 18 21:39:22 2006 UTC (17 years, 4 months ago) by ad
Branch: newlock2
Changes since 1.40.2.4: +121 -11 lines
Diff to previous 1.40.2.4 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.40.2.4 / (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.40.2.3: +412 -185 lines
Diff to previous 1.40.2.3 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Checkpoint work in progress.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Nov 3 19:46:03 2006 UTC (17 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, netbsd-4-base
Branch point for: netbsd-4
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored) to selected 1.40.2.15 (colored)

- issignal(): acquire the kernel lock before inspecting signal state
- lwp_exit2(): don't drop the kernel lock until after doing wakeup()

Revision 1.48 / (download) - annotate - [select for diffs], Wed Nov 1 10:17:58 2006 UTC (17 years, 5 months ago) by yamt
Branch: MAIN
Changes since 1.47: +11 -11 lines
Diff to previous 1.47 (colored) to selected 1.40.2.15 (colored)

remove some __unused from function parameters.

Revision 1.40.2.3 / (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.40.2.2: +118 -38 lines
Diff to previous 1.40.2.2 (colored) to branchpoint 1.40 (colored) to selected 1.40.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.47 / (download) - annotate - [select for diffs], Tue Oct 24 10:05:45 2006 UTC (17 years, 5 months ago) by hannken
Branch: MAIN
Changes since 1.46: +12 -2 lines
Diff to previous 1.46 (colored) to selected 1.40.2.15 (colored)

Remove specificdata_setspecific_nowait() as result of discussion on tech-kern.

Add _lwp_getspecific_by_lwp() to get lwp specific data from other lwp's.
Protected by #ifdef _LWP_API_PRIVATE.

Approved by: Jason Thorpe <thorpej@netbsd.org>

Revision 1.40.4.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:07:10 2006 UTC (17 years, 5 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.40: +111 -11 lines
Diff to previous 1.40 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.40.2.2 / (download) - annotate - [select for diffs], Sat Oct 21 15:20:46 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.40.2.1: +424 -411 lines
Diff to previous 1.40.2.1 (colored) to branchpoint 1.40 (colored) to selected 1.40.2.15 (colored)

Checkpoint work in progress on locking and per-LWP signals. Very much a
a work in progress and there is still a lot to do.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Oct 12 01:32:16 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.45: +11 -11 lines
Diff to previous 1.45 (colored) to selected 1.40.2.15 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.45 / (download) - annotate - [select for diffs], Wed Oct 11 04:51:06 2006 UTC (17 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.44: +25 -8 lines
Diff to previous 1.44 (colored) to selected 1.40.2.15 (colored)

Don't free specificdata in lwp_exit2(); it's not safe to block there.
Instead, free an LWP's specificdata from lwp_exit() (if it is not the
last LWP) or exit1() (if it is the last LWP).  For consistency, free the
proc's specificdata from exit1() as well.  Add lwp_finispecific() and
proc_finispecific() functions to make this more convenient.

Revision 1.44 / (download) - annotate - [select for diffs], Wed Oct 11 03:46:42 2006 UTC (17 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.43: +5 -5 lines
Diff to previous 1.43 (colored) to selected 1.40.2.15 (colored)

Upon further reflection, make lwp_{get,set}specific() operate only on
curlwp.  Things that need to operate on "other" LWPs will get a very
special (and very private) API for their needs.

Revision 1.43 / (download) - annotate - [select for diffs], Mon Oct 9 00:39:06 2006 UTC (17 years, 5 months ago) by martin
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored) to selected 1.40.2.15 (colored)

Remove unused variables.

Revision 1.42 / (download) - annotate - [select for diffs], Sun Oct 8 22:57:11 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.41: +11 -4 lines
Diff to previous 1.41 (colored) to selected 1.40.2.15 (colored)

add {proc,lwp}_initspecific and use them to init proc0 and lwp0.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Oct 8 04:28:44 2006 UTC (17 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.40: +79 -3 lines
Diff to previous 1.40 (colored) to selected 1.40.2.15 (colored)

Add specificdata support to procs and lwps, each providing their own
wrappers around the speicificdata subroutines.  Also:
- Call the new lwpinit() function from main() after calling procinit().
- Move some pool initialization out of kern_proc.c and into files that
  are directly related to the pools in question (kern_lwp.c and kern_ras.c).
- Convert uipc_sem.c to proc_{get,set}specific(), and eliminate the p_ksems
  member from struct proc.

Revision 1.40.2.1 / (download) - annotate - [select for diffs], Mon Sep 11 18:19:09 2006 UTC (17 years, 6 months ago) by ad
Branch: newlock2
Changes since 1.40: +15 -14 lines
Diff to previous 1.40 (colored) to selected 1.40.2.15 (colored)

- Allocate and free turnstiles where needed.
- Split proclist_mutex and alllwp_mutex out of the proclist_lock,
  and use in interrupt context.
- Fix an MP race in enterpgrp()/setsid().
- Acquire proclist_lock and p_crmutex in some obvious places.

Revision 1.33.6.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:57:16 2006 UTC (17 years, 6 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.33: +49 -6 lines
Diff to previous 1.33 (colored) next main 1.34 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.33.10.4 / (download) - annotate - [select for diffs], Sun Sep 3 15:25:22 2006 UTC (17 years, 6 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.33.10.3: +9 -4 lines
Diff to previous 1.33.10.3 (colored) to branchpoint 1.33 (colored) next main 1.34 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Aug 14 14:11:21 2006 UTC (17 years, 7 months ago) by ad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.39: +9 -4 lines
Diff to previous 1.39 (colored) to selected 1.40.2.15 (colored)

sys__lwp_create: put newuc back to the pool on failure.

Revision 1.33.10.3 / (download) - annotate - [select for diffs], Fri Aug 11 15:45:46 2006 UTC (17 years, 7 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.33.10.2: +37 -2 lines
Diff to previous 1.33.10.2 (colored) to branchpoint 1.33 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jul 30 21:58:11 2006 UTC (17 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.38: +2 -23 lines
Diff to previous 1.38 (colored) to selected 1.40.2.15 (colored)

Single-thread updates to the process credential.

Revision 1.38 / (download) - annotate - [select for diffs], Thu Jul 20 00:17:10 2006 UTC (17 years, 8 months ago) by ad
Branch: MAIN
Changes since 1.37: +2 -3 lines
Diff to previous 1.37 (colored) to selected 1.40.2.15 (colored)

Try again.. Move l_cred into the startzero section, and fix the define.
Doesn't change the layout of struct lwp.

Revision 1.37 / (download) - annotate - [select for diffs], Wed Jul 19 21:11:37 2006 UTC (17 years, 8 months ago) by ad
Branch: MAIN
Changes since 1.36: +59 -2 lines
Diff to previous 1.36 (colored) to selected 1.40.2.15 (colored)

- Hold a reference to the process credentials in each struct lwp.
- Update the reference on syscall and user trap if p_cred has changed.
- Collect accounting flags in the LWP, and collate on LWP exit.

Revision 1.29.6.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:09:37 2006 UTC (17 years, 9 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.29: +32 -22 lines
Diff to previous 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Mon Jun 19 04:07:15 2006 UTC (17 years, 9 months ago) by chap
Branch: chap-midi
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored) next main 1.36 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.33.8.2 / (download) - annotate - [select for diffs], Thu Jun 1 22:38:07 2006 UTC (17 years, 10 months ago) by kardel
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.33.8.1: +5 -3 lines
Diff to previous 1.33.8.1 (colored) to branchpoint 1.33 (colored) next main 1.34 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.33.14.2 / (download) - annotate - [select for diffs], Wed May 24 15:50:40 2006 UTC (17 years, 10 months ago) by tron
Branch: peter-altq
Changes since 1.33.14.1: +3 -1 lines
Diff to previous 1.33.14.1 (colored) to branchpoint 1.33 (colored) next main 1.34 (colored) to selected 1.40.2.15 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.33.10.2 / (download) - annotate - [select for diffs], Wed May 24 10:58:41 2006 UTC (17 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.33.10.1: +5 -3 lines
Diff to previous 1.33.10.1 (colored) to branchpoint 1.33 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.36 / (download) - annotate - [select for diffs], Mon May 22 13:43:54 2006 UTC (17 years, 10 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base
Changes since 1.35: +1 -1 lines
Diff to previous 1.35 (colored) to selected 1.40.2.15 (colored)

introduce macros, UAREA_TO_USER and USER_TO_UAREA,
to convert uarea VA into a pointer to struct user and vice versa,
so that MD code can change the layout in uarea.

Revision 1.33.12.2 / (download) - annotate - [select for diffs], Thu May 11 23:30:14 2006 UTC (17 years, 10 months ago) by elad
Branch: elad-kernelauth
Changes since 1.33.12.1: +4 -2 lines
Diff to previous 1.33.12.1 (colored) to branchpoint 1.33 (colored) next main 1.34 (colored) to selected 1.40.2.15 (colored)

sync with head

Revision 1.35 / (download) - annotate - [select for diffs], Wed Apr 26 11:44:39 2006 UTC (17 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: elad-kernelauth-base
Branch point for: chap-midi
Changes since 1.34: +4 -2 lines
Diff to previous 1.34 (colored) to selected 1.40.2.15 (colored)

lwp_suspend: don't forget to decrement p_nrlwps when suspending ourselves.
fix PR/33287 from Gregory McGarry.

Revision 1.33.8.1 / (download) - annotate - [select for diffs], Sat Apr 22 11:39:58 2006 UTC (17 years, 11 months ago) by simonb
Branch: simonb-timecounters
Changes since 1.33: +4 -3 lines
Diff to previous 1.33 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.33.12.1 / (download) - annotate - [select for diffs], Wed Apr 19 05:13:59 2006 UTC (17 years, 11 months ago) by elad
Branch: elad-kernelauth
Changes since 1.33: +4 -3 lines
Diff to previous 1.33 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.33.10.1 / (download) - annotate - [select for diffs], Sat Apr 1 12:07:39 2006 UTC (18 years ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.33: +4 -3 lines
Diff to previous 1.33 (colored) to selected 1.40.2.15 (colored)

sync with head.

Revision 1.33.14.1 / (download) - annotate - [select for diffs], Fri Mar 31 09:45:27 2006 UTC (18 years ago) by tron
Branch: peter-altq
Changes since 1.33: +4 -3 lines
Diff to previous 1.33 (colored) to selected 1.40.2.15 (colored)

Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.

Revision 1.34 / (download) - annotate - [select for diffs], Wed Mar 29 23:02:31 2006 UTC (18 years ago) by cube
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3
Changes since 1.33: +4 -3 lines
Diff to previous 1.33 (colored) to selected 1.40.2.15 (colored)

Rework the _lwp* and sa_* families of syscalls so some details can be
handled differently depending on the emulation.  This paves the way for
COMPAT_NETBSD32 support of our pthread system.

Revision 1.8.2.7 / (download) - annotate - [select for diffs], Sun Dec 11 10:29:11 2005 UTC (18 years, 3 months ago) by christos
Branch: ktrace-lwp
Changes since 1.8.2.6: +11 -2 lines
Diff to previous 1.8.2.6 (colored) next main 1.9 (colored) to selected 1.40.2.15 (colored)

Sync with head.

Revision 1.29.4.2 / (download) - annotate - [select for diffs], Sun Nov 13 13:56:02 2005 UTC (18 years, 4 months ago) by tron
Branch: netbsd-3
CVS Tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Changes since 1.29.4.1: +9 -0 lines
Diff to previous 1.29.4.1 (colored) to branchpoint 1.29 (colored) next main 1.30 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by chs in ticket #954):
	sys/kern/kern_lwp.c: revision 1.33
disallow non-SA LWP syscalls for SA processes.  they add no value
in this context, only headaches.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Nov 12 02:28:31 2005 UTC (18 years, 4 months ago) by chs
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-uio_vmspace, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base, ktrace-lwp-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, peter-altq, elad-kernelauth
Changes since 1.32: +11 -2 lines
Diff to previous 1.32 (colored) to selected 1.40.2.15 (colored)

disallow non-SA LWP syscalls for SA processes.  they add no value
in this context, only headaches.

Revision 1.8.2.6 / (download) - annotate - [select for diffs], Thu Nov 10 14:09:44 2005 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.8.2.5: +18 -20 lines
Diff to previous 1.8.2.5 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD. Here we go again...

Revision 1.32 / (download) - annotate - [select for diffs], Wed Oct 5 15:46:00 2005 UTC (18 years, 5 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, thorpej-vnode-attr-base, thorpej-vnode-attr
Changes since 1.31: +2 -3 lines
Diff to previous 1.31 (colored) to selected 1.40.2.15 (colored)

remove a redundant assignment in the previous.

Revision 1.29.4.1 / (download) - annotate - [select for diffs], Tue Oct 4 14:16:42 2005 UTC (18 years, 5 months ago) by tron
Branch: netbsd-3
Changes since 1.29: +6 -11 lines
Diff to previous 1.29 (colored) to selected 1.40.2.15 (colored)

Pull up following revision(s) (requested by yamt in ticket #842):
	sys/sys/proc.h: revision 1.206
	sys/kern/kern_lwp.c: revision 1.30
	sys/kern/kern_exit.c: revision 1.151
protect p_nrlwps by sched_lock.  no objection on tech-kern@.  PR/29652.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Oct 1 06:12:44 2005 UTC (18 years, 6 months ago) by yamt
Branch: MAIN
Changes since 1.30: +15 -11 lines
Diff to previous 1.30 (colored) to selected 1.40.2.15 (colored)

simplify lwp exit code.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Aug 28 14:57:18 2005 UTC (18 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.29: +6 -11 lines
Diff to previous 1.29 (colored) to selected 1.40.2.15 (colored)

protect p_nrlwps by sched_lock.  no objection on tech-kern@.  PR/29652.

Revision 1.28.4.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:29:23 2005 UTC (18 years, 11 months ago) by kent
Branch: kent-audio2
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored) next main 1.29 (colored) to selected 1.40.2.15 (colored)

sync with -current

Revision 1.28.6.1 / (download) - annotate - [select for diffs], Sat Mar 19 08:36:11 2005 UTC (19 years ago) by yamt
Branch: yamt-km
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored) next main 1.29 (colored) to selected 1.40.2.15 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.8.2.5 / (download) - annotate - [select for diffs], Tue Feb 15 21:33:29 2005 UTC (19 years, 1 month ago) by skrll
Branch: ktrace-lwp
Changes since 1.8.2.4: +4 -4 lines
Diff to previous 1.8.2.4 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Feb 12 21:39:00 2005 UTC (19 years, 1 month ago) by fvdl
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base, kent-audio2-base
Branch point for: yamt-lazymbuf, netbsd-3
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored) to selected 1.40.2.15 (colored)

Don't panic when lwp_suspend finds an LWP on another CPU, just return
EINVAL for now.

Revision 1.8.2.4 / (download) - annotate - [select for diffs], Tue Oct 19 15:58:04 2004 UTC (19 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.8.2.3: +3 -3 lines
Diff to previous 1.8.2.3 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.28 / (download) - annotate - [select for diffs], Wed Oct 6 08:55:27 2004 UTC (19 years, 5 months ago) by skrll
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored) to selected 1.40.2.15 (colored)

Correct arg name in comment.

Revision 1.8.2.3 / (download) - annotate - [select for diffs], Tue Sep 21 13:35:04 2004 UTC (19 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.8.2.2: +2 -2 lines
Diff to previous 1.8.2.2 (colored) to selected 1.40.2.15 (colored)

Fix the sync with head I botched.

Revision 1.8.2.2 / (download) - annotate - [select for diffs], Sat Sep 18 14:53:02 2004 UTC (19 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.8.2.1: +0 -0 lines
Diff to previous 1.8.2.1 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD.

Revision 1.8.2.1 / (download) - annotate - [select for diffs], Tue Aug 3 10:52:47 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.8: +114 -55 lines
Diff to previous 1.8 (colored) to selected 1.40.2.15 (colored)

Sync with HEAD

Revision 1.27 / (download) - annotate - [select for diffs], Wed May 12 21:10:09 2004 UTC (19 years, 10 months ago) by matt
Branch: MAIN
Changes since 1.26: +8 -2 lines
Diff to previous 1.26 (colored) to selected 1.40.2.15 (colored)

In proc_representative_lwp, if there is an outstanding trap signal, return
the lwp that had the trap.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Mar 5 11:17:41 2004 UTC (20 years ago) by junyoung
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored) to selected 1.40.2.15 (colored)

lwp_exit2(): set lwp state to SZOMB at more appropriate point.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Mar 2 09:15:26 2004 UTC (20 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored) to selected 1.40.2.15 (colored)

once exit1() releases big kernel lock, the struct proc can be freed and
re-used by another cpu immediately.  in that case, lwp_exit2() will
access freed memory.  to fix this:

- remove curlwp from p_lwps in exit1() rather than letting lwp_exit2() do so.
- add assertions to ensure freed proc has no lwps.

kern/24329 from me and kern/24574 from Havard Eidnes.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Feb 13 11:36:23 2004 UTC (20 years, 1 month ago) by wiz
Branch: MAIN
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored) to selected 1.40.2.15 (colored)

Uppercase CPU, plural is CPUs.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Feb 9 13:11:21 2004 UTC (20 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.22: +4 -2 lines
Diff to previous 1.22 (colored) to selected 1.40.2.15 (colored)

- borrow vmspace0 in uvm_proc_exit instead of uvmspace_free.
  the latter is not a appropriate place to do so and it broke vfork.
- deactivate pmap before calling cpu_exit() to keep a balance of
  pmap_activate/deactivate.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Feb 9 13:02:48 2004 UTC (20 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.21: +5 -2 lines
Diff to previous 1.21 (colored) to selected 1.40.2.15 (colored)

lwp_exit2: grab kernel_lock to preserve locking order.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Feb 6 08:08:46 2004 UTC (20 years, 1 month ago) by junyoung
Branch: MAIN
Changes since 1.20: +4 -13 lines
Diff to previous 1.20 (colored) to selected 1.40.2.15 (colored)

ANSIfy & zap some blank lines.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jan 11 19:39:48 2004 UTC (20 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.19: +2 -4 lines
Diff to previous 1.19 (colored) to selected 1.40.2.15 (colored)

g/c process state SDEAD - it's not used anymore after 'reaper' removal

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jan 4 11:33:31 2004 UTC (20 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.18: +40 -20 lines
Diff to previous 1.18 (colored) to selected 1.40.2.15 (colored)

Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
  as FPU state), and is the last potentially blocking operation;
  all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
  by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
  for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread

Revision 1.18 / (download) - annotate - [select for diffs], Sat Jan 3 20:10:01 2004 UTC (20 years, 2 months ago) by jdolecek
Branch: MAIN
Changes since 1.17: +4 -4 lines
Diff to previous 1.17 (colored) to selected 1.40.2.15 (colored)

constify a bit

Revision 1.17 / (download) - annotate - [select for diffs], Wed Dec 24 22:42:11 2003 UTC (20 years, 3 months ago) by manu
Branch: MAIN
Changes since 1.16: +18 -5 lines
Diff to previous 1.16 (colored) to selected 1.40.2.15 (colored)

Split sys_lwp_suspend, just like sys_lwp_unsuspend is split. We get
sys_lwp_suspend, with the sanity checks, and lwp_suspend, with the
actual implementation.

Revision 1.16 / (download) - annotate - [select for diffs], Sat Dec 20 18:22:17 2003 UTC (20 years, 3 months ago) by manu
Branch: MAIN
Changes since 1.15: +8 -2 lines
Diff to previous 1.15 (colored) to selected 1.40.2.15 (colored)

Introduce lwp_emuldata and the associated hooks. No hook is provided for the
exec case, as the emulation already has the ability to intercept that
with the e_proc_exec hook. It is the responsability of the emulation to
take appropriaye action about lwp_emuldata in e_proc_exec.

Patch reviewed by Christos.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Nov 4 10:33:15 2003 UTC (20 years, 4 months ago) by dsl
Branch: MAIN
Changes since 1.14: +12 -12 lines
Diff to previous 1.14 (colored) to selected 1.40.2.15 (colored)

Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)

Revision 1.14 / (download) - annotate - [select for diffs], Thu Oct 30 23:31:21 2003 UTC (20 years, 5 months ago) by cl
Branch: MAIN
Changes since 1.13: +5 -6 lines
Diff to previous 1.13 (colored) to selected 1.40.2.15 (colored)

Don't grab the sched lock in lwp_continue() because lwp_continue() is
called from kpsignal2() with the sched lock held.  Get the lock in
sys__lwp_continue() instead.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Oct 19 01:44:49 2003 UTC (20 years, 5 months ago) by simonb
Branch: MAIN
Changes since 1.12: +2 -3 lines
Diff to previous 1.12 (colored) to selected 1.40.2.15 (colored)

Remove unreachable break after return and goto statements.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jul 28 23:35:20 2003 UTC (20 years, 8 months ago) by matt
Branch: MAIN
Changes since 1.11: +6 -2 lines
Diff to previous 1.11 (colored) to selected 1.40.2.15 (colored)

Improve _lwp_wakeup so when it wakes a thread, the target thread thinks
ltsleep has been interrupted and thus the target will not think it was
a spurious wakeup.  (this makes syscalls cancellable for libpthread).

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jul 17 19:05:30 2003 UTC (20 years, 8 months ago) by fvdl
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored) to selected 1.40.2.15 (colored)

Return the value of 'error' instead of always 0. From Christian Limpach.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jul 17 18:16:58 2003 UTC (20 years, 8 months ago) by fvdl
Branch: MAIN
Changes since 1.9: +23 -8 lines
Diff to previous 1.9 (colored) to selected 1.40.2.15 (colored)

Changes from Stephan Uphoff to patch problems with LWPs blocking when they
shouldn't, and MP.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Jul 14 14:59:01 2003 UTC (20 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.8: +4 -1 lines
Diff to previous 1.8 (colored) to selected 1.40.2.15 (colored)

add missing __KERNEL_RCSID()

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jun 23 11:02:05 2003 UTC (20 years, 9 months ago) by martin
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.7: +3 -1 lines
Diff to previous 1.7 (colored) to selected 1.40.2.15 (colored)

Make sure to include opt_foo.h if a defflag option FOO is used.

Revision 1.7 / (download) - annotate - [select for diffs], Wed May 21 17:57:21 2003 UTC (20 years, 10 months ago) by kristerw
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored) to selected 1.40.2.15 (colored)

Use 0 instead of NULL for size parameters.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Mar 19 11:36:33 2003 UTC (21 years ago) by dsl
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) to selected 1.40.2.15 (colored)

Alternative pid/proc allocater, removes all searches associated with pid
lookup and allocation, and any dependency on NPROC or MAXUSERS.
NO_PID changed to -1 (and renamed NO_PGID) to remove artificial limit
on PID_MAX.
As discussed on tech-kern.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jan 30 05:51:58 2003 UTC (21 years, 2 months ago) by matt
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored) to selected 1.40.2.15 (colored)

Add a KASSERT when copying l1->l_cpu to l2->l_cpu

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jan 29 23:27:54 2003 UTC (21 years, 2 months ago) by nathanw
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored) to selected 1.40.2.15 (colored)

Fix _lwp_wakeup() so that it stands a chance of working (although it
turns out to be insufficent for signal-level interruption of system
calls. guess we need _lwp_kill(), ugh).

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jan 28 02:20:35 2003 UTC (21 years, 2 months ago) by nathanw
Branch: MAIN
Changes since 1.2: +11 -11 lines
Diff to previous 1.2 (colored) to selected 1.40.2.15 (colored)

Fix proc_representative_lwp(); a closing brace was in the wrong place,
which means it would return the first non-dead LWP.

Pointed out by Stephan Uphoff.

Revision 1.2 / (download) - annotate - [select for diffs], Sat Jan 18 10:06:22 2003 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.1: +632 -0 lines
Diff to previous 1.1 (colored) to selected 1.40.2.15 (colored)

Merge the nathanw_sa branch.

Revision 1.1.2.24 / (download) - annotate - [select for diffs], Fri Jan 17 03:07:03 2003 UTC (21 years, 2 months ago) by thorpej
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.1.2.23: +23 -0 lines
Diff to previous 1.1.2.23 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored) to selected 1.40.2.15 (colored)

Implement _lwp_getprivate(2) and _lwp_setprivate(2).

Revision 1.1.2.23 / (download) - annotate - [select for diffs], Fri Jan 17 02:59:29 2003 UTC (21 years, 2 months ago) by thorpej
Branch: nathanw_sa
Changes since 1.1.2.22: +10 -9 lines
Diff to previous 1.1.2.22 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Minor cosmetic hanges.

Revision 1.1.2.22 / (download) - annotate - [select for diffs], Sun Dec 15 23:32:01 2002 UTC (21 years, 3 months ago) by thorpej
Branch: nathanw_sa
Changes since 1.1.2.21: +3 -5 lines
Diff to previous 1.1.2.21 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Add an "inmem" argument to newlwp(), and use it to properly set
up L_INMEM in the new LWP.  Should fix a problem mentioned to me
by Nick Hudson.

Revision 1.1.2.21 / (download) - annotate - [select for diffs], Sun Dec 15 22:18:55 2002 UTC (21 years, 3 months ago) by thorpej
Branch: nathanw_sa
Changes since 1.1.2.20: +5 -2 lines
Diff to previous 1.1.2.20 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Use uvm_uarea_alloc().

Revision 1.1.2.20 / (download) - annotate - [select for diffs], Mon Nov 25 21:44:00 2002 UTC (21 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.19: +4 -1 lines
Diff to previous 1.1.2.19 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Release the kernel lock in lwp_exit(), before calling cpu_exit().

Revision 1.1.2.19 / (download) - annotate - [select for diffs], Sun Oct 27 21:12:38 2002 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.18: +34 -33 lines
Diff to previous 1.1.2.18 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Clean up some trailing whitespace.

Revision 1.1.2.18 / (download) - annotate - [select for diffs], Fri Oct 25 17:26:27 2002 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.17: +2 -2 lines
Diff to previous 1.1.2.17 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

The "trivial case" in proc_representative_lwp() is when p->p_nlwps is
1, not when p->p_nrlwps is 1.

Pointed out by Nick Hudson.

Revision 1.1.2.17 / (download) - annotate - [select for diffs], Thu Oct 24 23:34:13 2002 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.16: +33 -17 lines
Diff to previous 1.1.2.16 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Rewrite proc_representative_lwp() to cope with the new way of stopping
LWPs; in particular, it can't assume that any of the LWPs are
*actually* stopped yet, as they could be sleeping, or runnable or
onproc on their way back to userland where they will be stopped.

Instead, for both SSTOP and SACTIVE procs, pick the "most live" LWP,
and include LSSTOP in the hierarchy.

Revision 1.1.2.16 / (download) - annotate - [select for diffs], Tue Oct 22 17:25:20 2002 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.15: +2 -1 lines
Diff to previous 1.1.2.15 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Add a missing splx(s) in sys__lwp_suspend().

Revision 1.1.2.15 / (download) - annotate - [select for diffs], Thu Aug 29 17:46:01 2002 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.14: +1 -15 lines
Diff to previous 1.1.2.14 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Move some code out of lwp_exit() to sa_yield(), which was the only place
exercising it.

Revision 1.1.2.14 / (download) - annotate - [select for diffs], Fri Jul 26 01:22:24 2002 UTC (21 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.13: +23 -12 lines
Diff to previous 1.1.2.13 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Move the core work of sys__lwp_continue into lwp_continue().

Revision 1.1.2.13 / (download) - annotate - [select for diffs], Fri Jul 12 03:08:32 2002 UTC (21 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.12: +3 -3 lines
Diff to previous 1.1.2.12 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

In lwp_wait1, don't pass PCATCH to tsleep() in the EXITCONTROL case.

Revision 1.1.2.12 / (download) - annotate - [select for diffs], Fri Jul 12 01:40:17 2002 UTC (21 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.11: +1 -2 lines
Diff to previous 1.1.2.11 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

No longer need to pull in lwp.h; proc.h pulls it in for us.

Revision 1.1.2.11 / (download) - annotate - [select for diffs], Mon Jun 24 22:10:46 2002 UTC (21 years, 9 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.10: +2 -2 lines
Diff to previous 1.1.2.10 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).

Revision 1.1.2.10 / (download) - annotate - [select for diffs], Thu Jun 20 23:54:49 2002 UTC (21 years, 9 months ago) by thorpej
Branch: nathanw_sa
Changes since 1.1.2.9: +2 -1 lines
Diff to previous 1.1.2.9 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Need to include <sys/sa.h> before <sys/savar.h>

Revision 1.1.2.9 / (download) - annotate - [select for diffs], Tue Apr 2 00:15:59 2002 UTC (22 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.8: +1 -4 lines
Diff to previous 1.1.2.8 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

- Centralize p_nrlwps handling in those functions which actually
  set the LWP state to LSRUN. Simplifies matters considerably.

- Trying to keep track of the preempted LWP was a bad idea; go back
  to searching for now.

- Send a PREEMPTED upcall from proc_unstop(), so that stopped processes
  know that something happened, and so that all runnable LWPs of a unstopped
  process have an upcall to deliver (Ideally, the LWP that was runnable
  when the process was stopped should return first, and any LWPs that were
  woken up while the process was stopped would interrupt it, but that's
  difficult to arrange).

Revision 1.1.2.8 / (download) - annotate - [select for diffs], Wed Feb 6 19:48:35 2002 UTC (22 years, 1 month ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.7: +7 -6 lines
Diff to previous 1.1.2.7 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Don't panic if we return from putting ourselves on the LWP cache in lwp_exit();
it makes sense if the process tries to exit before the cached LWP has been
used.

Revision 1.1.2.7 / (download) - annotate - [select for diffs], Mon Feb 4 23:59:49 2002 UTC (22 years, 1 month ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.6: +15 -1 lines
Diff to previous 1.1.2.6 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

In lwp_exit(), recycle SA LWPs onto the LWP cache instead of exiting.

Revision 1.1.2.6 / (download) - annotate - [select for diffs], Mon Jan 28 18:29:51 2002 UTC (22 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.5: +30 -1 lines
Diff to previous 1.1.2.5 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Add a system call, _lwp_wakeup(), to wake up LWPs that are sleeping
interruptably. This is necessary when another thread has requested the
cancellation of a thread that is sleeping in the kernel.

This interface is slightly klugey. It might be better handled with a _lwp_kill()
interface, but that requires all of the machinery to deliver signals to
individual LWPs, which is large, complicated, and not clearly necessary.

Revision 1.1.2.5 / (download) - annotate - [select for diffs], Thu Nov 29 01:22:57 2001 UTC (22 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.4: +59 -1 lines
Diff to previous 1.1.2.4 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Make proc_representative_lwp() non-static and move it to kern_lwp.c.

Revision 1.1.2.4 / (download) - annotate - [select for diffs], Fri Aug 24 04:20:07 2001 UTC (22 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.3: +10 -2 lines
Diff to previous 1.1.2.3 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

A few files and lwp/proc conversions I missed in the last big update.
GENERIC runs again.

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Fri Jul 13 02:33:43 2001 UTC (22 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.2: +37 -1 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Note copyright.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Mon Jul 9 22:32:28 2001 UTC (22 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.1.2.1: +2 -2 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored) to selected 1.40.2.15 (colored)

Minor SCHED_LOCK() paranoia.

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Mon Mar 5 22:49:40 2001 UTC (23 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.1: +446 -0 lines
Diff to previous 1.1 (colored) to selected 1.40.2.15 (colored)

Initial commit of scheduler activations and lightweight process support.

Revision 1.1, Mon Mar 5 22:49:40 2001 UTC (23 years ago) by nathanw
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base, thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base, thorpej-devvp, newlock-base, newlock, nathanw_sa_before_merge, nathanw_sa_base, kqueue-base, kqueue, ifpoll-base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, gehenna-devsw-base, gehenna-devsw, eeh-devprop-base, eeh-devprop
Branch point for: nathanw_sa
FILE REMOVED

file kern_lwp.c was initially added on branch nathanw_sa.

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>