Page MenuHomeFreeBSD

[3/2] tests: hook up some tests for cpuset(2) and CPUSET(9)
ClosedPublic

Authored by kevans on Nov 21 2020, 5:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 10:25 PM
Unknown Object (File)
Tue, Oct 29, 10:58 AM
Unknown Object (File)
Sep 10 2024, 1:13 PM
Unknown Object (File)
Sep 8 2024, 8:12 AM
Unknown Object (File)
Aug 31 2024, 4:11 AM
Unknown Object (File)
Aug 28 2024, 10:13 PM
Unknown Object (File)
Aug 28 2024, 6:36 PM
Unknown Object (File)
Aug 27 2024, 11:49 AM
Subscribers

Details

Summary

The NetBSD test tests their version of CPUSET(9); not sure if they're providing much value beyond testing the shims that I threw in, but the parts that are testing with valid cpu indexes seem useful.

The cpuset(2) tests should be run as root (require.user properly set) with >= 3 cpus for maximum coverage. All tests that want to modify the cpuset don't assume any particular cpu layout (i.e. the first cpu may not be 0, the last may not be first + count) and the following scenarios are tested:

1.) newset: basic execute cpuset() to grab a new cpuset, make sure the assigned cpuset then has a different ID.
2.) transient: create a new cpuset then assign the process its original cpuset, ensuring that the one we created is now gone.
3.) deadlk: test assigning an anonymous mask, then resetting the process base affinity with 1-cpu overlap w.r.t. the anonymous mask and with 0-cpu overlap w.r.t. the anonymous mask.
4.) jail_attach_newbase: process attaches to a jail with its own cpuset+mask (e.g. cpuset -c -l 1,2 jail -c path=/ command=/bin/sh)
5.) jail_attach_newbase_plain: process attaches to a jail with its own cpuset (e.g. cpuset -c jail -c path=/ command=/bin/sh)
6.) jail_attach_prevbase: process attaches to a jail with the containing jail's root cpuset (e.g. jail -c path=/ command=/bin/sh)
7.) jail_attach_plain: process attaches to a jail with the containing jail's root cpuset+mask.
8.) badparent: creates a new cpuset and modifies the anonymous thread mask, then setid's back to the original and checks that cpuset_getid() returns the expected set.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 34946

Event Timeline

Add 'badparent' test, which checks for a bug fixed in 2/2 in this set where anonymous sets would get the wrong parent in some circumstances.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 31 2020, 6:33 PM
This revision was automatically updated to reflect the committed changes.