Date: Tue, 30 Jun 2026 22:19:00 +0000 From: Chuck Tuffli <chuck@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: John De Boskey <jwd@FreeBSD.org> Subject: git: 9ea13242985d - main - bhyve: Add CPU pinning diagnostic message Message-ID: <6a4440d4.3d029.3a865c8c@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=9ea13242985dc145b2471cc8f651be87c6a74bfe commit 9ea13242985dc145b2471cc8f651be87c6a74bfe Author: John De Boskey <jwd@FreeBSD.org> AuthorDate: 2026-06-30 21:29:50 +0000 Commit: Chuck Tuffli <chuck@FreeBSD.org> CommitDate: 2026-06-30 22:18:20 +0000 bhyve: Add CPU pinning diagnostic message When pinning a vcpu to a hostcpu fails, print out a diagnostic message to stderr indicating the failing CPU pair. MFC after: 1 month Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D57619 --- usr.sbin/bhyve/bhyverun.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index b5e7a4709fb4..8cbc19fcfef8 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -566,15 +566,21 @@ fbsdrun_start_thread(void *param) { char tname[MAXCOMLEN + 1]; struct vcpu_info *vi = param; - int error; snprintf(tname, sizeof(tname), "vcpu %d", vi->vcpuid); pthread_set_name_np(pthread_self(), tname); if (vcpumap[vi->vcpuid] != NULL) { - error = pthread_setaffinity_np(pthread_self(), - sizeof(cpuset_t), vcpumap[vi->vcpuid]); - assert(error == 0); + if (pthread_setaffinity_np(pthread_self(), + sizeof(cpuset_t), vcpumap[vi->vcpuid]) != 0) { + int i; + warn("Error pinning vcpu %d to host cpuset@%p", vi->vcpuid, + vcpumap[vi->vcpuid]); + CPU_FOREACH_ISSET(i, vcpumap[vi->vcpuid]) { + warnx("cpu %d enabled\n", i); + } + exit(BHYVE_EXIT_ERROR); + } } #ifdef BHYVE_SNAPSHOThome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a4440d4.3d029.3a865c8c>
