The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.27 / (download) - annotate - [select for diffs], Wed Oct 26 23:38:57 2022 UTC (3 months ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.26: +2 -5 lines
Diff to previous 1.26 (colored)

sys/pcu.h: New home for extern pcu_ops_md_defs.

XXX Should split sys/pcu.h up into the part that sys/lwp.h needs,
which triggers rebuild of entire kernel, and the parts needed only by
subr_pcu.c and by MD FP/SIMD state management logic.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Feb 8 12:59:16 2022 UTC (11 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

kern: Mark some functions __diagused to pacify clang.

These functions are called only in KASSERT.  This shouldn't be a
problem since the recent change to make KASSERT compile (but not run)
the expression, via sizeof, so the functions are referenced -- which
I did in order to avoid having #ifdefs and regular build breakage
because someone forgot to build with or without DIAGNOSTIC.  But
apparently clang decided to make it a problem.

Maybe we should just set -Wno-unneeded-internal-declaration -- not
clear it flags any real problems, but it takes effort to research
because apparently clang has no documentation about what else it does
or why anyone decided this is objectionable enough to turn it on by
default.  (The only documentation it seems to have, two example
warning messages with no elaboration at
<https://releases.llvm.org/13.0.0/tools/clang/docs/DiagnosticsReference.html#wunneeded-internal-declaration>,
seems to indicate it is mixed up with warning about static non-inline
functions in header files.)

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 1 15:10:53 2022 UTC (12 months, 4 weeks ago) by christos
Branch: MAIN
Changes since 1.24: +2 -4 lines
Diff to previous 1.24 (colored)

Always declare function used in KASSERT

Revision 1.24 / (download) - annotate - [select for diffs], Fri Aug 7 18:46:00 2020 UTC (2 years, 5 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-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.23: +4 -2 lines
Diff to previous 1.23 (colored)

pcu_available_p is only used in KASSERT(), fix non-diagnostic build.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Aug 1 02:05:45 2020 UTC (2 years, 5 months ago) by riastradh
Branch: MAIN
Changes since 1.22: +15 -4 lines
Diff to previous 1.22 (colored)

Teach pcu(9) about LW_SYSTEM_FPU -- kthreads with fpu enabled.

Revision 1.20.6.2 / (download) - annotate - [select for diffs], Sun Jun 7 17:08:12 2020 UTC (2 years, 7 months ago) by martin
Branch: netbsd-8
Changes since 1.20.6.1: +8 -3 lines
Diff to previous 1.20.6.1 (colored) to branchpoint 1.20 (colored) next main 1.21 (colored)

Pull up following revision(s) (requested by thorpej in ticket #949):

	sys/kern/subr_pcu.c: revision 1.22

Relax the KASSERT() in pcu_discard_all() to allow non-curlwp if it is
in LSIDL state, which can happen if the new LWP is exiting before it's
ever run, e.g. if an error occurs in _lwp_create(2).

Revision 1.21.8.1 / (download) - annotate - [select for diffs], Sun Jun 7 17:07:07 2020 UTC (2 years, 7 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Changes since 1.21: +8 -3 lines
Diff to previous 1.21 (colored) next main 1.22 (colored)

Pull up following revision(s) (requested by thorpej in ticket #949):

	sys/kern/subr_pcu.c: revision 1.22

Relax the KASSERT() in pcu_discard_all() to allow non-curlwp if it is
in LSIDL state, which can happen if the new LWP is exiting before it's
ever run, e.g. if an error occurs in _lwp_create(2).

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jun 6 18:13:01 2020 UTC (2 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.21: +8 -3 lines
Diff to previous 1.21 (colored)

Relax the KASSERT() in pcu_discard_all() to allow non-curlwp if it is
in LSIDL state, which can happen if the new LWP is exiting before it's
ever run, e.g. if an error occurs in _lwp_create(2).

Revision 1.12.2.3 / (download) - annotate - [select for diffs], Sun Dec 3 11:38:45 2017 UTC (5 years, 1 month ago) by jdolecek
Branch: tls-maxphys
Changes since 1.12.2.2: +7 -9 lines
Diff to previous 1.12.2.2 (colored) to branchpoint 1.12 (colored) next main 1.13 (colored)

update from HEAD

Revision 1.20.6.1 / (download) - annotate - [select for diffs], Tue Oct 24 09:14:59 2017 UTC (5 years, 3 months ago) by snj
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, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.20: +4 -3 lines
Diff to previous 1.20 (colored)

Pull up following revision(s) (requested by bouyer in ticket #326):
	sys/arch/arm/vfp/vfp_init.c: revision 1.54-1.55
	sys/kern/subr_pcu.c: revision 1.21
PR port-arm/52603:
There is a race here, as seen on arm with FPU:
LWP L is running but not on CPU, has its FPU state on CPU2 which
has not been released yet, so fpexc still has VFP_FPEXC_EN set in the PCB copy.
LWP L is scheduled on CPU1, CPU1 calls cpu_switchto() for L in mi_switch().
cpu_switchto() will set VFP_FPEXC_EN in the FPU's fpexc register per the
PCB fpexc copy.
Before CPU1 calls pcu_switchpoint() for L, CPU2 calls
pcu_do_op(PCU_CMD_SAVE | PCU_CMD_RELEASE) for L because it still holds its
FPU state and wants to load another lwp. This cause VFP_FPEXC_EN to
be cleared in the PCB copy, but not in CPU1's register. L's l_pcu_cpu is
set to NULL.
When CPU1 calls pcu_switchpoint() for L it see l_pcu_cpu is NULL, and doesn't
call the release callback.
Now CPU1 has its FPU enabled but with the wrong FPU state.
Fix by releasing the PCU even if l_pcu_cpu is NULL.
--
In the REENABLE case, make sur the fpexc copy in the pcb also has
VFP_FPEXC_EN set. Otherwise we could trap on every context switch even if
the CPU already has the VFP state.
--
We KASSERT((fregs->vfp_fpexc & VFP_FPEXC_EN) == 0) just before, so
enabled is always false. remove.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Oct 16 15:03:57 2017 UTC (5 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, 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, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: netbsd-9
Changes since 1.20: +4 -3 lines
Diff to previous 1.20 (colored)

PR port-arm/52603:
There is a race here, as seen on arm with FPU:
LWP L is running but not on CPU, has its FPU state on CPU2 which
has not been released yet, so fpexc still has VFP_FPEXC_EN set in the PCB copy.

LWP L is scheduled on CPU1, CPU1 calls cpu_switchto() for L in mi_switch().
cpu_switchto() will set VFP_FPEXC_EN in the FPU's fpexc register per the
PCB fpexc copy.

Before CPU1 calls pcu_switchpoint() for L, CPU2 calls
pcu_do_op(PCU_CMD_SAVE | PCU_CMD_RELEASE) for L because it still holds its
FPU state and wants to load another lwp. This cause VFP_FPEXC_EN to
be cleared in the PCB copy, but not in CPU1's register. L's l_pcu_cpu is
set to NULL.

When CPU1 calls pcu_switchpoint() for L it see l_pcu_cpu is NULL, and doesn't
call the release callback.

Now CPU1 has its FPU enabled but with the wrong FPU state.

Fix by releasing the PCU even if l_pcu_cpu is NULL.

Revision 1.19.4.1 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:07 2017 UTC (5 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.19: +7 -10 lines
Diff to previous 1.19 (colored) next main 1.20 (colored)

Sync with HEAD

Revision 1.19.12.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:02 2017 UTC (5 years, 9 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.19: +7 -10 lines
Diff to previous 1.19 (colored) next main 1.20 (colored)

Sync with HEAD

Revision 1.19.8.1 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:47 2017 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.19: +7 -10 lines
Diff to previous 1.19 (colored) next main 1.20 (colored)

Sync with HEAD

Revision 1.20 / (download) - annotate - [select for diffs], Thu Mar 16 16:13:21 2017 UTC (5 years, 10 months ago) by chs
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.19: +7 -10 lines
Diff to previous 1.19 (colored)

allow pcu_save() and pcu_discard() to be called on other threads,
ptrace needs to use it that way.

Revision 1.12.2.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:29 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.12.2.1: +157 -199 lines
Diff to previous 1.12.2.1 (colored) to branchpoint 1.12 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.17.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:55:58 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.17: +151 -213 lines
Diff to previous 1.17 (colored) next main 1.18 (colored)

Rebase.

Revision 1.19 / (download) - annotate - [select for diffs], Sun May 25 14:53:55 2014 UTC (8 years, 8 months ago) by rmind
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, pgoyette-localcount-base, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, 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, nick-nhusb-base-20151226, 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-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, localcount-20160914, bouyer-socketcan-base
Branch point for: pgoyette-localcount, nick-nhusb, bouyer-socketcan
Changes since 1.18: +49 -40 lines
Diff to previous 1.18 (colored)

pcu: replace xcall(9) used for messaging with ipi(9).  This provides
a better performance of the PCU (e.g. FPU) state synchronisation.

Revision 1.10.2.4 / (download) - annotate - [select for diffs], Thu May 22 11:41:03 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.10.2.3: +34 -14 lines
Diff to previous 1.10.2.3 (colored) to branchpoint 1.10 (colored) next main 1.11 (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.14.2.2 / (download) - annotate - [select for diffs], Sun May 18 17:46:07 2014 UTC (8 years, 8 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.14.2.1: +129 -197 lines
Diff to previous 1.14.2.1 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored)

sync with head

Revision 1.18 / (download) - annotate - [select for diffs], Fri May 16 00:48:41 2014 UTC (8 years, 8 months ago) by rmind
Branch: MAIN
CVS Tags: rmind-smpnet-nbase, rmind-smpnet-base
Changes since 1.17: +121 -192 lines
Diff to previous 1.17 (colored)

pcu(9):
- Remove PCU_KERNEL (hi matt!) and significantly simplify the code.
  This experimental feature was tried on ARM did not meet the expectations.
  It may be revived one day, but it should be done in a much simpler way.
- Add a message structure for xcall function, pass the LWP ower and thus
  optimise a race condition: if LWP is discarding its state on a remote CPU,
  but another LWP already did it - do not cause an unecessary re-faulting.
- Reduce the variety of flags for PCU operations (only PCU_VALID and
  PCU_REENABLE are used now), pass them only to the pcu_state_load().
- Rename pcu_used_p() to pcu_valid_p(); hopefully it is less confusing.
- pcu_save_all_on_cpu: SPL ought to be used here.
- Update and improve the pcu(9) man page; it needs wizd(8) though.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jan 23 17:32:03 2014 UTC (9 years ago) by skrll
Branch: MAIN
CVS Tags: yamt-pagecache-base9, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.16: +6 -3 lines
Diff to previous 1.16 (colored)

Pass PCU_LOADED to pcu_state_load in the "this CPU already has our PCU
state loaded" of pcu_load.

ok, gimpy@ and rmind@

Revision 1.16 / (download) - annotate - [select for diffs], Tue Nov 26 20:29:40 2013 UTC (9 years, 2 months ago) by rmind
Branch: MAIN
Changes since 1.15: +10 -10 lines
Diff to previous 1.15 (colored)

Switch XC_HIGHPRI to run at IPL_SOFTSERIAL i.e. the highest software level.
Adjust pcu(9) to this xcall(9) change.  This may fix the problems after
x86 FPU was converted to use PCU, since it avoids heavy contention at the
lower levels (particularly, IPL_SOFTNET).  This is a good illustration why
software interrupts should generally avoid any blocking on locks.

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Wed Aug 28 23:59:35 2013 UTC (9 years, 5 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.14: +22 -5 lines
Diff to previous 1.14 (colored)

sync with head

Revision 1.15 / (download) - annotate - [select for diffs], Thu Aug 22 19:50:55 2013 UTC (9 years, 5 months ago) by drochner
Branch: MAIN
Changes since 1.14: +22 -5 lines
Diff to previous 1.14 (colored)

-extend the pcu(9) API by a function which saves all context on the
 current CPU, and use it if a CPU is taken offline
-add a bool argument to pcu_discard which tells whether the internal
 "LWP has used the coprocessor" flag should be set or reset. The flag
 is reported by pcu_used_p(). If set, future accesses should use the
 state stored in the PCB. If reset, it should be reset to default.
 The former case is useful for setmcontext().
 With that, it should not be necessary anymore to manage the "FPU used"
 state by an additional MD variable.

approved by matt

Revision 1.12.2.1 / (download) - annotate - [select for diffs], Mon Feb 25 00:29:53 2013 UTC (9 years, 11 months ago) by tls
Branch: tls-maxphys
Changes since 1.12: +116 -26 lines
Diff to previous 1.12 (colored)

resync with head

Revision 1.10.2.3 / (download) - annotate - [select for diffs], Wed Jan 23 00:06:22 2013 UTC (10 years ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.10.2.2: +116 -26 lines
Diff to previous 1.10.2.2 (colored) to branchpoint 1.10 (colored)

sync with head

Revision 1.14 / (download) - annotate - [select for diffs], Mon Dec 31 01:20:05 2012 UTC (10 years, 1 month ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base8, 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.13: +2 -3 lines
Diff to previous 1.13 (colored)

Remove a debugging printf

Revision 1.13 / (download) - annotate - [select for diffs], Wed Dec 26 18:30:23 2012 UTC (10 years, 1 month ago) by matt
Branch: MAIN
Changes since 1.12: +117 -26 lines
Diff to previous 1.12 (colored)

Add support for kernel-based code to use a PCU.  (for memory to memory
copies or in_cksum or ...)

Revision 1.10.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:34 2012 UTC (10 years, 3 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.10.2.1: +3 -3 lines
Diff to previous 1.10.2.1 (colored) to branchpoint 1.10 (colored)

sync with head

Revision 1.12 / (download) - annotate - [select for diffs], Thu Aug 30 02:24:48 2012 UTC (10 years, 5 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

KASSERT -> KASSERTMSG

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Wed May 23 10:08:11 2012 UTC (10 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.10: +25 -6 lines
Diff to previous 1.10 (colored)

sync with head.

Revision 1.10.6.1 / (download) - annotate - [select for diffs], Sun Apr 29 23:05:05 2012 UTC (10 years, 9 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.10: +25 -6 lines
Diff to previous 1.10 (colored) next main 1.11 (colored)

sync to latest -current.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Apr 18 13:43:13 2012 UTC (10 years, 9 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Changes since 1.10: +25 -6 lines
Diff to previous 1.10 (colored)

comment

Revision 1.10 / (download) - annotate - [select for diffs], Tue Sep 27 01:02:39 2011 UTC (11 years, 4 months ago) by jym
Branch: MAIN
CVS Tags: yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

Modify *ASSERTMSG() so they are now used as variadic macros. The main goal
is to provide routines that do as KASSERT(9) says: append a message
to the panic format string when the assertion triggers, with optional
arguments.

Fix call sites to reflect the new definition.

Discussed on tech-kern@. See
http://mail-index.netbsd.org/tech-kern/2011/09/07/msg011427.html

Revision 1.6.2.1 / (download) - annotate - [select for diffs], Thu Jun 23 14:20:20 2011 UTC (11 years, 7 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.6: +73 -3 lines
Diff to previous 1.6 (colored) next main 1.7 (colored)

Catchup with rmind-uvmplock merge.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Jun 13 21:32:42 2011 UTC (11 years, 7 months ago) by matt
Branch: MAIN
Changes since 1.8: +13 -4 lines
Diff to previous 1.8 (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.3.4.4 / (download) - annotate - [select for diffs], Sun Jun 12 00:24:29 2011 UTC (11 years, 7 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.3.4.3: +62 -1 lines
Diff to previous 1.3.4.3 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

sync with head

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jun 7 17:51:58 2011 UTC (11 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored)

Make pcu_save_all and pcu_discard_all KASSERTs accept LW_SYSTEM threads
since kthread_create will call lwp_create with lwp0 which may not be curlwp.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jun 6 22:04:34 2011 UTC (11 years, 7 months ago) by matt
Branch: MAIN
Changes since 1.6: +64 -3 lines
Diff to previous 1.6 (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.6.4.2 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:35 2011 UTC (11 years, 7 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.6.4.1: +294 -0 lines
Diff to previous 1.6.4.1 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored)

Sync with HEAD.

Revision 1.3.4.3 / (download) - annotate - [select for diffs], Tue May 31 03:05:02 2011 UTC (11 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.3.4.2: +63 -31 lines
Diff to previous 1.3.4.2 (colored) to branchpoint 1.3 (colored)

sync with head

Revision 1.6.4.1, Mon May 2 06:33:16 2011 UTC (11 years, 9 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.6: +0 -294 lines
FILE REMOVED

file subr_pcu.c was added on branch jruoho-x86intr on 2011-06-06 09:09:35 +0000

Revision 1.6 / (download) - annotate - [select for diffs], Mon May 2 06:33:16 2011 UTC (11 years, 9 months ago) by matt
Branch: MAIN
CVS Tags: cherry-xenmp-base
Branch point for: jruoho-x86intr, cherry-xenmp
Changes since 1.5: +9 -6 lines
Diff to previous 1.5 (colored)

Don't call pcu_do_op in pcu_load to save current context, use pcu_cpu_op
instead (since it will deal with ci->ci_pcu_curlwp[id] being NULL).

Revision 1.5 / (download) - annotate - [select for diffs], Mon May 2 01:43:37 2011 UTC (11 years, 9 months ago) by matt
Branch: MAIN
Changes since 1.4: +5 -5 lines
Diff to previous 1.4 (colored)

A little more constification

Revision 1.4 / (download) - annotate - [select for diffs], Mon May 2 00:29:53 2011 UTC (11 years, 9 months ago) by rmind
Branch: MAIN
Changes since 1.3: +60 -31 lines
Diff to previous 1.3 (colored)

Extend PCU:
- Add pcu_ops_t::pcu_state_release() operation for PCU_RELEASE case.
- Add pcu_switchpoint() to perform release operation on context switch.
- Sprinkle const, misc.  Also, sync MIPS with changes.

Per discussions with matt@.

Revision 1.3.4.2 / (download) - annotate - [select for diffs], Sat Mar 5 20:55:19 2011 UTC (11 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.3.4.1: +262 -0 lines
Diff to previous 1.3.4.1 (colored) to branchpoint 1.3 (colored)

sync with head

Revision 1.3.2.2 / (download) - annotate - [select for diffs], Sat Mar 5 15:10:40 2011 UTC (11 years, 10 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.3.2.1: +262 -0 lines
Diff to previous 1.3.2.1 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

Sync with HEAD

Revision 1.3.4.1, Sat Feb 19 20:19:54 2011 UTC (11 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.3: +0 -262 lines
FILE REMOVED

file subr_pcu.c was added on branch rmind-uvmplock on 2011-03-05 20:55:19 +0000

Revision 1.3.2.1, Sat Feb 19 20:19:54 2011 UTC (11 years, 11 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.3: +0 -262 lines
FILE REMOVED

file subr_pcu.c was added on branch bouyer-quota2 on 2011-03-05 15:10:40 +0000

Revision 1.3 / (download) - annotate - [select for diffs], Sat Feb 19 20:19:54 2011 UTC (11 years, 11 months ago) by matt
Branch: MAIN
CVS Tags: bouyer-quota2-nbase
Branch point for: rmind-uvmplock, bouyer-quota2
Changes since 1.2: +6 -2 lines
Diff to previous 1.2 (colored)

Default PCU_UNIT_COUNT to 0.  If 0, don't compile the contents of subr_pcu.c
and don't include the pcu related members into struct lwp.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Feb 17 18:44:54 2011 UTC (11 years, 11 months ago) by matt
Branch: MAIN
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (colored)

Add a bool to pcu_state_save which indicates whether the PCU is going to be
released after the save is done.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Feb 17 18:32:29 2011 UTC (11 years, 11 months ago) by rmind
Branch: MAIN

Add PCU (Per-CPU Unit) - an interface to manage synchronization of any
per CPU context tied with an LWP.  Main use - lazy FPU handling on SMP.

Requested by matt@, will be used on mips64.  Note: implementation will
be improved to use IPIs before adopting on x86.  OK 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>