• Home
  • Raw
  • Download

Lines Matching refs:pblk

24 static ssize_t pblk_sysfs_luns_show(struct pblk *pblk, char *page)  in pblk_sysfs_luns_show()  argument
26 struct nvm_tgt_dev *dev = pblk->dev; in pblk_sysfs_luns_show()
35 rlun = &pblk->luns[i]; in pblk_sysfs_luns_show()
51 static ssize_t pblk_sysfs_rate_limiter(struct pblk *pblk, char *page) in pblk_sysfs_rate_limiter() argument
57 free_blocks = pblk_rl_nr_free_blks(&pblk->rl); in pblk_sysfs_rate_limiter()
58 free_user_blocks = pblk_rl_nr_user_free_blks(&pblk->rl); in pblk_sysfs_rate_limiter()
59 rb_user_max = pblk->rl.rb_user_max; in pblk_sysfs_rate_limiter()
60 rb_user_cnt = atomic_read(&pblk->rl.rb_user_cnt); in pblk_sysfs_rate_limiter()
61 rb_gc_max = pblk->rl.rb_gc_max; in pblk_sysfs_rate_limiter()
62 rb_gc_cnt = atomic_read(&pblk->rl.rb_gc_cnt); in pblk_sysfs_rate_limiter()
63 rb_budget = pblk->rl.rb_budget; in pblk_sysfs_rate_limiter()
64 rb_state = pblk->rl.rb_state; in pblk_sysfs_rate_limiter()
66 total_blocks = pblk->rl.total_blocks; in pblk_sysfs_rate_limiter()
76 pblk->rl.high, in pblk_sysfs_rate_limiter()
80 READ_ONCE(pblk->rl.rb_user_active)); in pblk_sysfs_rate_limiter()
83 static ssize_t pblk_sysfs_gc_state_show(struct pblk *pblk, char *page) in pblk_sysfs_gc_state_show() argument
87 pblk_gc_sysfs_state_show(pblk, &gc_enabled, &gc_active); in pblk_sysfs_gc_state_show()
92 static ssize_t pblk_sysfs_stats(struct pblk *pblk, char *page) in pblk_sysfs_stats() argument
98 atomic_long_read(&pblk->read_failed), in pblk_sysfs_stats()
99 atomic_long_read(&pblk->read_high_ecc), in pblk_sysfs_stats()
100 atomic_long_read(&pblk->read_empty), in pblk_sysfs_stats()
101 atomic_long_read(&pblk->read_failed_gc), in pblk_sysfs_stats()
102 atomic_long_read(&pblk->write_failed), in pblk_sysfs_stats()
103 atomic_long_read(&pblk->erase_failed)); in pblk_sysfs_stats()
108 static ssize_t pblk_sysfs_write_buffer(struct pblk *pblk, char *page) in pblk_sysfs_write_buffer() argument
110 return pblk_rb_sysfs(&pblk->rwb, page); in pblk_sysfs_write_buffer()
113 static ssize_t pblk_sysfs_ppaf(struct pblk *pblk, char *page) in pblk_sysfs_ppaf() argument
115 struct nvm_tgt_dev *dev = pblk->dev; in pblk_sysfs_ppaf()
120 struct nvm_addrf_12 *ppaf = (struct nvm_addrf_12 *)&pblk->addrf; in pblk_sysfs_ppaf()
125 pblk->addrf_len, in pblk_sysfs_ppaf()
142 struct nvm_addrf *ppaf = &pblk->addrf; in pblk_sysfs_ppaf()
147 pblk->addrf_len, in pblk_sysfs_ppaf()
164 static ssize_t pblk_sysfs_lines(struct pblk *pblk, char *page) in pblk_sysfs_lines() argument
166 struct nvm_tgt_dev *dev = pblk->dev; in pblk_sysfs_lines()
168 struct pblk_line_meta *lm = &pblk->lm; in pblk_sysfs_lines()
169 struct pblk_line_mgmt *l_mg = &pblk->l_mg; in pblk_sysfs_lines()
278 pblk_err(pblk, "corrupted free line list:%d/%d\n", in pblk_sysfs_lines()
298 atomic_read(&pblk->gc.read_inflight_gc)); in pblk_sysfs_lines()
304 atomic_read(&pblk->inflight_io)); in pblk_sysfs_lines()
309 static ssize_t pblk_sysfs_lines_info(struct pblk *pblk, char *page) in pblk_sysfs_lines_info() argument
311 struct nvm_tgt_dev *dev = pblk->dev; in pblk_sysfs_lines_info()
313 struct pblk_line_meta *lm = &pblk->lm; in pblk_sysfs_lines_info()
337 static ssize_t pblk_sysfs_get_sec_per_write(struct pblk *pblk, char *page) in pblk_sysfs_get_sec_per_write() argument
339 return snprintf(page, PAGE_SIZE, "%d\n", pblk->sec_per_write); in pblk_sysfs_get_sec_per_write()
368 static ssize_t pblk_sysfs_get_write_amp_mileage(struct pblk *pblk, char *page) in pblk_sysfs_get_write_amp_mileage() argument
370 return pblk_get_write_amp(atomic64_read(&pblk->user_wa), in pblk_sysfs_get_write_amp_mileage()
371 atomic64_read(&pblk->gc_wa), atomic64_read(&pblk->pad_wa), in pblk_sysfs_get_write_amp_mileage()
375 static ssize_t pblk_sysfs_get_write_amp_trip(struct pblk *pblk, char *page) in pblk_sysfs_get_write_amp_trip() argument
378 atomic64_read(&pblk->user_wa) - pblk->user_rst_wa, in pblk_sysfs_get_write_amp_trip()
379 atomic64_read(&pblk->gc_wa) - pblk->gc_rst_wa, in pblk_sysfs_get_write_amp_trip()
380 atomic64_read(&pblk->pad_wa) - pblk->pad_rst_wa, page); in pblk_sysfs_get_write_amp_trip()
393 static ssize_t pblk_sysfs_get_padding_dist(struct pblk *pblk, char *page) in pblk_sysfs_get_padding_dist() argument
398 int buckets = pblk->min_write_pgs - 1; in pblk_sysfs_get_padding_dist()
401 total = atomic64_read(&pblk->nr_flush) - pblk->nr_flush_rst; in pblk_sysfs_get_padding_dist()
412 total_buckets += atomic64_read(&pblk->pad_dist[i]); in pblk_sysfs_get_padding_dist()
420 p = bucket_percentage(atomic64_read(&pblk->pad_dist[i]), in pblk_sysfs_get_padding_dist()
431 static ssize_t pblk_sysfs_stats_debug(struct pblk *pblk, char *page) in pblk_sysfs_stats_debug() argument
435 atomic_long_read(&pblk->inflight_writes), in pblk_sysfs_stats_debug()
436 atomic_long_read(&pblk->inflight_reads), in pblk_sysfs_stats_debug()
437 atomic_long_read(&pblk->req_writes), in pblk_sysfs_stats_debug()
438 (u64)atomic64_read(&pblk->nr_flush), in pblk_sysfs_stats_debug()
439 atomic_long_read(&pblk->padded_writes), in pblk_sysfs_stats_debug()
440 atomic_long_read(&pblk->padded_wb), in pblk_sysfs_stats_debug()
441 atomic_long_read(&pblk->sub_writes), in pblk_sysfs_stats_debug()
442 atomic_long_read(&pblk->sync_writes), in pblk_sysfs_stats_debug()
443 atomic_long_read(&pblk->recov_writes), in pblk_sysfs_stats_debug()
444 atomic_long_read(&pblk->recov_gc_writes), in pblk_sysfs_stats_debug()
445 atomic_long_read(&pblk->recov_gc_reads), in pblk_sysfs_stats_debug()
446 atomic_long_read(&pblk->cache_reads), in pblk_sysfs_stats_debug()
447 atomic_long_read(&pblk->sync_reads)); in pblk_sysfs_stats_debug()
451 static ssize_t pblk_sysfs_gc_force(struct pblk *pblk, const char *page, in pblk_sysfs_gc_force() argument
464 pblk_gc_sysfs_force(pblk, force); in pblk_sysfs_gc_force()
469 static ssize_t pblk_sysfs_set_sec_per_write(struct pblk *pblk, in pblk_sysfs_set_sec_per_write() argument
482 if (!pblk_is_oob_meta_supported(pblk)) { in pblk_sysfs_set_sec_per_write()
489 if (sec_per_write < pblk->min_write_pgs in pblk_sysfs_set_sec_per_write()
490 || sec_per_write > pblk->max_write_pgs in pblk_sysfs_set_sec_per_write()
491 || sec_per_write % pblk->min_write_pgs != 0) in pblk_sysfs_set_sec_per_write()
494 pblk_set_sec_per_write(pblk, sec_per_write); in pblk_sysfs_set_sec_per_write()
499 static ssize_t pblk_sysfs_set_write_amp_trip(struct pblk *pblk, in pblk_sysfs_set_write_amp_trip() argument
515 pblk->user_rst_wa = atomic64_read(&pblk->user_wa); in pblk_sysfs_set_write_amp_trip()
516 pblk->pad_rst_wa = atomic64_read(&pblk->pad_wa); in pblk_sysfs_set_write_amp_trip()
517 pblk->gc_rst_wa = atomic64_read(&pblk->gc_wa); in pblk_sysfs_set_write_amp_trip()
523 static ssize_t pblk_sysfs_set_padding_dist(struct pblk *pblk, in pblk_sysfs_set_padding_dist() argument
528 int buckets = pblk->min_write_pgs - 1; in pblk_sysfs_set_padding_dist()
542 atomic64_set(&pblk->pad_dist[i], 0); in pblk_sysfs_set_padding_dist()
544 pblk->nr_flush_rst = atomic64_read(&pblk->nr_flush); in pblk_sysfs_set_padding_dist()
644 struct pblk *pblk = container_of(kobj, struct pblk, kobj); in pblk_sysfs_show() local
647 return pblk_sysfs_rate_limiter(pblk, buf); in pblk_sysfs_show()
649 return pblk_sysfs_luns_show(pblk, buf); in pblk_sysfs_show()
651 return pblk_sysfs_gc_state_show(pblk, buf); in pblk_sysfs_show()
653 return pblk_sysfs_stats(pblk, buf); in pblk_sysfs_show()
655 return pblk_sysfs_write_buffer(pblk, buf); in pblk_sysfs_show()
657 return pblk_sysfs_ppaf(pblk, buf); in pblk_sysfs_show()
659 return pblk_sysfs_lines(pblk, buf); in pblk_sysfs_show()
661 return pblk_sysfs_lines_info(pblk, buf); in pblk_sysfs_show()
663 return pblk_sysfs_get_sec_per_write(pblk, buf); in pblk_sysfs_show()
665 return pblk_sysfs_get_write_amp_mileage(pblk, buf); in pblk_sysfs_show()
667 return pblk_sysfs_get_write_amp_trip(pblk, buf); in pblk_sysfs_show()
669 return pblk_sysfs_get_padding_dist(pblk, buf); in pblk_sysfs_show()
672 return pblk_sysfs_stats_debug(pblk, buf); in pblk_sysfs_show()
680 struct pblk *pblk = container_of(kobj, struct pblk, kobj); in pblk_sysfs_store() local
683 return pblk_sysfs_gc_force(pblk, buf, len); in pblk_sysfs_store()
685 return pblk_sysfs_set_sec_per_write(pblk, buf, len); in pblk_sysfs_store()
687 return pblk_sysfs_set_write_amp_trip(pblk, buf, len); in pblk_sysfs_store()
689 return pblk_sysfs_set_padding_dist(pblk, buf, len); in pblk_sysfs_store()
705 struct pblk *pblk = tdisk->private_data; in pblk_sysfs_init() local
706 struct device *parent_dev = disk_to_dev(pblk->disk); in pblk_sysfs_init()
709 ret = kobject_init_and_add(&pblk->kobj, &pblk_ktype, in pblk_sysfs_init()
713 pblk_err(pblk, "could not register\n"); in pblk_sysfs_init()
717 kobject_uevent(&pblk->kobj, KOBJ_ADD); in pblk_sysfs_init()
723 struct pblk *pblk = tdisk->private_data; in pblk_sysfs_exit() local
725 kobject_uevent(&pblk->kobj, KOBJ_REMOVE); in pblk_sysfs_exit()
726 kobject_del(&pblk->kobj); in pblk_sysfs_exit()
727 kobject_put(&pblk->kobj); in pblk_sysfs_exit()