From nobody Thu Jun 11 09:41:10 2026 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gbd1y4wj6z6h4DW for ; Thu, 11 Jun 2026 09:41:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gbd1y2ylxz3rh1 for ; Thu, 11 Jun 2026 09:41:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781170870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qtVAdsYybenrbGmClSJTFFAkUyNTH6hETL7SIfPyROA=; b=JkrACO6RfWCEXpQcCNNxEHAUT33gowNzEeeeXTNnebpG50zsBVZpUMOq2jdj0ymffm8L+s 7VOX0985w/VKfdTWLxlsLtnnM/aGm7hVQ/H1KPXDyBAoYBheaBDr+SJaiGr14liG0srOlA zYImbyPqml4RjRSD0NLrs4ANxrxbLxHxD58xyg+GF1ZxlxJl36jJlZ+tyTfVZaBiXeDS5H AQCANa0Db7Ey5Sl8sJTAUtKkHhM+Nv/TYQbjqyuc1NJxKrx6pm9xfathAckY4HrA37DpTj TVcsExMSXkbdzAV4VKPi57cCXhbreSjKZhqJtCBfgFxzi5ezboWEzJVnsfbrXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781170870; a=rsa-sha256; cv=none; b=xZokjeu9oOEi6cotX1h2D4a8WB3pEvw6Y01OijOFm5lEcj/TbidOu4DstNl6CxmnRUps+S ty/OO77hQyYE+S/cmb8n1gi2wiJ8MOzC2AOcUl314N4YgOIHa6SFTgRVMyEptiSZOyHXX3 +PUKp9GIFaBl9DLXBXex0JY28q/KC3xvk/UMJcVtCdj72UurV49seBSc8AdY1JuoiS4DY7 a1iLzvaXStNPrHFM2T4Cq/3Xa1oUGleB+uf4050V4tKUI2OXvlwubIqSJghOV9KtdjX8Q2 NQglSmeOLgS9bH03NmxDSdisRbhC9xocjnNQy3bf8BPiPpkFzOQUWtSb/lDMwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781170870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qtVAdsYybenrbGmClSJTFFAkUyNTH6hETL7SIfPyROA=; b=GmzTzVIHYfxga/5WXZaSlRVQU2IafRpftwJdR21ifBFeNzhrg5eHS2uXk4AoYTMUV3dfH5 9AbTO+/uvzhzt3pVyzpx3OMfQdJKgXb3orOpaYvgWk0qpBBiFXR1CuVc9CVYvvFX5Ef2w7 qEeE9TOio0pI/6pXcrixy2Th7bj4k/dhVjMVIwv6YUIOXPOHNLudhH9ZCJ3xL2pVft+Ga7 DUBl3TEAXmYBFfDnX6ERQ2bAwRcXlIZOyhfakx/YMX354a1XjpZ0QrF6+YShWUtmDZiUYS ZtR1f9bf2cR6ovSysPqHagA1e7s4lWV0nrWP07XKbj/ipgjKVckUHBDC2ktUlA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4gbd1y1059zmHp for ; Thu, 11 Jun 2026 09:41:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 65B9fA5I025742 for ; Thu, 11 Jun 2026 09:41:10 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 65B9fAsJ025741 for bugs@FreeBSD.org; Thu, 11 Jun 2026 09:41:10 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 295992] bnxt: System hangs when nstat and sysctl -a run concurrently Date: Thu, 11 Jun 2026 09:41:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: sumit.saxena@broadcom.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D295992 Bug ID: 295992 Summary: bnxt: System hangs when nstat and sysctl -a run concurrently Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: sumit.saxena@broadcom.com While running the heavy traffic on Broadcom 400G NIC(Thor2), I observed a temporary system hang which causes traffic to come to halt for some time wh= en nstat (Network traffic monitoring tool) is running and "sysctl -a" is run in parallel. The issue is intermittent. Below are the traces of both threads w= ith our analysis: ------------- nstat: # procstat -kk 39693 PID TID COMM TDNAME KSTACK 39693 101860 nstat - mi_switch+0x172 __mtx_lock_sleep+0x1c1 __mtx_lock_flags+0xdd sysctl_root_handler_locked+0x8c sysctl_root+0x22f userland_sysctl+0x1b6 kern___sysctlbyname+0x226 sys___sysctlbyname+0x2d amd64_syscall+0x169 fast_syscall_common+0xf8 sysctl -a: # procstat -kk 40586 PID TID COMM TDNAME KSTACK 40586 102075 sysctl - mi_switch+0x172 sched_ule_bind+0x8a cpu_est_clockrate+0x81 hwpstate_get_cppc+0x48 cf_get_method+0xf0 cpufreq_curr_sysctl+0x68 sysctl_root_handler_locked+0x9c sysctl_root+0x22f userland_sysctl+0x1b6 sys___sysctl+0x65 amd64_syscall+0x1= 69 fast_syscall_common+0xf8 It's a timing-related temporarily system hang when the traffic monitoring t= ool nstat and sysctl -a are queried concurrently. This conflict results in both threads hanging temporarily, causing a CPU halt that leads nstat to report = zero Tx/Rx packets and NaN CPU utilization once the hang resolves. The root cause is a Giant mutex convoy triggered by the cpufreq sysctl hand= ler. Specifically, the sysctl -a process acquires the Giant mutex and then attem= pts to migrate to a specific CPU to read clock rates, where it remains blocked = if that target CPU is saturated with NIC traffic. Trace Analysis: - sysctl -a (The Blocker): Holds the Giant mutex while executing cpufreq_curr_sysctl. The handler calls hwpstate_get_cppc, which invokes cpu_est_clockrate. Inside cpu_est_clockrate, the thread calls sched_bind to migrate to the target CPU. Because the target CPU is busy, mi_switch is cal= led, and the thread sleeps while still holding the Giant mutex. - nstat (The Victim): Attempts to execute a sysctl call but becomes block= ed at __mtx_lock_sleep while waiting for the Giant mutex held by the sysctl thread. Technical Details: - Giant Acquisition: kern_sysctl.c (Lines 22-23) acquires the mutex becau= se the OID lacks the CTLFLAG_MPSAFE flag. - CPU Migration: cpu_machdep.c (Lines 444-450) forces the thread to bind = to the target cpu_id via sched_bind. - Thread State: The sysctl thread remains in mi_switch within sched_ule.c (Line 3023) until the target CPU can schedule it, effectively locking out a= ny other processes (like nstat) that require the Giant mutex. ------------------ --=20 You are receiving this mail because: You are the assignee for the bug.=