]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kern: cpuset: drop the lock to allocate domainsets
authorkevans <kevans@FreeBSD.org>
Sat, 28 Nov 2020 01:21:11 +0000 (01:21 +0000)
committerkevans <kevans@FreeBSD.org>
Sat, 28 Nov 2020 01:21:11 +0000 (01:21 +0000)
commitb57c24f1c99a933b6fd7986dde53079114ab03f6
tree90f22b7e614a3f8118c4efdb5e61ba13e8cca2e9
parente923967a76b2f9b99d01004e1b04ce5fe8154c8b
kern: cpuset: drop the lock to allocate domainsets

Restructure the loop a little bit to make it a little more clear how it
really operates: we never allocate any domains at the beginning of the first
iteration, and it will run until we've satisfied the amount we need or we
encounter an error.

The lock is now taken outside of the loop to make stuff inside the loop
easier to evaluate w.r.t. locking.

This fixes it to not try and allocate any domains for the freelist under the
spinlock, which would have happened before if we needed any new domains.

Reported by: syzbot+6743fa07b9b7528dc561@syzkaller.appspotmail.com
Reviewed by: markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D27371
sys/kern/kern_cpuset.c