OpenBSD CVS

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


[BACK] Up to [local] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.11 / (download) - annotate - [select for diffs], Sat Sep 16 09:33:27 2023 UTC (8 months, 3 weeks ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.10: +10 -6 lines
Diff to previous 1.10 (colored)

Allow counters_read(9) to take an optional scratch buffer.

Using a scratch buffer makes it possible to take a consistent snapshot of
per-CPU counters without having to allocate memory.

Makes ddb(4) show uvmexp command work in OOM situations.

ok kn@, mvs@, cheloha@

Revision 1.10 / (download) - annotate - [select for diffs], Mon Oct 3 14:10:53 2022 UTC (20 months, 1 week ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

Add a second membar producer into counters_zero().  Now it is
symmetric to counters_read().
OK jmatthew@

Revision 1.9 / (download) - annotate - [select for diffs], Wed Mar 10 10:21:47 2021 UTC (3 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

spelling

ok gnezdo@ semarie@ mpi@

Revision 1.8 / (download) - annotate - [select for diffs], Fri Sep 8 05:36:53 2017 UTC (6 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.7: +1 -2 lines
Diff to previous 1.7 (colored)

If you use sys/param.h, you don't need sys/types.h

Revision 1.7 / (download) - annotate - [select for diffs], Sun Feb 5 16:23:38 2017 UTC (7 years, 4 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.6: +13 -13 lines
Diff to previous 1.6 (colored)

Always allocate counters memory using type M_COUNTERS.

This makes the API simpler, and is probably more useful than spreading
counters memory other several types, making it harder to track.

Prodded by mpi, ok mpi@ stsp@

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jan 11 17:46:28 2017 UTC (7 years, 5 months ago) by bluhm
Branch: MAIN
Changes since 1.5: +5 -5 lines
Diff to previous 1.5 (colored)

Move the membar in counters_read().  It has to be between reading
the generation number and the counters.  In counters_zero() put a
membar after resetting the counters, but before writing the generation
number.
OK mpi@ patrick@

Revision 1.5 / (download) - annotate - [select for diffs], Thu Oct 27 09:40:20 2016 UTC (7 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.4: +9 -9 lines
Diff to previous 1.4 (colored)

use ncpusfound to size the percpu allocations.

ncpus is used on half the architectures to indicate the number of
cpus that have been hatched, and is used on them in things like ddb
to figure out how many cpus to shut down again.

ncpusfound is incremented during autoconf on MP machines to show
how big ncpus will probably become. percpu is initted after autoconf
but before cpus are hatched, so this works well.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Oct 24 23:58:33 2016 UTC (7 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.3: +7 -7 lines
Diff to previous 1.3 (colored)

avoid using realloc in the name of things that dont work like realloc.

cpumem_realloc and counters_realloc actually allocated new per cpu data
for new cpus, they didnt resize the existing allocation.

specifically, this renames cpumem_reallod to cpumem_malloc_ncpus, and
counters_realloc to counters_alloc_ncpus.

ok (and with some fixes by) bluhm@

Revision 1.3 / (download) - annotate - [select for diffs], Mon Oct 24 03:15:38 2016 UTC (7 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +13 -1 lines
Diff to previous 1.2 (colored)

non-MP vs MP codepaths were confusingly split between the .c and .h file.
Unify these by placing #ifdef MULTIPROCESSOR inside the functions, then
collapse further to reduce _KERNEL blocks
ok dlg

Revision 1.2 / (download) - annotate - [select for diffs], Fri Oct 21 06:41:52 2016 UTC (7 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

consistently zero the allocated memory in both the MP and UP cases.

from markus@

Revision 1.1 / (download) - annotate - [select for diffs], Fri Oct 21 06:27:50 2016 UTC (7 years, 7 months ago) by dlg
Branch: MAIN

add generalised access to per cpu data structures and counters.

both the cpumem and counters api simply allocates memory for each cpu in
the system that can be used for arbitrary per cpu data (via cpumem), or
a versioned set of counters per cpu (counters).

there is an alternate backend for uniprocessor systems that basically
turns the percpu data access into an immediate access to a single
allocation.

there is also support for percpu data structures that are available at
boot time by providing an allocation for the boot cpu. after autoconf,
these allocations have to be resized to provide for all cpus that were
enumerated by boot.

ok mpi@

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.