The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.70 / (download) - annotate - [select for diffs], Tue Sep 19 22:15:32 2023 UTC (6 months, 3 weeks ago) by ad
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored) to selected 1.39 (colored)

Fix a comment.

Revision 1.69 / (download) - annotate - [select for diffs], Sat May 23 21:24:41 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, netbsd-10-base, netbsd-10-0-RELEASE, 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, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.68: +27 -5 lines
Diff to previous 1.68 (colored) to selected 1.39 (colored)

Oops.  If a SCHED_RR thread is preempted and has exceeded its timeslice it
needs to go to the back of the run queue so round-robin actually happens,
otherwise it should go to the front.

Revision 1.68 / (download) - annotate - [select for diffs], Sat May 23 21:14:55 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.67: +9 -3 lines
Diff to previous 1.67 (colored) to selected 1.39 (colored)

sched_bestcpu(): There is a fallback CPU, in case the user manages to set
the system up so no CPU is permitted to run a given LWP.  Fix a bug where
that fallback CPU would sometimes get picked even if there was another CPU
that could legitimately run the LWP.

Revision 1.67 / (download) - annotate - [select for diffs], Mon Apr 13 16:09:21 2020 UTC (4 years ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Changes since 1.66: +14 -9 lines
Diff to previous 1.66 (colored) to selected 1.39 (colored)

Use relaxed atomics on spc_mcount.

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

hardclock_ticks -> getticks()

Revision 1.65 / (download) - annotate - [select for diffs], Sat Apr 4 20:17:58 2020 UTC (4 years ago) by ad
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.64: +31 -23 lines
Diff to previous 1.64 (colored) to selected 1.39 (colored)

- sched_idle(): if a migration took place, rather than going idle briefly
  to avoid stealing back the LWP, remember the target CPU and avoid it.

- sched_preempted(): only choose a totally idle CPU; in the interests of
  overall throughput it's better to make use of SMT / slow CPUs.

Revision 1.64 / (download) - annotate - [select for diffs], Thu Mar 26 19:25:07 2020 UTC (4 years ago) by ad
Branch: MAIN
Changes since 1.63: +4 -9 lines
Diff to previous 1.63 (colored) to selected 1.39 (colored)

sched_curcpu_runnable_p(): cosmetic change.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Mar 8 15:00:31 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
Changes since 1.62: +3 -2 lines
Diff to previous 1.62 (colored) to selected 1.39 (colored)

sched_preempted(): always clear LP_TELEPORT.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Jan 25 15:09:54 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3, ad-namecache-base2
Changes since 1.61: +4 -4 lines
Diff to previous 1.61 (colored) to selected 1.39 (colored)

sched_takecpu(): for vfork(), when looking at curcpu's runqueue consider
maximum priority waiting to run and not count of LWPs.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Jan 18 13:53:50 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.60: +9 -7 lines
Diff to previous 1.60 (colored) to selected 1.39 (colored)

sched_bestcpu(): break out of the loop earlier.

Revision 1.60 / (download) - annotate - [select for diffs], Fri Jan 17 20:27:28 2020 UTC (4 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base1
Changes since 1.59: +7 -7 lines
Diff to previous 1.59 (colored) to selected 1.39 (colored)

sched_catchlwp(): fix an inverted test that could have caused performance
degradation.

Revision 1.59 / (download) - annotate - [select for diffs], Mon Jan 13 11:53:24 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.58: +20 -14 lines
Diff to previous 1.58 (colored) to selected 1.39 (colored)

- Fix an inverted test that could have prevented LWPs running on helper
  CPUs to teleport somewhere better during preempt().

- Fix a comment.

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jan 12 22:03:22 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.57: +248 -250 lines
Diff to previous 1.57 (colored) to selected 1.39 (colored)

A final set of scheduler tweaks:

- Try hard to keep vfork() parent and child on the same CPU until execve(),
  failing that on the same core, but in all other cases scatter new LWPs
  among the different CPU packages, round robin, to try and get the best out
  of the available cache and bus bandwidth.

- Remove attempts at balancing.  Replace with a rate-limited skim of other
  CPU's run queues in sched_idle(), starting in the current package and
  moving outwards.  Add a sysctl tunable to change the interval.

- Make the cacheht_time tuneable take a milliseconds value.

- It's possible to configure things such that there's no CPU allowed to run
  an LWP.  Defeat this by always having a default:

Reported-by: syzbot+46968944dd9359ab93bc@syzkaller.appspotmail.com
Reported-by: syzbot+7f750a4cc230d1e831f9@syzkaller.appspotmail.com
Reported-by: syzbot+88d7675158f5cb4684db@syzkaller.appspotmail.com
Reported-by: syzbot+d409c2338150e9a8ae1e@syzkaller.appspotmail.com
Reported-by: syzbot+e152dc5bff188f67358a@syzkaller.appspotmail.com

Revision 1.57 / (download) - annotate - [select for diffs], Thu Jan 9 16:35:03 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.56: +221 -94 lines
Diff to previous 1.56 (colored) to selected 1.39 (colored)

- Many small tweaks to the SMT awareness in the scheduler.  It does a much
  better job now at keeping all physical CPUs busy, while using the extra
  threads to help out.  In particular, during preempt() if we're using SMT,
  try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems.  This
  mainly entails rearranging one of the CPU lists so it makes sense in all
  configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
  where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
  Extend the SMT awareness to try and handle that situation too (keep fast
  CPUs busy, use slow CPUs as helpers).

Revision 1.56 / (download) - annotate - [select for diffs], Wed Jan 8 17:38:42 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.55: +2 -13 lines
Diff to previous 1.55 (colored) to selected 1.39 (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.55 / (download) - annotate - [select for diffs], Sun Jan 5 20:26:56 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base
Branch point for: ad-namecache
Changes since 1.54: +34 -37 lines
Diff to previous 1.54 (colored) to selected 1.39 (colored)

- Another tweak for SMT: if a new LWP is starting life, try to make it run
  on a different CPU in the same CPU core as the parent, because both parent
  and child share lots of state.  (I want to come back later and do
  something different for _lwp_create() and maybe execve().)

- Remove the runqueue evcnts, which are racy and impose a penalty for very
  little payoff.

- Break out of the loop in sched_takecpu() as soon as we have a CPU that can
  run the LWP.  There's no need to look at all CPUs.

- SPCF_IDLE in sched_enqueue() so we know the CPU is not idle sooner.

Revision 1.54 / (download) - annotate - [select for diffs], Sat Jan 4 22:46:01 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.53: +100 -19 lines
Diff to previous 1.53 (colored) to selected 1.39 (colored)

A couple of scheduler tweaks which benchmark well for me:

- Add some simple SMT awareness.  Try to keep as many different cores loaded
  up with jobs as possible before we start to make use of SMT.  Have SMT
  "secondaries" function more as helpers to their respective primaries.
  This isn't enforced, it's an effort at herding/encouraging things to go in
  the right direction (for one because we support processor sets and those
  can be configured any way that you like).  Seen at work with "top -1".

- Don't allow sched_balance() to run any faster than the clock interrupt,
  because it causes terrible cache contention.  Need to look into this in
  more detail because it's still not ideal.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Dec 3 22:28:41 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.52: +75 -152 lines
Diff to previous 1.52 (colored) to selected 1.39 (colored)

- Add some more failsafes to the CPU topology stuff, and build a 3rd
  circular list of peer CPUs in other packages, so we might scroll through
  them in the scheduler when looking to distribute or steal jobs.

- Fold the run queue data structure into spc_schedstate.  Makes kern_runq.c
  a far more pleasant place to work.

- Remove the code in sched_nextlwp() that tries to steal jobs from other
  CPUs.  It's not needed, because we do the very same thing in the idle LWP
  anyway.  Outside the VM system this was one of the the main causes of L3
  cache misses I saw during builds.  On my machine, this change yields a
  60%-70% drop in time on the "hackbench" benchmark (there's clearly a bit
  more going on here, but basically being less aggressive helps).

Revision 1.52 / (download) - annotate - [select for diffs], Sun Dec 1 15:34:46 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored) to selected 1.39 (colored)

Fix false sharing problems with cpu_info.  Identified with tprof(8).
This was a very nice win in my tests on a 48 CPU box.

- Reorganise cpu_data slightly according to usage.
- Put cpu_onproc into struct cpu_info alongside ci_curlwp (now is ci_onproc).
- On x86, put some items in their own cache lines according to usage, like
  the IPI bitmask and ci_want_resched.

Revision 1.51 / (download) - annotate - [select for diffs], Sun Dec 1 13:20:42 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.50: +4 -9 lines
Diff to previous 1.50 (colored) to selected 1.39 (colored)

PR port-sparc/54718 (sparc install hangs since recent scheduler changes)

- sched_tick: cpu_need_resched is no longer the correct thing to do here.
  All we need to do is OR the request into the local ci_want_resched.

- sched_resched_cpu: we need to set RESCHED_UPREEMPT even on softint LWPs,
  especially in the !__HAVE_FAST_SOFTINTS case, because the LWP with the
  LP_INTR flag could be running via softint_overlay() - i.e. it has been
  temporarily borrowed from a user process, and it needs to notice the
  resched after it has stopped running softints.

Revision 1.50 / (download) - annotate - [select for diffs], Wed Nov 27 20:31:13 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored) to selected 1.39 (colored)

Don't try to IPI other CPUs early on.  Fixes a crash on sparc64.  Thanks
to martin@ for diagnosing.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Nov 23 22:35:08 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.48: +3 -2 lines
Diff to previous 1.48 (colored) to selected 1.39 (colored)

Pull in sys/atomic.h.

Revision 1.48 / (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.47: +192 -45 lines
Diff to previous 1.47 (colored) to selected 1.39 (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.47 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:13 2017 UTC (6 years, 10 months ago) by chs
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, phil-wifi-20191119, phil-wifi-20190609, 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, 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, isaki-audio2-base, isaki-audio2
Branch point for: phil-wifi
Changes since 1.46: +2 -5 lines
Diff to previous 1.46 (colored) to selected 1.39 (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.46 / (download) - annotate - [select for diffs], Thu Dec 22 14:11:58 2016 UTC (7 years, 3 months ago) by mlelstv
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, nick-nhusb-base-20170204, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.45: +25 -5 lines
Diff to previous 1.45 (colored) to selected 1.39 (colored)

When balancing threads over multiple CPUs, use fixpoint arithmetic
for averages. Otherwise the decisions can be heavily biased by rounding
errors.

Add sysctl kern.sched_average_weight to change the weight of
historical data, the default is 50%.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jul 7 06:55:43 2016 UTC (7 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-localcount-base, 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.44: +3 -3 lines
Diff to previous 1.44 (colored) to selected 1.39 (colored)

KNF. Remove extra spaces. No functional change.

Revision 1.44 / (download) - annotate - [select for diffs], Wed Oct 7 00:32:34 2015 UTC (8 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.43: +11 -2 lines
Diff to previous 1.43 (colored) to selected 1.39 (colored)

provide curthread for dtrace

Revision 1.43 / (download) - annotate - [select for diffs], Sun Aug 3 19:14:24 2014 UTC (9 years, 8 months ago) by wiz
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, 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
Branch point for: nick-nhusb, netbsd-7
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored) to selected 1.39 (colored)

defintion -> definition

Revision 1.42 / (download) - annotate - [select for diffs], Tue Feb 25 18:30:11 2014 UTC (10 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.41: +2 -7 lines
Diff to previous 1.41 (colored) to selected 1.39 (colored)

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Nov 24 21:58:38 2013 UTC (10 years, 4 months ago) by rmind
Branch: MAIN
Changes since 1.40: +12 -9 lines
Diff to previous 1.40 (colored) to selected 1.39 (colored)

Remove cpu_queue (and thus eleminate another use of CIRCLEQ) by replacing
its uses with cpu_infos array.  Extra testing by christos@.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Oct 19 19:22:16 2013 UTC (10 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)

remove __unused now that it is used.

Revision 1.39 / (download) - annotate - [selected], Sat Oct 19 18:42:05 2013 UTC (10 years, 5 months ago) by martin
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored)

cpu_need_resched(ci, type) might not make use of the type argument - mark
the variable declaration accordingly.

Revision 1.38 / (download) - annotate - [select for diffs], Tue Mar 12 23:16:31 2013 UTC (11 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.37: +4 -16 lines
Diff to previous 1.37 (colored) to selected 1.39 (colored)

revert rev.1.37 for now.

PR/47634 from Ryo ONODERA.
while i have no idea how this change can break bge,
i don't have hardware and/or time to investigate right now.

Revision 1.37 / (download) - annotate - [select for diffs], Wed Mar 6 11:25:01 2013 UTC (11 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.36: +16 -4 lines
Diff to previous 1.36 (colored) to selected 1.39 (colored)

- use scaled calculations for avgcount
- sched_balance: account lwp which is currently running
- sched_balance: skip cpus w/o migratable lwps

Revision 1.36 / (download) - annotate - [select for diffs], Sat Feb 9 00:31:21 2013 UTC (11 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.35: +3 -4 lines
Diff to previous 1.35 (colored) to selected 1.39 (colored)

printflike maintenance.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Aug 30 02:25:35 2012 UTC (11 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.34: +5 -3 lines
Diff to previous 1.34 (colored) to selected 1.39 (colored)

Change KASSERT to KASSERTMSG

Revision 1.34 / (download) - annotate - [select for diffs], Thu Feb 23 12:24:05 2012 UTC (12 years, 1 month ago) by para
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base10
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored) to selected 1.39 (colored)

change sched_upreempt_pri default to 0 as discussed on tech-kern@
should improve interactive performance on SMP machines
as user preemption happens immediately in x-cpu wakeup case now

Revision 1.33 / (download) - annotate - [select for diffs], Fri Dec 2 12:31:03 2011 UTC (12 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: netbsd-6-base, 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, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base2, jmcneill-usbmp-base
Branch point for: netbsd-6, jmcneill-usbmp
Changes since 1.32: +10 -2 lines
Diff to previous 1.32 (colored) to selected 1.39 (colored)

comments

Revision 1.32 / (download) - annotate - [select for diffs], Sun Aug 7 21:13:05 2011 UTC (12 years, 8 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache
Changes since 1.31: +6 -6 lines
Diff to previous 1.31 (colored) to selected 1.39 (colored)

Remove LW_AFFINITY flag and fix some bugs affinity mask handling.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Aug 7 13:33:01 2011 UTC (12 years, 8 months ago) by rmind
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored) to selected 1.39 (colored)

Add kcpuset(9) - a reworked dynamic CPU set implementation for kernel.
Suitable for use during the early boot.  MD and other implementations
should be replaced with this interface.

Discussed on: tech-kern@

Revision 1.30 / (download) - annotate - [select for diffs], Wed Mar 3 00:47:30 2010 UTC (14 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, rmind-uvmplock-nbase, rmind-uvmplock-base, rmind-uvmplock, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.29: +2 -4 lines
Diff to previous 1.29 (colored) to selected 1.39 (colored)

remove redundant checks of PK_MARKER.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jan 13 01:57:17 2010 UTC (14 years, 3 months ago) by mrg
Branch: MAIN
CVS Tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Changes since 1.28: +6 -10 lines
Diff to previous 1.28 (colored) to selected 1.39 (colored)

introduce a new function that returns a unique string for each cpu:

	char *cpu_name(struct cpu_info *);

and use it when setting up the runq event counters, avoiding an 8 byte
kmem(4) allocation for each cpu.  there are more places the cpuname is
used that can be converted to using this new interface, but that can
and will be done as future work.

as discussed with rmind.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Dec 30 23:49:59 2009 UTC (14 years, 3 months ago) by rmind
Branch: MAIN
Changes since 1.27: +13 -2 lines
Diff to previous 1.27 (colored) to selected 1.39 (colored)

sched_catchlwp: fix the case when other CPU might see curlwp->l_cpu != curcpu()
while LWP is finishing context switch.  Should fix PR/42539, tested by martin@.

Revision 1.27 / (download) - annotate - [select for diffs], Wed Oct 21 21:12:06 2009 UTC (14 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase
Changes since 1.26: +4 -4 lines
Diff to previous 1.26 (colored) to selected 1.39 (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.26 / (download) - annotate - [select for diffs], Mon Mar 2 21:17:29 2009 UTC (15 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, jymxensuspend-base, jym-xensuspend-base
Changes since 1.25: +7 -3 lines
Diff to previous 1.25 (colored) to selected 1.39 (colored)

If DEBUG is enabled, drop kpreempt_pri to zero. It means that every
wakeup will cause a kernel preemption, simulating massive concurrency.

Proposed on tech-kern@.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Feb 17 22:00:14 2009 UTC (15 years, 2 months ago) by rmind
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored) to selected 1.39 (colored)

Make sched_getrq() inline (gcc does not optimize it), avoids call.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Jan 18 05:07:51 2009 UTC (15 years, 3 months ago) by rmind
Branch: MAIN
Branch point for: jym-xensuspend
Changes since 1.23: +37 -24 lines
Diff to previous 1.23 (colored) to selected 1.39 (colored)

- Avoid calling sched_catchlwp() if CPUs have different processor-sets.
- sched_takecpu: check for psid earlier (be more strict).

PR/40419.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Dec 2 17:57:32 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored) to selected 1.39 (colored)

- Wrap sys/cpu.h contents in _LOCORE.
- Add a RESCHED_LAZY flag and use instead of zero.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Oct 7 09:48:27 2008 UTC (15 years, 6 months ago) by rmind
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, netbsd-5-base, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.21: +7 -4 lines
Diff to previous 1.21 (colored) to selected 1.39 (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.21 / (download) - annotate - [select for diffs], Tue Sep 30 16:28:45 2008 UTC (15 years, 6 months ago) by rmind
Branch: MAIN
Changes since 1.20: +10 -11 lines
Diff to previous 1.20 (colored) to selected 1.39 (colored)

- Schedule bound threads even if CPU is offline.  Might be revisited later,
  when decision what to do with already bound threads will be made.
- Do not allow to assign offline CPU to the processor-set.

Quick fix for PR/39349.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jul 14 01:18:10 2008 UTC (15 years, 9 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.19: +6 -5 lines
Diff to previous 1.19 (colored) to selected 1.39 (colored)

sched_migratable: add KASSERT since this function cannot be called
without lock held now.  Few cosmetic changes, while here.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jun 22 00:06:36 2008 UTC (15 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-1, wrstuden-revivesa-base
Branch point for: haad-dm
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored) to selected 1.39 (colored)

Adjust to separate kcpuset_t and cpuset_t.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jun 16 01:41:20 2008 UTC (15 years, 10 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pf42-base4
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored) to selected 1.39 (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.17 / (download) - annotate - [select for diffs], Sun Jun 15 20:32:57 2008 UTC (15 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored) to selected 1.39 (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.16 / (download) - annotate - [select for diffs], Fri May 30 12:18:14 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base3
Branch point for: simonb-wapbl, mjf-devfs2
Changes since 1.15: +3 -4 lines
Diff to previous 1.15 (colored) to selected 1.39 (colored)

PR kern/38663 Kernel preemption can't be enabled on x86 because of amd64
FPU handling

Remove ifdef(i386), kernel preemption works on amd64 now.

Revision 1.15 / (download) - annotate - [select for diffs], Fri May 30 08:31:42 2008 UTC (15 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored) to selected 1.39 (colored)

sched_idle: initialise 'tci' to NULL, avoids compiler warning.

Revision 1.14 / (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.13: +97 -25 lines
Diff to previous 1.13 (colored) to selected 1.39 (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.13 / (download) - annotate - [select for diffs], Tue May 27 22:05:50 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored) to selected 1.39 (colored)

Pull in sys/evcnt.h.

Revision 1.12 / (download) - annotate - [select for diffs], Tue May 27 21:36:03 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.11: +4 -3 lines
Diff to previous 1.11 (colored) to selected 1.39 (colored)

#ifdef strikes again

Revision 1.11 / (download) - annotate - [select for diffs], Tue May 27 19:05:52 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.10: +108 -80 lines
Diff to previous 1.10 (colored) to selected 1.39 (colored)

Sigh. The previous change did bad things to MySQL sysbench. Continue stealing
jobs from sched_nextlwp, but also do it in the idle loop. In sched_nextlwp
use trylock, in the idle LWP try harder.

Revision 1.10 / (download) - annotate - [select for diffs], Tue May 27 14:48:52 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.9: +121 -85 lines
Diff to previous 1.9 (colored) to selected 1.39 (colored)

PR kern/38707 scheduler related deadlock during build.sh

- Fix performance regression inroduced by the workaround by making job
  stealing a lot simpler: if the local run queue is empty, let the CPU enter
  the idle loop. In the idle loop, try to steal a job from another CPU's run
  queue if we are idle. If we succeed, re-enter mi_switch() immediatley to
  dispatch the job.

- When stealing jobs, consider a remote CPU to have one less job in its
  queue if it's currently in the idle loop. It will dispatch the job soon,
  so there's no point sloshing it about.

- Introduce a few event counters to monitor what's happening with the run
  queues.

- Revert the idle CPU bitmap change. It's pointless considering NUMA.

Revision 1.9 / (download) - annotate - [select for diffs], Sun May 25 23:46:55 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.8: +3 -27 lines
Diff to previous 1.8 (colored) to selected 1.39 (colored)

PR kern/38707 scheduler related deadlock during build.sh

Fail sched_catchlwp() if mutex_tryenter() on the remote CPU's state fails.
Seems to work around the issue described in this PR.

XXX Stealing jobs from remote CPUs could probably be moved into the idle
loop, making the locking quite a bit simpler.

Revision 1.8 / (download) - annotate - [select for diffs], Wed May 21 15:41:03 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored) to selected 1.39 (colored)

PR kern/38663 Kernel preemption can't be enabled on x86 because of amd64
FPU handling

Ugly hack until the amd64 fpu handling is working (which should be soon):
enable kernel preemption on i386.

Revision 1.7 / (download) - annotate - [select for diffs], Tue May 20 19:21:23 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.6: +25 -1 lines
Diff to previous 1.6 (colored) to selected 1.39 (colored)

Back out unintentional change.

Revision 1.6 / (download) - annotate - [select for diffs], Tue May 20 19:20:38 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.5: +3 -27 lines
Diff to previous 1.5 (colored) to selected 1.39 (colored)

If autoloading a module, don't consider the current working directory.

Revision 1.5 / (download) - annotate - [select for diffs], Mon May 19 17:06:02 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: hpcarm-cleanup-nbase
Changes since 1.4: +2 -5 lines
Diff to previous 1.4 (colored) to selected 1.39 (colored)

Reduce ifdefs due to MULTIPROCESSOR slightly.

Revision 1.4 / (download) - annotate - [select for diffs], Mon May 19 12:48:54 2008 UTC (15 years, 11 months ago) by rmind
Branch: MAIN
Changes since 1.3: +58 -7 lines
Diff to previous 1.3 (colored) to selected 1.39 (colored)

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

Revision 1.3 / (download) - annotate - [select for diffs], Wed Apr 30 09:17:12 2008 UTC (15 years, 11 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-pf42-base, yamt-nfs-mp-base2
Branch point for: yamt-pf42, yamt-nfs-mp, wrstuden-revivesa
Changes since 1.2: +5 -5 lines
Diff to previous 1.2 (colored) to selected 1.39 (colored)

Set minimal count of LWPs for catching to 1, and cache-hotness time to ~3ms

Revision 1.2 / (download) - annotate - [select for diffs], Tue Apr 29 15:51:23 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.1: +4 -2 lines
Diff to previous 1.1 (colored) to selected 1.39 (colored)

Ignore processes with PK_MARKER set.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Apr 29 14:35:20 2008 UTC (15 years, 11 months ago) by rmind
Branch: MAIN
Diff to selected 1.39 (colored)

Split the runqueue management code into the separate file.
OK by <ad>.

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>