summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_percpu.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-101-2/+2
| | | | ok gnezdo@ semarie@ mpi@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* Always allocate counters memory using type M_COUNTERS.jca2017-02-051-13/+13
| | | | | | | 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@
* Move the membar in counters_read(). It has to be between readingbluhm2017-01-111-5/+5
| | | | | | | 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@
* use ncpusfound to size the percpu allocations.dlg2016-10-271-9/+9
| | | | | | | | | | 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.
* avoid using realloc in the name of things that dont work like realloc.dlg2016-10-241-7/+7
| | | | | | | | | | 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@
* non-MP vs MP codepaths were confusingly split between the .c and .h file.deraadt2016-10-241-1/+13
| | | | | | Unify these by placing #ifdef MULTIPROCESSOR inside the functions, then collapse further to reduce _KERNEL blocks ok dlg
* consistently zero the allocated memory in both the MP and UP cases.dlg2016-10-211-3/+3
| | | | from markus@
* add generalised access to per cpu data structures and counters.dlg2016-10-211-0/+325
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@