]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kern: cpuset: allow cpuset_create() to take an allocated *setp
authorKyle Evans <kevans@FreeBSD.org>
Wed, 25 Nov 2020 01:42:32 +0000 (01:42 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Wed, 25 Nov 2020 01:42:32 +0000 (01:42 +0000)
commit29d04ea8c321a0b2cb1f864ff16fe132d0602f19
tree799002900cd1bbdaf1c8e346de8f2cd40a03349d
parenta4a23d2137d05fdae3af5987dd590da0cb1c21f6
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).

Reviewed by: jamie, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27297
sys/kern/kern_cpuset.c