HomeFreeBSD

MFC r368462: cpuset_set{affinity,domain}: do not allow empty masks

Description

MFC r368462: cpuset_set{affinity,domain}: do not allow empty masks

cpuset_modify() would not currently catch this, because it only checks that
the new mask is a subset of the root set and circumvents the EDEADLK check
in cpuset_testupdate().

This change both directly validates the mask coming in since we can
trivially detect an empty mask, and it updates cpuset_testupdate to catch
stuff like this going forward by always ensuring we don't end up with an
empty mask.

The check_mask argument has been renamed because the 'check' verbiage does
not imply to me that it's actually doing a different operation. We're either
augmenting the existing mask, or we are replacing it entirely.

Details

Provenance
kevansAuthored on
Parents
rS368680: MFC r368461: kern: cpuset: resolve race between cpuset_lookup/cpuset_rel
Branches
Unknown
Tags
Unknown