The NetBSD Project

CVS log for src/sys/rump/librump/rumpkern/scheduler.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / rump / librump / rumpkern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.53 / (download) - annotate - [select for diffs], Sat Apr 9 23:45:14 2022 UTC (9 months, 4 weeks ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

rumpkern/scheduler: Use membar_release.

...but add an XXX comment asking for clarity on what it pairs with.

Revision 1.51.4.1 / (download) - annotate - [select for diffs], Mon Dec 14 14:38:16 2020 UTC (2 years, 1 month ago) by thorpej
Branch: thorpej-futex
Changes since 1.51: +12 -2 lines
Diff to previous 1.51 (colored) next main 1.52 (colored)

Sync w/ HEAD.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Nov 1 20:58:38 2020 UTC (2 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.51: +12 -2 lines
Diff to previous 1.51 (colored)

PR/55664: Ruslan Nikolaev: Fix:

1. A race condition (bug) in sys/rump/librump/rumpkern/intr.c since
   rumpuser_cv_signal() is called without holding a mutex
2. sleepq is implemented using a single (global) conditional
   variable; that should be done per each sleepq separately

Revision 1.44.18.1 / (download) - annotate - [select for diffs], Wed Apr 8 14:09:01 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.44: +39 -15 lines
Diff to previous 1.44 (colored) next main 1.45 (colored)

Merge changes from current as of 20200406

Revision 1.51 / (download) - annotate - [select for diffs], Sat Mar 14 18:08:39 2020 UTC (2 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Branch point for: thorpej-futex
Changes since 1.50: +15 -2 lines
Diff to previous 1.50 (colored)

- Hide the details of SPCF_SHOULDYIELD and related behind a couple of small
  functions: preempt_point() and preempt_needed().

- preempt(): if the LWP has exceeded its timeslice in kernel, strip it of
  any priority boost gained earlier from blocking.

Revision 1.48.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:09 2020 UTC (2 years, 11 months ago) by ad
Branch: ad-namecache
Changes since 1.48.2.1: +3 -3 lines
Diff to previous 1.48.2.1 (colored) to branchpoint 1.48 (colored) next main 1.49 (colored)

Sync with head.

Revision 1.50 / (download) - annotate - [select for diffs], Sat Feb 15 18:12:15 2020 UTC (2 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (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.48.2.1 / (download) - annotate - [select for diffs], Fri Jan 17 21:47:37 2020 UTC (3 years ago) by ad
Branch: ad-namecache
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

Sync with head.

Revision 1.49 / (download) - annotate - [select for diffs], Wed Jan 8 17:38:42 2020 UTC (3 years ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (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.48 / (download) - annotate - [select for diffs], Mon Dec 16 22:47:55 2019 UTC (3 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base
Branch point for: ad-namecache
Changes since 1.47: +4 -10 lines
Diff to previous 1.47 (colored)

- Extend the per-CPU counters matt@ did to include all of the hot counters
  in UVM, excluding uvmexp.free, which needs special treatment and will be
  done with a separate commit.  Cuts system time for a build by 20-25% on
  a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).

Revision 1.47 / (download) - annotate - [select for diffs], Sun Dec 1 19:21:13 2019 UTC (3 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

Another instance of cpu_onproc to replace.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Dec 1 18:12:51 2019 UTC (3 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

cpu_onproc -> ci_onproc

Revision 1.45 / (download) - annotate - [select for diffs], Sat Nov 23 19:42:52 2019 UTC (3 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.44: +22 -5 lines
Diff to previous 1.44 (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.28.2.4 / (download) - annotate - [select for diffs], Sun Dec 3 11:39:16 2017 UTC (5 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.28.2.3: +42 -24 lines
Diff to previous 1.28.2.3 (colored) next main 1.29 (colored)

update from HEAD

Revision 1.39.4.3 / (download) - annotate - [select for diffs], Sat Mar 19 11:30:37 2016 UTC (6 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.39.4.2: +32 -22 lines
Diff to previous 1.39.4.2 (colored) to branchpoint 1.39 (colored) next main 1.40 (colored)

Sync with HEAD

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

add cpu_lock

from freqlabs on irc

Revision 1.43 / (download) - annotate - [select for diffs], Mon Feb 8 18:18:19 2016 UTC (6 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.42: +27 -21 lines
Diff to previous 1.42 (colored)

Allocate struct cpu_info dynamically.  Saves quite a lot of BSS in the
common case and reduces rump kernel memory requirements by 10% or more
in really tiny deployments.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jan 26 23:12:18 2016 UTC (7 years ago) by pooka
Branch: MAIN
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored)

Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories.  Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.

Revision 1.39.4.2 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:15 2015 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.39.4.1: +3 -3 lines
Diff to previous 1.39.4.1 (colored) to branchpoint 1.39 (colored)

Sync with HEAD

Revision 1.41 / (download) - annotate - [select for diffs], Tue Aug 25 14:47:39 2015 UTC (7 years, 5 months ago) by pooka
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226, nick-nhusb-base-20150921
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

add ncpuonline

Revision 1.39.4.1 / (download) - annotate - [select for diffs], Sat Jun 6 14:40:29 2015 UTC (7 years, 8 months ago) by skrll
Branch: nick-nhusb
Changes since 1.39: +13 -5 lines
Diff to previous 1.39 (colored)

Sync with HEAD

Revision 1.40 / (download) - annotate - [select for diffs], Wed Apr 22 16:01:07 2015 UTC (7 years, 9 months ago) by pooka
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.39: +13 -5 lines
Diff to previous 1.39 (colored)

track cpu_onproc

Revision 1.28.2.3 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:41 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.28.2.2: +36 -7 lines
Diff to previous 1.28.2.2 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.36.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:56:51 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.36: +31 -2 lines
Diff to previous 1.36 (colored) next main 1.37 (colored)

Rebase.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jun 7 11:08:09 2014 UTC (8 years, 8 months ago) by rmind
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Branch point for: nick-nhusb
Changes since 1.38: +7 -3 lines
Diff to previous 1.38 (colored)

Make kpreempt_disabled() always return true in RUMP kernels for now.
May revisit once RUMP provides better splfoo/splx() handling.

Revision 1.38 / (download) - annotate - [select for diffs], Thu Jun 5 23:43:04 2014 UTC (8 years, 8 months ago) by rmind
Branch: MAIN
Changes since 1.37: +11 -2 lines
Diff to previous 1.37 (colored)

librump: add kpreempt_disabled(9) and softint_schedule_cpu(9).

Revision 1.27.2.4 / (download) - annotate - [select for diffs], Thu May 22 11:41:15 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.27.2.3: +31 -14 lines
Diff to previous 1.27.2.3 (colored) to branchpoint 1.27 (colored) next main 1.28 (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.34.2.1 / (download) - annotate - [select for diffs], Sun May 18 17:46:18 2014 UTC (8 years, 8 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.34: +25 -9 lines
Diff to previous 1.34 (colored) next main 1.35 (colored)

sync with head

Revision 1.37 / (download) - annotate - [select for diffs], Wed Apr 9 23:53:36 2014 UTC (8 years, 9 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base
Changes since 1.36: +18 -2 lines
Diff to previous 1.36 (colored)

implement lwp_create() and a few related interfaces.
main raison d'impalerment: the aio driver

Revision 1.36 / (download) - annotate - [select for diffs], Sat Mar 15 15:15:27 2014 UTC (8 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.35: +7 -7 lines
Diff to previous 1.35 (colored)

Allow compile-time optimizations to curlwp.  This can have a pretty
staggering impact on performance.  When running sendto() in a loop,
the improvement is 200k more calls per second with an inlined __thread
curlwp as opposed to the default.  In other words, it shaves off hundreds
of CPU cycles per call (~20%).  Even just eliminating the x86_curlwp()
call in favor of an inline gives an improvement of 60k calls per second.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Dec 9 19:47:59 2013 UTC (9 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored)

Reenable calls to KPREEMPT_EN/DISABLE().  I'm almost certain I commented
them out accidentally in rev 1.30.

... not that they do much in rump kernels which are always
run-to-completion, but maybe there's some driver debugging value.

Revision 1.28.2.2 / (download) - annotate - [select for diffs], Sun Jun 23 06:20:28 2013 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.28.2.1: +13 -12 lines
Diff to previous 1.28.2.1 (colored)

resync from head

Revision 1.34 / (download) - annotate - [select for diffs], Wed May 15 14:07:26 2013 UTC (9 years, 8 months ago) by pooka
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored)

Add RUMPUSER_LWP_CLEAR instead of overloading RUMPUSER_LWP_SET.
This simplifies some alternative hypervisor implementations.

Revision 1.33 / (download) - annotate - [select for diffs], Thu May 2 19:15:01 2013 UTC (9 years, 9 months ago) by pooka
Branch: MAIN
CVS Tags: khorben-n900
Changes since 1.32: +9 -8 lines
Diff to previous 1.32 (colored)

Inform the rump kernel hypervisor of valid thread contexts so
that the implementation can allocate and release storage for them
in an optimal fashion, if necessary.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Apr 27 22:26:57 2013 UTC (9 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.31: +4 -4 lines
Diff to previous 1.31 (colored)

Make sure spin mutexes get allocated as spin mutexes (the hypervisor
asserts it now).

Revision 1.31 / (download) - annotate - [select for diffs], Sat Apr 27 16:32:57 2013 UTC (9 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.30: +4 -4 lines
Diff to previous 1.30 (colored)

roll mutex init hypercalls into one (one of them already took a flag anyway)

Revision 1.27.2.3 / (download) - annotate - [select for diffs], Wed Jan 16 05:33:51 2013 UTC (10 years ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.27.2.2: +4 -6 lines
Diff to previous 1.27.2.2 (colored) to branchpoint 1.27 (colored)

sync with (a bit old) head

Revision 1.28.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:50 2012 UTC (10 years, 2 months ago) by tls
Branch: tls-maxphys
Changes since 1.28: +19 -15 lines
Diff to previous 1.28 (colored)

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

Revision 1.30 / (download) - annotate - [select for diffs], Tue Nov 13 20:10:02 2012 UTC (10 years, 2 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, agc-symver-base, agc-symver
Changes since 1.29: +4 -6 lines
Diff to previous 1.29 (colored)

kill some -Wunused-but-set-variable warnings

Revision 1.27.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:54 2012 UTC (10 years, 3 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.27.2.1: +23 -11 lines
Diff to previous 1.27.2.1 (colored) to branchpoint 1.27 (colored)

sync with head

Revision 1.29 / (download) - annotate - [select for diffs], Sat Sep 15 17:15:01 2012 UTC (10 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base6
Changes since 1.28: +17 -11 lines
Diff to previous 1.28 (colored)

In the "interlock" case (where the scheduler lock is used as the condvar
lock), we need to take the CPU interlock before releasing the CPU.
Otherwise other threads can be scheduled before we get the interlock,
leading to e.g. missed condvar wakeups.  This affected only "locks_up.c"
locking (nomen est omen?).

Also, remove various __predicts since they don't have a positive
performance impact in any setup.

Revision 1.27.8.1 / (download) - annotate - [select for diffs], Tue Jun 26 14:49:09 2012 UTC (10 years, 7 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-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Changes since 1.27: +8 -2 lines
Diff to previous 1.27 (colored) next main 1.28 (colored)

Pull up following revision(s) (requested by rmind in ticket #365):
	sys/rump/librump/rumpkern/rumpcpu_generic.c: revision 1.4
	sys/net/npf/npf_session.c: revision 1.13
	sys/net/npf/npf_tableset.c: revision 1.11
	sys/net/npf/npf_state_tcp.c: revision 1.7
	sys/net/npf/npf_inet.c: revision 1.12
	sys/net/npf/npf.h: revision 1.17
	sys/net/npf/npf_instr.c: revision 1.11
	usr.sbin/npf/npftest/libnpftest/npf_table_test.c: revision 1.2
	sys/net/npf/npf_state.c: revision 1.8
	sys/net/npf/npf_log.c: revision 1.4
	sys/net/npf/npf_alg.c: revision 1.4
	sys/rump/librump/rumpkern/Makefile.rumpkern: revision 1.118
	sys/net/npf/npf_nat.c: revision 1.13
	sys/net/npf/npf.c: revision 1.11
	sys/net/npf/npf_sendpkt.c: revision 1.11
	sys/net/npf/npf_impl.h: revision 1.16
	sys/rump/librump/rumpkern/scheduler.c: revision 1.28
rumpkern:
- Add subr_kcpuset.c and subr_pserialize.c modules.
- Add kcpuset_{running,attached} for RUMP env.
NPF:
- Rename some functions for consistency and de-inline them.
- Fix few invalid asserts (add regressoin test).
- Use pserialize(9) for ALG interface.
- Minor fixes, sprinkle many comments.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jun 22 12:45:43 2012 UTC (10 years, 7 months ago) by rmind
Branch: MAIN
Branch point for: tls-maxphys
Changes since 1.27: +8 -2 lines
Diff to previous 1.27 (colored)

rumpkern:
- Add subr_kcpuset.c and subr_pserialize.c modules.
- Add kcpuset_{running,attached} for RUMP env.

Revision 1.27.2.1 / (download) - annotate - [select for diffs], Wed Nov 30 14:36:36 2011 UTC (11 years, 2 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.27: +9 -2 lines
Diff to previous 1.27 (colored)

implement a rump version of kpreempt_disabled

Revision 1.27 / (download) - annotate - [select for diffs], Mon Oct 31 13:17:22 2011 UTC (11 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, netbsd-6
Changes since 1.26: +6 -2 lines
Diff to previous 1.26 (colored)

comment

Revision 1.24.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:10:08 2011 UTC (11 years, 8 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.24: +14 -7 lines
Diff to previous 1.24 (colored) next main 1.25 (colored)

Sync with HEAD.

Revision 1.9.6.3 / (download) - annotate - [select for diffs], Thu Apr 21 01:42:17 2011 UTC (11 years, 9 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.9.6.2: +1 -1 lines
Diff to previous 1.9.6.2 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

sync with head

Revision 1.26 / (download) - annotate - [select for diffs], Mon Mar 21 16:41:09 2011 UTC (11 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

Update copyright statements.

no functional change.

Revision 1.9.6.2 / (download) - annotate - [select for diffs], Sat Mar 5 20:56:15 2011 UTC (11 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.9.6.1: +93 -50 lines
Diff to previous 1.9.6.1 (colored) to branchpoint 1.9 (colored)

sync with head

Revision 1.24.4.1 / (download) - annotate - [select for diffs], Tue Feb 8 16:20:04 2011 UTC (12 years ago) by bouyer
Branch: bouyer-quota2
Changes since 1.24: +13 -6 lines
Diff to previous 1.24 (colored) next main 1.25 (colored)

Sync with HEAD

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jan 28 16:58:28 2011 UTC (12 years ago) by pooka
Branch: MAIN
CVS Tags: bouyer-quota2-nbase, bouyer-quota2-base
Changes since 1.24: +13 -6 lines
Diff to previous 1.24 (colored)

Some lwp-walkers expect the correct value for l_stat, so use a flag
in l_flag instead of l_stat for the purpose of flagging lwps in a
dying proc.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Jan 11 10:49:20 2011 UTC (12 years ago) by pooka
Branch: MAIN
CVS Tags: jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Changes since 1.23: +9 -4 lines
Diff to previous 1.23 (colored)

KASSERT we don't return back to userspace with the kernel lock held.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Dec 1 20:29:56 2010 UTC (12 years, 2 months ago) by pooka
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231
Changes since 1.22: +5 -2 lines
Diff to previous 1.22 (colored)

If the pagedaemon cannot free any memory due to not being able to
lock any uvm objects, check if lockholders are currently on CPU
and yield to try very soon again instead of assuming deadlock.

This makes limited-memory kernels perform the same as memory-unlimited
kernels (provided there is a reasonable amount of memory available).
For example, for large file copy off of ffs where the image is
backed on host memory (i.e. no disk i/o, i.e. ideal conditions)
the figures are, per rump kernel memory limit:

3000kB: same
1000kB: 10% slower
500kB:  50% slower

(per pagedaemon code might still be able to use some tweak, though)

Revision 1.22 / (download) - annotate - [select for diffs], Sun Nov 21 22:01:15 2010 UTC (12 years, 2 months ago) by pooka
Branch: MAIN
Changes since 1.21: +7 -5 lines
Diff to previous 1.21 (colored)

Fix situation where we try to configure >MAXCPUS cpus.

Revision 1.9.2.4 / (download) - annotate - [select for diffs], Sat Nov 6 08:08:51 2010 UTC (12 years, 3 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.9.2.3: +3 -3 lines
Diff to previous 1.9.2.3 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

Sync with HEAD.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Oct 29 15:32:24 2010 UTC (12 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base4
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

Attach implicit threads to initproc instead of proc0.  This way
applications which alter, by purpose or by accident, the uid in an
implicit thread are don't affect kernel threads.

from discussion with njoly

Revision 1.9.2.3 / (download) - annotate - [select for diffs], Fri Oct 22 07:22:50 2010 UTC (12 years, 3 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.9.2.2: +65 -41 lines
Diff to previous 1.9.2.2 (colored) to branchpoint 1.9 (colored)

Sync with HEAD (-D20101022).

Revision 1.9.4.4 / (download) - annotate - [select for diffs], Sat Oct 9 03:32:44 2010 UTC (12 years, 4 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9.4.3: +68 -43 lines
Diff to previous 1.9.4.3 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

sync with head

Revision 1.20 / (download) - annotate - [select for diffs], Tue Sep 7 07:59:48 2010 UTC (12 years, 5 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, uebayasi-xip-base3
Changes since 1.19: +8 -6 lines
Diff to previous 1.19 (colored)

Attach only one CPU for the bootstrap phase.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Sep 1 19:37:59 2010 UTC (12 years, 5 months ago) by pooka
Branch: MAIN
Changes since 1.18: +61 -39 lines
Diff to previous 1.18 (colored)

Implement rump_lwproc: the new lwp/proc management routines for
rump.  These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.

Revision 1.9.2.2 / (download) - annotate - [select for diffs], Tue Aug 17 06:48:02 2010 UTC (12 years, 5 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.9.2.1: +225 -77 lines
Diff to previous 1.9.2.1 (colored) to branchpoint 1.9 (colored)

Sync with HEAD.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Aug 15 20:23:04 2010 UTC (12 years, 5 months ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base2
Changes since 1.17: +3 -2 lines
Diff to previous 1.17 (colored)

Increment lwp's context switch counter when it is scheduled onto
a CPU.  This fixes some heavy-load problems with the pool code when
rump kernels essentially lied and caused the pool code not to do
a proper backdown from the fastpath when a context switch happened
when taking a lock.

Revision 1.9.4.3 / (download) - annotate - [select for diffs], Wed Aug 11 22:55:07 2010 UTC (12 years, 5 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9.4.2: +295 -82 lines
Diff to previous 1.9.4.2 (colored) to branchpoint 1.9 (colored)

sync with head.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jul 11 16:20:39 2010 UTC (12 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base10
Changes since 1.16: +3 -2 lines
Diff to previous 1.16 (colored)

Assert that l_target_cpu isn't null, just in case we had some memory
corruption issues (like passing wrong size to kmem_free ....).

Revision 1.9.6.1 / (download) - annotate - [select for diffs], Sun May 30 05:18:06 2010 UTC (12 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.9: +294 -82 lines
Diff to previous 1.9 (colored)

sync with head

Revision 1.16 / (download) - annotate - [select for diffs], Fri May 28 18:17:24 2010 UTC (12 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored)

Deal with the "we get a portably arbitrary set of headers on
different archs" problem.

Revision 1.15 / (download) - annotate - [select for diffs], Fri May 28 16:44:14 2010 UTC (12 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.14: +189 -83 lines
Diff to previous 1.14 (colored)

Improve the CPU scheduler for a host MP system with multithreaded
access.  The old scheduler had a global freelist which caused a
cache crisis with multiple host threads trying to schedule a virtual
CPU simultaneously.

The rump scheduler is different from a normal thread scheduler, so
it has different requirements.  First, we schedule a CPU for a
thread (which we get from the host scheduler) instead of scheduling
a thread onto a CPU.  Second, scheduling points are at every
entry/exit to/from the rump kernel, including (but not limited to)
syscall entry points and hypercalls.  This means scheduling happens
a lot more frequently than in a normal kernel.

For every lwp, cache the previously used CPU.  When scheduling,
attempt to reuse the same CPU.  If we get it, we can use it directly
without any memory barriers or expensive locks.  If the CPU is
taken, migrate.  Use a lock/wait only in the slowpath.  Be very
wary of walking the entire CPU array because that does not lead to
a happy cacher.

The migration algorithm could probably benefit from improved
heuristics and tuning.  Even as such, with the new scheduler an
application which has two threads making rlimit syscalls in a tight
loop experiences almost 400% speedup.  The exact speedup is difficult
to pinpoint, though, since the old scheduler caused very jittery
results due to cache contention.  Also, the rump version is now
70% faster than the counterpart which calls the host kernel.

Revision 1.14 / (download) - annotate - [select for diffs], Tue May 18 14:58:42 2010 UTC (12 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.13: +45 -6 lines
Diff to previous 1.13 (colored)

Make it possible to use the scheduler lock as the rumpuser condvar
interlock.  This is applicable in cases where the actual interlock
is the CPU the currently running thread is scheduled on.  Borrowing
the scheduler lock as the mutex mandated by pthread_cond_wait()
does away with need to have an additional mutex.  This both optimizes
runtime execution and simplifies code, as the extra lock typically
lead to quite some trickeries to avoid the dungeon collapsing due
to zaps from the wand of deadlock.

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:44:30 2010 UTC (12 years, 9 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.9: +71 -5 lines
Diff to previous 1.9 (colored)

Sync with HEAD.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Apr 28 00:42:16 2010 UTC (12 years, 9 months ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base1
Changes since 1.12: +8 -2 lines
Diff to previous 1.12 (colored)

Limit virtual CPUs to MAXCPUS for now.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Apr 27 23:30:30 2010 UTC (12 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.11: +21 -5 lines
Diff to previous 1.11 (colored)

Fix multiple virtual cpu support.

... or at least on x86.  CPU_INFO_FOREACH() still isn't MI, and I
don't want to support 2^n different versions.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Apr 21 16:16:31 2010 UTC (12 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.10: +9 -2 lines
Diff to previous 1.10 (colored)

support kern_resource

Revision 1.10 / (download) - annotate - [select for diffs], Sat Apr 17 13:13:45 2010 UTC (12 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.9: +39 -2 lines
Diff to previous 1.9 (colored)

Move scheduling related routines from emul.c to scheduler.c

Revision 1.9.4.2 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:38 2010 UTC (12 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9.4.1: +271 -0 lines
Diff to previous 1.9.4.1 (colored) to branchpoint 1.9 (colored)

sync with head

Revision 1.9.4.1, Mon Jan 25 18:37:51 2010 UTC (13 years ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.9: +0 -271 lines
FILE REMOVED

file scheduler.c was added on branch yamt-nfs-mp on 2010-03-11 15:04:38 +0000

Revision 1.9 / (download) - annotate - [select for diffs], Mon Jan 25 18:37:51 2010 UTC (13 years ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base
Branch point for: yamt-nfs-mp, uebayasi-xip, rmind-uvmplock
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

Set attached cpus as running, otherwise (evil) state-probing code
will not execute properly.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Dec 1 09:50:51 2009 UTC (13 years, 2 months ago) by pooka
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.7: +72 -18 lines
Diff to previous 1.7 (colored)

Almost there for virtual CPU MP support:
* support bound kernel threads
* bind softint threads to specific virtual cpus
  + remove now-unnecessary locks from softint code

Now, if we only had MI CPU_INFO_FOREACH() .... (hi rmind ;)

Revision 1.7 / (download) - annotate - [select for diffs], Mon Nov 9 19:16:18 2009 UTC (13 years, 2 months ago) by pooka
Branch: MAIN
Changes since 1.6: +5 -2 lines
Diff to previous 1.6 (colored)

Hash out soft interrupts to be a little closer to real softints:
  * split them into levels
  * allow only one per level to be active at a time
  * fire softints only when we are unscheduling from a CPU instead
    of immediately in softint_schedule().  this will later morph
    into return from interrupt, but that part isn't done yet.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Nov 6 16:15:16 2009 UTC (13 years, 3 months ago) by pooka
Branch: MAIN
Changes since 1.5: +25 -3 lines
Diff to previous 1.5 (colored)

In case a temp thread is exiting, borrow lwp0 for the respective
kmem_free().

Revision 1.5 / (download) - annotate - [select for diffs], Wed Nov 4 18:11:11 2009 UTC (13 years, 3 months ago) by pooka
Branch: MAIN
Changes since 1.4: +22 -2 lines
Diff to previous 1.4 (colored)

Implement yield()/preempt() now that there is a CPU scheduler.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Oct 16 00:14:53 2009 UTC (13 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.3: +13 -12 lines
Diff to previous 1.3 (colored)

Include sys_select.c for proper select()/poll() support.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Oct 15 23:15:55 2009 UTC (13 years, 3 months ago) by pooka
Branch: MAIN
Changes since 1.2: +39 -11 lines
Diff to previous 1.2 (colored)

When allocating the temporary lwp we must have an lwp context.  So
take turns using lwp0 for this purpose, nothing else uses it.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Oct 15 16:39:22 2009 UTC (13 years, 3 months ago) by pooka
Branch: MAIN
Changes since 1.1: +33 -7 lines
Diff to previous 1.1 (colored)

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp.  Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes.  Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Oct 15 00:28:46 2009 UTC (13 years, 3 months ago) by pooka
Branch: MAIN

Add initial work on a rump virtual cpu scheduler.  This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump.  Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation.  As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks.  If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.

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>