uint32_t poll_burst; /* state */
uint32_t poll_burst_max; /* tunable */
uint32_t user_frac; /* tunable */
+ uint32_t kern_frac; /* state */
struct sysctl_ctx_list poll_sysctl_ctx;
struct sysctl_oid *poll_sysctl_tree;
io_ctx->pending_polls = 0;
io_ctx->residual_burst = 0;
io_ctx->phase = 0;
+ io_ctx->kern_frac = 0;
bzero(&io_ctx->poll_start_t, sizeof(io_ctx->poll_start_t));
bzero(&io_ctx->prev_t, sizeof(io_ctx->prev_t));
crit_exit();
kern_load = (t.tv_usec - io_ctx->poll_start_t.tv_usec) +
(t.tv_sec - io_ctx->poll_start_t.tv_sec) * 1000000; /* us */
kern_load = (kern_load * poll_hz) / 10000; /* 0..100 */
+ io_ctx->kern_frac = kern_load;
+
if (kern_load > (100 - io_ctx->user_frac)) {
/* Try decrease ticks */
if (io_ctx->poll_burst > 1)
&io_ctx->user_frac, 0,
"Desired user fraction of cpu time");
+ SYSCTL_ADD_UINT(ctx, parent, OID_AUTO, "kern_frac", CTLFLAG_RD,
+ &io_ctx->kern_frac, 0,
+ "Kernel fraction of cpu time");
+
SYSCTL_ADD_UINT(ctx, parent, OID_AUTO, "short_ticks", CTLFLAG_RW,
&io_ctx->short_ticks, 0,
"Hardclock ticks shorter than they should be");