Lines Matching refs:ios

305 cam_iosched_limiter_init(struct iop_stats *ios)
307 int lim = ios->limiter;
314 return limsw[lim].l_init(ios);
320 cam_iosched_limiter_tick(struct iop_stats *ios)
322 int lim = ios->limiter;
329 return limsw[lim].l_tick(ios);
335 cam_iosched_limiter_iop(struct iop_stats *ios, struct bio *bp)
337 int lim = ios->limiter;
344 return limsw[lim].l_iop(ios, bp);
350 cam_iosched_limiter_caniop(struct iop_stats *ios, struct bio *bp)
352 int lim = ios->limiter;
359 return limsw[lim].l_caniop(ios, bp);
365 cam_iosched_limiter_iodone(struct iop_stats *ios, struct bio *bp)
367 int lim = ios->limiter;
374 return limsw[lim].l_iodone(ios, bp);
384 cam_iosched_qd_iop(struct iop_stats *ios, struct bio *bp)
387 if (ios->current <= 0 || ios->pending < ios->current)
394 cam_iosched_qd_caniop(struct iop_stats *ios, struct bio *bp)
397 if (ios->current <= 0 || ios->pending < ios->current)
404 cam_iosched_qd_iodone(struct iop_stats *ios, struct bio *bp)
407 if (ios->current <= 0 || ios->pending != ios->current)
414 cam_iosched_iops_init(struct iop_stats *ios)
417 ios->l_value1 = ios->current / ios->softc->quanta;
418 if (ios->l_value1 <= 0)
419 ios->l_value1 = 1;
420 ios->l_value2 = 0;
426 cam_iosched_iops_tick(struct iop_stats *ios)
434 new_ios = (int)((ios->current * (uint64_t)ios->softc->this_frac) >> 16);
435 if (new_ios < 1 && ios->l_value2 < ios->current) {
437 ios->l_value2++;
441 * If this a new accounting interval, discard any "unspent" ios
442 * granted in the previous interval. Otherwise add the new ios to
445 if ((ios->softc->total_ticks % ios->softc->quanta) == 0) {
446 ios->l_value1 = new_ios;
447 ios->l_value2 = 1;
449 ios->l_value1 += new_ios;
457 cam_iosched_iops_caniop(struct iop_stats *ios, struct bio *bp)
465 if (ios->current > 0 && ios->l_value1 <= 0)
471 cam_iosched_iops_iop(struct iop_stats *ios, struct bio *bp)
475 rv = cam_iosched_limiter_caniop(ios, bp);
477 ios->l_value1--;
483 cam_iosched_bw_init(struct iop_stats *ios)
486 /* ios->current is in kB/s, so scale to bytes */
487 ios->l_value1 = ios->current * 1000 / ios->softc->quanta;
493 cam_iosched_bw_tick(struct iop_stats *ios)
501 * then too bad, that's lost. Also, ios->current
508 bw = (int)((ios->current * 1000ull * (uint64_t)ios->softc->this_frac) >> 16);
509 if (ios->l_value1 < bw * 4)
510 ios->l_value1 += bw;
516 cam_iosched_bw_caniop(struct iop_stats *ios, struct bio *bp)
535 if (ios->current > 0 && ios->l_value1 <= 0)
543 cam_iosched_bw_iop(struct iop_stats *ios, struct bio *bp)
547 rv = cam_iosched_limiter_caniop(ios, bp);
549 ios->l_value1 -= bp->bio_length;
776 cam_iosched_iop_stats_init(struct cam_iosched_softc *isc, struct iop_stats *ios)
779 ios->limiter = none;
780 ios->in = 0;
781 ios->max = ios->current = 300000;
782 ios->min = 1;
783 ios->out = 0;
784 ios->errs = 0;
785 ios->pending = 0;
786 ios->queued = 0;
787 ios->total = 0;
788 ios->ema = 0;
789 ios->emvar = 0;
790 ios->softc = isc;
791 cam_iosched_limiter_init(ios);
798 struct iop_stats *ios;
803 ios = arg1;
804 isc = ios->softc;
805 value = ios->limiter;
821 ios->limiter = i;
822 error = cam_iosched_limiter_init(ios);
824 ios->limiter = value;
936 cam_iosched_iop_stats_sysctl_init(struct cam_iosched_softc *isc, struct iop_stats *ios, char *name)
941 ios->sysctl_tree = SYSCTL_ADD_NODE(&isc->sysctl_ctx,
944 n = SYSCTL_CHILDREN(ios->sysctl_tree);
945 ctx = &ios->sysctl_ctx;
949 &ios->ema,
953 &ios->emvar,
958 &ios->pending, 0,
962 &ios->total, 0,
966 &ios->queued, 0,
970 &ios->in, 0,
974 &ios->out, 0,
978 &ios->errs, 0,
983 ios, 0, cam_iosched_limiter_sysctl, "A",
987 &ios->min, 0,
991 &ios->max, 0,
995 &ios->current, 0,
1000 &ios->latencies, 0,
1006 cam_iosched_iop_stats_fini(struct iop_stats *ios)
1008 if (ios->sysctl_tree)
1009 if (sysctl_ctx_free(&ios->sysctl_ctx) != 0)