Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108070846
D32025.id95384.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32025.id95384.diff
View Options
Index: sys/kern/kern_intr.c
===================================================================
--- sys/kern/kern_intr.c
+++ sys/kern/kern_intr.c
@@ -107,6 +107,7 @@
SYSCTL_INT(_hw, OID_AUTO, intr_hwpmc_waiting_report_threshold, CTLFLAG_RWTUN,
&intr_hwpmc_waiting_report_threshold, 1,
"Threshold for reporting number of events in a workq");
+#define PMC_HOOK_INSTALLED_ANY() __predict_false(pmc_hook != NULL)
#endif
static TAILQ_HEAD(, intr_event) event_list =
TAILQ_HEAD_INITIALIZER(event_list);
@@ -131,6 +132,14 @@
PMC_SOFT_DEFINE( , , intr, stray);
PMC_SOFT_DEFINE( , , intr, schedule);
PMC_SOFT_DEFINE( , , intr, waiting);
+
+#define PMC_SOFT_CALL_INTR_HLPR(event, frame) \
+do { \
+ if (frame != NULL) \
+ PMC_SOFT_CALL_TF( , , intr, event, frame); \
+ else \
+ PMC_SOFT_CALL( , , intr, event); \
+} while (0)
#endif
/* Map an interrupt type to an ithread priority. */
@@ -1005,11 +1014,10 @@
thread_lock(td);
if (TD_AWAITING_INTR(td)) {
#ifdef HWPMC_HOOKS
- atomic_set_int(&it->it_waiting, 0);
- if (frame != NULL)
- PMC_SOFT_CALL_TF( , , intr, schedule, frame);
- else
- PMC_SOFT_CALL( , , intr, schedule);
+ if (PMC_HOOK_INSTALLED_ANY()) {
+ it->it_waiting = 0;
+ PMC_SOFT_CALL_INTR_HLPR(schedule, frame);
+ }
#endif
CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, td->td_proc->p_pid,
td->td_name);
@@ -1017,13 +1025,9 @@
sched_add(td, SRQ_INTR);
} else {
#ifdef HWPMC_HOOKS
- atomic_add_int(&it->it_waiting, 1);
-
- if (atomic_load_int(&it->it_waiting) >= intr_hwpmc_waiting_report_threshold) {
- if (frame != NULL)
- PMC_SOFT_CALL_TF( , , intr, waiting, frame);
- else
- PMC_SOFT_CALL( , , intr, waiting);
+ if (PMC_HOOK_INSTALLED_ANY()) {
+ if (++it->it_waiting >= intr_hwpmc_waiting_report_threshold)
+ PMC_SOFT_CALL_INTR_HLPR(waiting, frame);
}
#endif
CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 3:30 AM (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16024316
Default Alt Text
D32025.id95384.diff (1 KB)
Attached To
Mode
D32025: hwpmc: fix performance issues
Attached
Detach File
Event Timeline
Log In to Comment