]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r368009-r368010: kern: cpuset: minor improvements
authorKyle Evans <kevans@FreeBSD.org>
Fri, 4 Dec 2020 02:28:45 +0000 (02:28 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Fri, 4 Dec 2020 02:28:45 +0000 (02:28 +0000)
commit9118a3bf4b6c384edf1ebd778da2d1a1233cd2b4
tree0be1bbcdd1fe7ee7b3c37a2efc1bec09b47ac336
parent3759398cedbb056205fddb012cdcd799c96db552
MFC r368009-r368010: kern: cpuset: minor improvements

r368009:
kern: cpuset: allow cpuset_create() to take an allocated *setp

Currently, it must always allocate a new set to be used for passing to
_cpuset_create, but it doesn't have to. This is purely kern_cpuset.c
internal and it's sparsely used, so just change it to use *setp if it's
not-NULL and modify the two consumers to pass in the address of a NULL
cpuset.

This paves the way for consumers that want the unr allocation without the
possibility of sleeping as long as they've done their due diligence to
ensure that the mask will properly apply atop the supplied parent
(i.e. avoiding the free_unr() in the last failure path).

r368010:
kern: cpuset: rename _cpuset_create() to cpuset_init()

cpuset_init() is better descriptor for what the function actually does. The
name was previously taken by a sysinit that setup cpuset_zero's mask
from all_cpus, it was removed in r331698 before stable/12 branched.

A comment referencing the removed sysinit has now also been removed, since
the setup previously done was moved into cpuset_thread0().
sys/kern/kern_cpuset.c