Created attachment 170101 [details] Only refresh device table on a device add or remove event In a recent update of 10-STABLE, devd began spewing: !system=CAM subsystem=periph type=error device=cd0 serial="10000000000000000001" cam_status="0xcc" scsi_status=2 scsi_sense="70 02 3a 00" CDB="00 00 00 00 00 00 " This caused bsnmpd to take up nearly 100% of the CPU refreshing the devtree table every second. Admittedly, this is an issue in the CAM driver, but why refresh the whole tree each time a device is not either inserted or removed? The attached patch corrects this by only refreshing the devtree when a device is added or removed.
I saw this on head and stable/11. Can we get this patch in, and make sure it's MFC'ed to stable/10 and stable/11 before 11.0-RELESE?
I think ngie is working on bsnmpd.
I can confirm that this happends on RC2 (but it does not seem to occur on RC1) for FreeBSD 11. After upgrading to RC2 somehow cd0 is noticed and is constantly getting queried. This generates high bsnmp load, and somehow it ran out of swap space on one of my machines yesterday (might be unrelated though). I can easily see from the VPS vendor that the high cpu utilization started after upgrading to -RC2.
Please commit it, bsnmpd isn't fully functional without it (and what is the point of running SNMP daemon without host resourses module ?). I was having problems with bsnmpd (answering to the snmpwalk like once per 10 requests), but after installing it bsnmpd seems to be working fine.
This is still a problem on freebsd 11.1 running under xen. Could someone commit this patch please?
A commit references this bug: Author: pfg Date: Sat Oct 28 21:26:49 UTC 2017 New revision: 325067 URL: https://svnweb.freebsd.org/changeset/base/325067 Log: bsnmpd: Only refresh devtree if devd event is a new or removed device. It makes sense to refresh the tree only when a device is inserted or removed, otherwise bsnmpd wastes lot of CPU. PR: 209368 MFC after: 1 week Changes: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
A commit references this bug: Author: pfg Date: Sat Nov 4 14:49:22 UTC 2017 New revision: 325395 URL: https://svnweb.freebsd.org/changeset/base/325395 Log: MFC r325067: bsnmpd: Only refresh devtree if devd event is a new or removed device. It makes sense to refresh the tree only when a device is inserted or removed, otherwise bsnmpd needlessly wastes lots of CPU. PR: 209368 Changes: _U stable/11/ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
A commit references this bug: Author: pfg Date: Sat Nov 4 14:56:58 UTC 2017 New revision: 325396 URL: https://svnweb.freebsd.org/changeset/base/325396 Log: MFC r325067: bsnmpd: Only refresh devtree if devd event is a new or removed device. It makes sense to refresh the tree only when a device is inserted or removed, otherwise bsnmpd needlessly wastes lots of CPU. PR: 209368 Changes: _U stable/10/ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
Committed all the way to 10-stable
*** Bug 217983 has been marked as a duplicate of this bug. ***
*** Bug 215471 has been marked as a duplicate of this bug. ***