Home | History | Annotate | Download | only in sys
History log of /src/common/lib/libc/sys/cpuset.c
RevisionDateAuthorComments
 1.21  11-May-2019  maxv Fix bug, the computation of cpuset_nentries was incorrect, we must do +1
to be able to address the last 32 bits.

On a machine with 80 CPUs, this caused "cpuctl identify >64" to return
garbage.
 1.20  26-Jul-2018  kamil Avoid undefined behavior in an cpuset.c

Do not change the signedness bit with a left shift operation.
Switch to unsigned integer to prevent this.

cpuset.c:112:18, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.
 1.19  04-Jan-2018  kamil branches: 1.19.2; 1.19.4;
Add bunch of missing includes of namespace.h in libc

The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global changes of the following symbols:
- strlcat -> _strlcat
- sysconf -> __sysconf
- closedir -> _closedir
- fparseln -> _fparseln
- kill -> _kill
- mkstemp -> _mkstemp
- reallocarr -> _reallocarr
- strcasecmp -> _strcasecmp
- strncasecmp -> _strncasecmp
- strptime -> _strptime
- strtok_r -> _strtok_r
- sysctl -> _sysctl
- dlopen -> __dlopen
- dlclose -> __dlclose
- dlsym -> __dlsym

Sponsored by <The NetBSD Foundation>
 1.18  09-Mar-2012  christos branches: 1.18.26;
Casts and type changes to fix portability issues.
- int -> size_t
- adjust width of RHS of shift
- adjust widths of types
 1.17  07-Aug-2011  rmind branches: 1.17.2;
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@
 1.16  21-Sep-2010  rmind _cpuset_create: initialize size argument for sysctl call.
From PR/43837 by Sandy Snaman.
 1.15  25-Apr-2009  rmind - Add kcpuset_iszero().
- Fix kcpuset_match().
 1.14  15-Mar-2009  rmind - Add kcpuset_fill(), kcpuset_set() and kcpuset_match().
- KNF while here.
 1.13  14-Feb-2009  christos make this work with pcc. The previous construct is not valid c99.
 1.12  27-Jul-2008  dholland branches: 1.12.4; 1.12.6;
Don't convert cpuid_t through int while testing it for being in range.
(Might truncate it, for one thing. Also, if the shift result is < 0 the
demons have already flown out of our nose.)

Fixes some -Wsign-compare warnings.
 1.11  14-Jul-2008  rmind Add few KASSERTs.
 1.10  22-Jun-2008  he branches: 1.10.2;
Be consistent in how cpuset_nentries is computed in the kernel and
in user-land. This fixes the user-land part. Now "cpuctl identify 0"
gives a result instead of getting EINVAL from the set-affinity syscall.
 1.9  22-Jun-2008  rmind kcpuset_isset: remove if-check. It is not reasonable for kernel,
saves few cycles, and it is better for CPU cache.
 1.8  22-Jun-2008  christos Separate cpuset and kcpuset, and only use the bits in userland. Requested
by yamt
 1.7  16-Jun-2008  christos branches: 1.7.2;
We don't need any of this in standalone mode.
 1.6  16-Jun-2008  christos little more lint
 1.5  16-Jun-2008  christos make lint happy
 1.4  16-Jun-2008  rmind - 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.
 1.3  15-Jun-2008  rmind cpuset_create: check the return value of calloc().
 1.2  15-Jun-2008  rmind - cpuset_create: pass correct argument to sysctl(3).
- Constify few variables.
 1.1  15-Jun-2008  christos cpuset related functions, shared between the kernel and userland.
 1.7.2.2  17-Jun-2008  yamt sync with head.
 1.7.2.1  16-Jun-2008  yamt file cpuset.c was added on branch yamt-pf42 on 2008-06-17 09:13:31 +0000
 1.10.2.4  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.10.2.3  24-Jun-2008  wrstuden Actually use the version in wrstuden-revivesa-base-1. Compiles better.
 1.10.2.2  24-Jun-2008  wrstuden Add file missed in merge. Patch will add files, but won't make
new directories.
 1.10.2.1  22-Jun-2008  wrstuden file cpuset.c was added on branch wrstuden-revivesa on 2008-06-24 04:47:49 +0000
 1.12.6.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.4.1  20-Oct-2013  bouyer Pull up following revision(s) (requested by dholland in ticket #1883):
common/lib/libc/sys/cpuset.c: revision 1.16
_cpuset_create: initialize size argument for sysctl call.
From PR/43837 by Sandy Snaman.
 1.17.2.1  17-Apr-2012  yamt sync with head
 1.18.26.1  12-May-2019  martin Pull up following revision(s) (requested by maxv in ticket #1260):

common/lib/libc/sys/cpuset.c: revision 1.21
usr.sbin/cpuctl/cpuctl.c: revision 1.30

Fix bug, the computation of cpuset_nentries was incorrect, we must do +1
to be able to address the last 32 bits.

On a machine with 80 CPUs, this caused "cpuctl identify >64" to return
garbage.

Check the return value of cpuset_set(), to prevent future surprises.
 1.19.4.3  21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.19.4.2  21-Apr-2020  martin Sync with HEAD
 1.19.4.1  10-Jun-2019  christos Sync with HEAD
 1.19.2.1  28-Jul-2018  pgoyette Sync with HEAD

RSS XML Feed