Lines Matching full:shared
185 static int dm_stat_in_flight(struct dm_stat_shared *shared) in dm_stat_in_flight() argument
187 return atomic_read(&shared->in_flight[READ]) + in dm_stat_in_flight()
188 atomic_read(&shared->in_flight[WRITE]); in dm_stat_in_flight()
210 struct dm_stat_shared *shared; in dm_stats_cleanup() local
216 shared = &s->stat_shared[ni]; in dm_stats_cleanup()
217 if (WARN_ON(dm_stat_in_flight(shared))) { in dm_stats_cleanup()
224 atomic_read(&shared->in_flight[READ]), in dm_stats_cleanup()
225 atomic_read(&shared->in_flight[WRITE])); in dm_stats_cleanup()
483 static void dm_stat_round(struct dm_stat *s, struct dm_stat_shared *shared, in dm_stat_round() argument
497 difference = now - shared->stamp; in dm_stat_round()
501 in_flight_read = (unsigned)atomic_read(&shared->in_flight[READ]); in dm_stat_round()
502 in_flight_write = (unsigned)atomic_read(&shared->in_flight[WRITE]); in dm_stat_round()
511 shared->stamp = now; in dm_stat_round()
519 struct dm_stat_shared *shared = &s->stat_shared[entry]; in dm_stat_for_entry() local
546 dm_stat_round(s, shared, p); in dm_stat_for_entry()
547 atomic_inc(&shared->in_flight[idx]); in dm_stat_for_entry()
550 dm_stat_round(s, shared, p); in dm_stat_for_entry()
551 atomic_dec(&shared->in_flight[idx]); in dm_stat_for_entry()
669 static void __dm_stat_init_temporary_percpu_totals(struct dm_stat_shared *shared, in __dm_stat_init_temporary_percpu_totals() argument
677 dm_stat_round(s, shared, p); in __dm_stat_init_temporary_percpu_totals()
680 shared->tmp.sectors[READ] = 0; in __dm_stat_init_temporary_percpu_totals()
681 shared->tmp.sectors[WRITE] = 0; in __dm_stat_init_temporary_percpu_totals()
682 shared->tmp.ios[READ] = 0; in __dm_stat_init_temporary_percpu_totals()
683 shared->tmp.ios[WRITE] = 0; in __dm_stat_init_temporary_percpu_totals()
684 shared->tmp.merges[READ] = 0; in __dm_stat_init_temporary_percpu_totals()
685 shared->tmp.merges[WRITE] = 0; in __dm_stat_init_temporary_percpu_totals()
686 shared->tmp.ticks[READ] = 0; in __dm_stat_init_temporary_percpu_totals()
687 shared->tmp.ticks[WRITE] = 0; in __dm_stat_init_temporary_percpu_totals()
688 shared->tmp.io_ticks[READ] = 0; in __dm_stat_init_temporary_percpu_totals()
689 shared->tmp.io_ticks[WRITE] = 0; in __dm_stat_init_temporary_percpu_totals()
690 shared->tmp.io_ticks_total = 0; in __dm_stat_init_temporary_percpu_totals()
691 shared->tmp.time_in_queue = 0; in __dm_stat_init_temporary_percpu_totals()
694 memset(shared->tmp.histogram, 0, (s->n_histogram_entries + 1) * sizeof(unsigned long long)); in __dm_stat_init_temporary_percpu_totals()
698 shared->tmp.sectors[READ] += READ_ONCE(p->sectors[READ]); in __dm_stat_init_temporary_percpu_totals()
699 shared->tmp.sectors[WRITE] += READ_ONCE(p->sectors[WRITE]); in __dm_stat_init_temporary_percpu_totals()
700 shared->tmp.ios[READ] += READ_ONCE(p->ios[READ]); in __dm_stat_init_temporary_percpu_totals()
701 shared->tmp.ios[WRITE] += READ_ONCE(p->ios[WRITE]); in __dm_stat_init_temporary_percpu_totals()
702 shared->tmp.merges[READ] += READ_ONCE(p->merges[READ]); in __dm_stat_init_temporary_percpu_totals()
703 shared->tmp.merges[WRITE] += READ_ONCE(p->merges[WRITE]); in __dm_stat_init_temporary_percpu_totals()
704 shared->tmp.ticks[READ] += READ_ONCE(p->ticks[READ]); in __dm_stat_init_temporary_percpu_totals()
705 shared->tmp.ticks[WRITE] += READ_ONCE(p->ticks[WRITE]); in __dm_stat_init_temporary_percpu_totals()
706 shared->tmp.io_ticks[READ] += READ_ONCE(p->io_ticks[READ]); in __dm_stat_init_temporary_percpu_totals()
707 shared->tmp.io_ticks[WRITE] += READ_ONCE(p->io_ticks[WRITE]); in __dm_stat_init_temporary_percpu_totals()
708 shared->tmp.io_ticks_total += READ_ONCE(p->io_ticks_total); in __dm_stat_init_temporary_percpu_totals()
709 shared->tmp.time_in_queue += READ_ONCE(p->time_in_queue); in __dm_stat_init_temporary_percpu_totals()
713 shared->tmp.histogram[i] += READ_ONCE(p->histogram[i]); in __dm_stat_init_temporary_percpu_totals()
722 struct dm_stat_shared *shared; in __dm_stat_clear() local
726 shared = &s->stat_shared[x]; in __dm_stat_clear()
728 __dm_stat_init_temporary_percpu_totals(shared, s, x); in __dm_stat_clear()
731 p->sectors[READ] -= shared->tmp.sectors[READ]; in __dm_stat_clear()
732 p->sectors[WRITE] -= shared->tmp.sectors[WRITE]; in __dm_stat_clear()
733 p->ios[READ] -= shared->tmp.ios[READ]; in __dm_stat_clear()
734 p->ios[WRITE] -= shared->tmp.ios[WRITE]; in __dm_stat_clear()
735 p->merges[READ] -= shared->tmp.merges[READ]; in __dm_stat_clear()
736 p->merges[WRITE] -= shared->tmp.merges[WRITE]; in __dm_stat_clear()
737 p->ticks[READ] -= shared->tmp.ticks[READ]; in __dm_stat_clear()
738 p->ticks[WRITE] -= shared->tmp.ticks[WRITE]; in __dm_stat_clear()
739 p->io_ticks[READ] -= shared->tmp.io_ticks[READ]; in __dm_stat_clear()
740 p->io_ticks[WRITE] -= shared->tmp.io_ticks[WRITE]; in __dm_stat_clear()
741 p->io_ticks_total -= shared->tmp.io_ticks_total; in __dm_stat_clear()
742 p->time_in_queue -= shared->tmp.time_in_queue; in __dm_stat_clear()
749 p->histogram[i] -= shared->tmp.histogram[i]; in __dm_stat_clear()
808 struct dm_stat_shared *shared; in dm_stats_print() local
835 shared = &s->stat_shared[x]; in dm_stats_print()
840 __dm_stat_init_temporary_percpu_totals(shared, s, x); in dm_stats_print()
845 shared->tmp.ios[READ], in dm_stats_print()
846 shared->tmp.merges[READ], in dm_stats_print()
847 shared->tmp.sectors[READ], in dm_stats_print()
848 dm_jiffies_to_msec64(s, shared->tmp.ticks[READ]), in dm_stats_print()
849 shared->tmp.ios[WRITE], in dm_stats_print()
850 shared->tmp.merges[WRITE], in dm_stats_print()
851 shared->tmp.sectors[WRITE], in dm_stats_print()
852 dm_jiffies_to_msec64(s, shared->tmp.ticks[WRITE]), in dm_stats_print()
853 dm_stat_in_flight(shared), in dm_stats_print()
854 dm_jiffies_to_msec64(s, shared->tmp.io_ticks_total), in dm_stats_print()
855 dm_jiffies_to_msec64(s, shared->tmp.time_in_queue), in dm_stats_print()
856 dm_jiffies_to_msec64(s, shared->tmp.io_ticks[READ]), in dm_stats_print()
857 dm_jiffies_to_msec64(s, shared->tmp.io_ticks[WRITE])); in dm_stats_print()
861 DMEMIT("%s%llu", !i ? " " : ":", shared->tmp.histogram[i]); in dm_stats_print()