Lines Matching full:si
34 struct f2fs_stat_info *si = F2FS_STAT(sbi); in f2fs_update_sit_info() local
55 si->bimodal = div64_u64(bimodal, dist); in f2fs_update_sit_info()
56 if (si->dirty_count) in f2fs_update_sit_info()
57 si->avg_vblocks = div_u64(total_vblocks, ndirty); in f2fs_update_sit_info()
59 si->avg_vblocks = 0; in f2fs_update_sit_info()
65 struct f2fs_stat_info *si = F2FS_STAT(sbi); in update_general_status() local
70 si->main_area_segs = le32_to_cpu(raw_super->segment_count_main); in update_general_status()
71 si->main_area_sections = le32_to_cpu(raw_super->section_count); in update_general_status()
72 si->main_area_zones = si->main_area_sections / in update_general_status()
76 si->hit_largest = atomic64_read(&sbi->read_hit_largest); in update_general_status()
77 si->hit_cached = atomic64_read(&sbi->read_hit_cached); in update_general_status()
78 si->hit_rbtree = atomic64_read(&sbi->read_hit_rbtree); in update_general_status()
79 si->hit_total = si->hit_largest + si->hit_cached + si->hit_rbtree; in update_general_status()
80 si->total_ext = atomic64_read(&sbi->total_hit_ext); in update_general_status()
81 si->ext_tree = atomic_read(&sbi->total_ext_tree); in update_general_status()
82 si->zombie_tree = atomic_read(&sbi->total_zombie_tree); in update_general_status()
83 si->ext_node = atomic_read(&sbi->total_ext_node); in update_general_status()
84 si->ndirty_node = get_pages(sbi, F2FS_DIRTY_NODES); in update_general_status()
85 si->ndirty_dent = get_pages(sbi, F2FS_DIRTY_DENTS); in update_general_status()
86 si->ndirty_meta = get_pages(sbi, F2FS_DIRTY_META); in update_general_status()
87 si->ndirty_data = get_pages(sbi, F2FS_DIRTY_DATA); in update_general_status()
88 si->ndirty_qdata = get_pages(sbi, F2FS_DIRTY_QDATA); in update_general_status()
89 si->ndirty_imeta = get_pages(sbi, F2FS_DIRTY_IMETA); in update_general_status()
90 si->ndirty_dirs = sbi->ndirty_inode[DIR_INODE]; in update_general_status()
91 si->ndirty_files = sbi->ndirty_inode[FILE_INODE]; in update_general_status()
92 si->nquota_files = sbi->nquota_files; in update_general_status()
93 si->ndirty_all = sbi->ndirty_inode[DIRTY_META]; in update_general_status()
94 si->aw_cnt = atomic_read(&sbi->atomic_files); in update_general_status()
95 si->max_aw_cnt = atomic_read(&sbi->max_aw_cnt); in update_general_status()
96 si->nr_dio_read = get_pages(sbi, F2FS_DIO_READ); in update_general_status()
97 si->nr_dio_write = get_pages(sbi, F2FS_DIO_WRITE); in update_general_status()
98 si->nr_wb_cp_data = get_pages(sbi, F2FS_WB_CP_DATA); in update_general_status()
99 si->nr_wb_data = get_pages(sbi, F2FS_WB_DATA); in update_general_status()
100 si->nr_rd_data = get_pages(sbi, F2FS_RD_DATA); in update_general_status()
101 si->nr_rd_node = get_pages(sbi, F2FS_RD_NODE); in update_general_status()
102 si->nr_rd_meta = get_pages(sbi, F2FS_RD_META); in update_general_status()
104 si->nr_flushed = in update_general_status()
106 si->nr_flushing = in update_general_status()
108 si->flush_list_empty = in update_general_status()
112 si->nr_discarded = in update_general_status()
114 si->nr_discarding = in update_general_status()
116 si->nr_discard_cmd = in update_general_status()
118 si->undiscard_blks = SM_I(sbi)->dcc_info->undiscard_blks; in update_general_status()
120 si->nr_issued_ckpt = atomic_read(&sbi->cprc_info.issued_ckpt); in update_general_status()
121 si->nr_total_ckpt = atomic_read(&sbi->cprc_info.total_ckpt); in update_general_status()
122 si->nr_queued_ckpt = atomic_read(&sbi->cprc_info.queued_ckpt); in update_general_status()
124 si->cur_ckpt_time = sbi->cprc_info.cur_time; in update_general_status()
125 si->peak_ckpt_time = sbi->cprc_info.peak_time; in update_general_status()
127 si->total_count = (int)sbi->user_block_count / sbi->blocks_per_seg; in update_general_status()
128 si->rsvd_segs = reserved_segments(sbi); in update_general_status()
129 si->overp_segs = overprovision_segments(sbi); in update_general_status()
130 si->valid_count = valid_user_blocks(sbi); in update_general_status()
131 si->discard_blks = discard_blocks(sbi); in update_general_status()
132 si->valid_node_count = valid_node_count(sbi); in update_general_status()
133 si->valid_inode_count = valid_inode_count(sbi); in update_general_status()
134 si->inline_xattr = atomic_read(&sbi->inline_xattr); in update_general_status()
135 si->inline_inode = atomic_read(&sbi->inline_inode); in update_general_status()
136 si->inline_dir = atomic_read(&sbi->inline_dir); in update_general_status()
137 si->compr_inode = atomic_read(&sbi->compr_inode); in update_general_status()
138 si->swapfile_inode = atomic_read(&sbi->swapfile_inode); in update_general_status()
139 si->compr_blocks = atomic64_read(&sbi->compr_blocks); in update_general_status()
140 si->append = sbi->im[APPEND_INO].ino_num; in update_general_status()
141 si->update = sbi->im[UPDATE_INO].ino_num; in update_general_status()
142 si->orphans = sbi->im[ORPHAN_INO].ino_num; in update_general_status()
143 si->utilization = utilization(sbi); in update_general_status()
145 si->free_segs = free_segments(sbi); in update_general_status()
146 si->free_secs = free_sections(sbi); in update_general_status()
147 si->prefree_count = prefree_segments(sbi); in update_general_status()
148 si->dirty_count = dirty_segments(sbi); in update_general_status()
150 si->node_pages = NODE_MAPPING(sbi)->nrpages; in update_general_status()
152 si->meta_pages = META_MAPPING(sbi)->nrpages; in update_general_status()
155 si->compress_pages = COMPRESS_MAPPING(sbi)->nrpages; in update_general_status()
156 si->compress_page_hit = atomic_read(&sbi->compress_page_hit); in update_general_status()
159 si->nats = NM_I(sbi)->nat_cnt[TOTAL_NAT]; in update_general_status()
160 si->dirty_nats = NM_I(sbi)->nat_cnt[DIRTY_NAT]; in update_general_status()
161 si->sits = MAIN_SEGS(sbi); in update_general_status()
162 si->dirty_sits = SIT_I(sbi)->dirty_sentries; in update_general_status()
163 si->free_nids = NM_I(sbi)->nid_cnt[FREE_NID]; in update_general_status()
164 si->avail_nids = NM_I(sbi)->available_nids; in update_general_status()
165 si->alloc_nids = NM_I(sbi)->nid_cnt[PREALLOC_NID]; in update_general_status()
166 si->io_skip_bggc = sbi->io_skip_bggc; in update_general_status()
167 si->other_skip_bggc = sbi->other_skip_bggc; in update_general_status()
168 si->util_free = (int)(free_user_blocks(sbi) >> sbi->log_blocks_per_seg) in update_general_status()
171 si->util_valid = (int)(written_block_count(sbi) >> in update_general_status()
175 si->util_invalid = 50 - si->util_free - si->util_valid; in update_general_status()
179 si->curseg[i] = curseg->segno; in update_general_status()
180 si->cursec[i] = GET_SEC_FROM_SEG(sbi, curseg->segno); in update_general_status()
181 si->curzone[i] = GET_ZONE_FROM_SEC(sbi, si->cursec[i]); in update_general_status()
185 si->meta_count[i] = atomic_read(&sbi->meta_count[i]); in update_general_status()
188 si->dirty_seg[i] = 0; in update_general_status()
189 si->full_seg[i] = 0; in update_general_status()
190 si->valid_blks[i] = 0; in update_general_status()
201 si->full_seg[type]++; in update_general_status()
203 si->dirty_seg[type]++; in update_general_status()
204 si->valid_blks[type] += blks; in update_general_status()
208 si->segment_count[i] = sbi->segment_count[i]; in update_general_status()
209 si->block_count[i] = sbi->block_count[i]; in update_general_status()
212 si->inplace_count = atomic_read(&sbi->inplace_count); in update_general_status()
220 struct f2fs_stat_info *si = F2FS_STAT(sbi); in update_mem_info() local
223 if (si->base_mem) in update_mem_info()
227 si->base_mem = sizeof(struct f2fs_stat_info); in update_mem_info()
230 si->base_mem += sizeof(struct f2fs_sb_info) + sbi->sb->s_blocksize; in update_mem_info()
231 si->base_mem += 2 * sizeof(struct f2fs_inode_info); in update_mem_info()
232 si->base_mem += sizeof(*sbi->ckpt); in update_mem_info()
235 si->base_mem += sizeof(struct f2fs_sm_info); in update_mem_info()
238 si->base_mem += sizeof(struct sit_info); in update_mem_info()
239 si->base_mem += MAIN_SEGS(sbi) * sizeof(struct seg_entry); in update_mem_info()
240 si->base_mem += f2fs_bitmap_size(MAIN_SEGS(sbi)); in update_mem_info()
241 si->base_mem += 2 * SIT_VBLOCK_MAP_SIZE * MAIN_SEGS(sbi); in update_mem_info()
242 si->base_mem += SIT_VBLOCK_MAP_SIZE * MAIN_SEGS(sbi); in update_mem_info()
243 si->base_mem += SIT_VBLOCK_MAP_SIZE; in update_mem_info()
245 si->base_mem += MAIN_SECS(sbi) * sizeof(struct sec_entry); in update_mem_info()
246 si->base_mem += __bitmap_size(sbi, SIT_BITMAP); in update_mem_info()
249 si->base_mem += sizeof(struct free_segmap_info); in update_mem_info()
250 si->base_mem += f2fs_bitmap_size(MAIN_SEGS(sbi)); in update_mem_info()
251 si->base_mem += f2fs_bitmap_size(MAIN_SECS(sbi)); in update_mem_info()
254 si->base_mem += sizeof(struct curseg_info) * NR_CURSEG_TYPE; in update_mem_info()
255 si->base_mem += PAGE_SIZE * NR_CURSEG_TYPE; in update_mem_info()
258 si->base_mem += sizeof(struct dirty_seglist_info); in update_mem_info()
259 si->base_mem += NR_DIRTY_TYPE * f2fs_bitmap_size(MAIN_SEGS(sbi)); in update_mem_info()
260 si->base_mem += f2fs_bitmap_size(MAIN_SECS(sbi)); in update_mem_info()
263 si->base_mem += sizeof(struct f2fs_nm_info); in update_mem_info()
264 si->base_mem += __bitmap_size(sbi, NAT_BITMAP); in update_mem_info()
265 si->base_mem += (NM_I(sbi)->nat_bits_blocks << F2FS_BLKSIZE_BITS); in update_mem_info()
266 si->base_mem += NM_I(sbi)->nat_blocks * in update_mem_info()
268 si->base_mem += NM_I(sbi)->nat_blocks / 8; in update_mem_info()
269 si->base_mem += NM_I(sbi)->nat_blocks * sizeof(unsigned short); in update_mem_info()
272 si->cache_mem = 0; in update_mem_info()
276 si->cache_mem += sizeof(struct f2fs_gc_kthread); in update_mem_info()
280 si->cache_mem += sizeof(struct flush_cmd_control); in update_mem_info()
282 si->cache_mem += sizeof(struct discard_cmd_control); in update_mem_info()
283 si->cache_mem += sizeof(struct discard_cmd) * in update_mem_info()
288 si->cache_mem += (NM_I(sbi)->nid_cnt[FREE_NID] + in update_mem_info()
291 si->cache_mem += NM_I(sbi)->nat_cnt[TOTAL_NAT] * in update_mem_info()
293 si->cache_mem += NM_I(sbi)->nat_cnt[DIRTY_NAT] * in update_mem_info()
296 si->cache_mem += sbi->im[i].ino_num * sizeof(struct ino_entry); in update_mem_info()
297 si->cache_mem += atomic_read(&sbi->total_ext_tree) * in update_mem_info()
299 si->cache_mem += atomic_read(&sbi->total_ext_node) * in update_mem_info()
302 si->page_mem = 0; in update_mem_info()
306 si->page_mem += (unsigned long long)npages << PAGE_SHIFT; in update_mem_info()
311 si->page_mem += (unsigned long long)npages << PAGE_SHIFT; in update_mem_info()
316 si->page_mem += (unsigned long long)npages << PAGE_SHIFT; in update_mem_info()
341 struct f2fs_stat_info *si; in stat_show() local
346 list_for_each_entry(si, &f2fs_stat_list, stat_list) { in stat_show()
347 update_general_status(si->sbi); in stat_show()
350 si->sbi->sb->s_bdev, i++, in stat_show()
351 f2fs_readonly(si->sbi->sb) ? "RO" : "RW", in stat_show()
352 is_set_ckpt_flags(si->sbi, CP_DISABLED_FLAG) ? in stat_show()
353 "Disabled" : (f2fs_cp_error(si->sbi) ? "Error" : "Good")); in stat_show()
354 if (si->sbi->s_flag) { in stat_show()
356 for_each_set_bit(j, &si->sbi->s_flag, 32) in stat_show()
361 si->sit_area_segs, si->nat_area_segs); in stat_show()
363 si->ssa_area_segs, si->main_area_segs); in stat_show()
365 si->overp_segs, si->rsvd_segs); in stat_show()
368 SIT_I(si->sbi)->mounted_time); in stat_show()
369 if (test_opt(si->sbi, DISCARD)) in stat_show()
371 si->utilization, si->valid_count, si->discard_blks); in stat_show()
374 si->utilization, si->valid_count); in stat_show()
377 si->valid_node_count, si->valid_inode_count); in stat_show()
379 si->valid_node_count - si->valid_inode_count, in stat_show()
380 si->valid_count - si->valid_node_count); in stat_show()
382 si->inline_xattr); in stat_show()
384 si->inline_inode); in stat_show()
386 si->inline_dir); in stat_show()
388 si->compr_inode, si->compr_blocks); in stat_show()
390 si->swapfile_inode); in stat_show()
392 si->orphans, si->append, si->update); in stat_show()
394 si->main_area_segs, si->main_area_sections, in stat_show()
395 si->main_area_zones); in stat_show()
399 si->curseg[CURSEG_COLD_DATA], in stat_show()
400 si->cursec[CURSEG_COLD_DATA], in stat_show()
401 si->curzone[CURSEG_COLD_DATA], in stat_show()
402 si->dirty_seg[CURSEG_COLD_DATA], in stat_show()
403 si->full_seg[CURSEG_COLD_DATA], in stat_show()
404 si->valid_blks[CURSEG_COLD_DATA]); in stat_show()
406 si->curseg[CURSEG_WARM_DATA], in stat_show()
407 si->cursec[CURSEG_WARM_DATA], in stat_show()
408 si->curzone[CURSEG_WARM_DATA], in stat_show()
409 si->dirty_seg[CURSEG_WARM_DATA], in stat_show()
410 si->full_seg[CURSEG_WARM_DATA], in stat_show()
411 si->valid_blks[CURSEG_WARM_DATA]); in stat_show()
413 si->curseg[CURSEG_HOT_DATA], in stat_show()
414 si->cursec[CURSEG_HOT_DATA], in stat_show()
415 si->curzone[CURSEG_HOT_DATA], in stat_show()
416 si->dirty_seg[CURSEG_HOT_DATA], in stat_show()
417 si->full_seg[CURSEG_HOT_DATA], in stat_show()
418 si->valid_blks[CURSEG_HOT_DATA]); in stat_show()
420 si->curseg[CURSEG_HOT_NODE], in stat_show()
421 si->cursec[CURSEG_HOT_NODE], in stat_show()
422 si->curzone[CURSEG_HOT_NODE], in stat_show()
423 si->dirty_seg[CURSEG_HOT_NODE], in stat_show()
424 si->full_seg[CURSEG_HOT_NODE], in stat_show()
425 si->valid_blks[CURSEG_HOT_NODE]); in stat_show()
427 si->curseg[CURSEG_WARM_NODE], in stat_show()
428 si->cursec[CURSEG_WARM_NODE], in stat_show()
429 si->curzone[CURSEG_WARM_NODE], in stat_show()
430 si->dirty_seg[CURSEG_WARM_NODE], in stat_show()
431 si->full_seg[CURSEG_WARM_NODE], in stat_show()
432 si->valid_blks[CURSEG_WARM_NODE]); in stat_show()
434 si->curseg[CURSEG_COLD_NODE], in stat_show()
435 si->cursec[CURSEG_COLD_NODE], in stat_show()
436 si->curzone[CURSEG_COLD_NODE], in stat_show()
437 si->dirty_seg[CURSEG_COLD_NODE], in stat_show()
438 si->full_seg[CURSEG_COLD_NODE], in stat_show()
439 si->valid_blks[CURSEG_COLD_NODE]); in stat_show()
441 si->curseg[CURSEG_COLD_DATA_PINNED], in stat_show()
442 si->cursec[CURSEG_COLD_DATA_PINNED], in stat_show()
443 si->curzone[CURSEG_COLD_DATA_PINNED]); in stat_show()
445 si->curseg[CURSEG_ALL_DATA_ATGC], in stat_show()
446 si->cursec[CURSEG_ALL_DATA_ATGC], in stat_show()
447 si->curzone[CURSEG_ALL_DATA_ATGC]); in stat_show()
449 si->main_area_segs - si->dirty_count - in stat_show()
450 si->prefree_count - si->free_segs, in stat_show()
451 si->dirty_count); in stat_show()
453 si->prefree_count, si->free_segs, si->free_secs); in stat_show()
455 si->cp_count, si->bg_cp_count); in stat_show()
456 seq_printf(s, " - cp blocks : %u\n", si->meta_count[META_CP]); in stat_show()
458 si->meta_count[META_SIT]); in stat_show()
460 si->meta_count[META_NAT]); in stat_show()
462 si->meta_count[META_SSA]); in stat_show()
465 si->nr_queued_ckpt, si->nr_issued_ckpt, in stat_show()
466 si->nr_total_ckpt, si->cur_ckpt_time, in stat_show()
467 si->peak_ckpt_time); in stat_show()
469 si->call_count, si->bg_gc); in stat_show()
471 si->data_segs, si->bg_data_segs); in stat_show()
473 si->node_segs, si->bg_node_segs); in stat_show()
478 si->sbi->gc_reclaimed_segs[GC_NORMAL], in stat_show()
479 si->sbi->gc_reclaimed_segs[GC_IDLE_CB], in stat_show()
480 si->sbi->gc_reclaimed_segs[GC_IDLE_GREEDY], in stat_show()
481 si->sbi->gc_reclaimed_segs[GC_IDLE_AT], in stat_show()
482 si->sbi->gc_reclaimed_segs[GC_URGENT_HIGH], in stat_show()
483 si->sbi->gc_reclaimed_segs[GC_URGENT_MID], in stat_show()
484 si->sbi->gc_reclaimed_segs[GC_URGENT_LOW]); in stat_show()
485 seq_printf(s, "Try to move %d blocks (BG: %d)\n", si->tot_blks, in stat_show()
486 si->bg_data_blks + si->bg_node_blks); in stat_show()
487 seq_printf(s, " - data blocks : %d (%d)\n", si->data_blks, in stat_show()
488 si->bg_data_blks); in stat_show()
489 seq_printf(s, " - node blocks : %d (%d)\n", si->node_blks, in stat_show()
490 si->bg_node_blks); in stat_show()
492 si->io_skip_bggc, si->other_skip_bggc); in stat_show()
495 si->hit_largest, si->hit_cached, in stat_show()
496 si->hit_rbtree); in stat_show()
498 !si->total_ext ? 0 : in stat_show()
499 div64_u64(si->hit_total * 100, si->total_ext), in stat_show()
500 si->hit_total, si->total_ext); in stat_show()
502 si->ext_tree, si->zombie_tree, si->ext_node); in stat_show()
505 si->nr_dio_read, si->nr_dio_write); in stat_show()
507 si->nr_rd_data, si->nr_rd_node, si->nr_rd_meta); in stat_show()
510 si->nr_wb_cp_data, si->nr_wb_data, in stat_show()
511 si->nr_flushing, si->nr_flushed, in stat_show()
512 si->flush_list_empty, in stat_show()
513 si->nr_discarding, si->nr_discarded, in stat_show()
514 si->nr_discard_cmd, si->undiscard_blks); in stat_show()
516 si->aw_cnt, si->max_aw_cnt); in stat_show()
517 seq_printf(s, " - compress: %4d, hit:%8d\n", si->compress_pages, si->compress_page_hit); in stat_show()
519 si->ndirty_node, si->node_pages); in stat_show()
521 si->ndirty_dent, si->ndirty_dirs, si->ndirty_all); in stat_show()
523 si->ndirty_data, si->ndirty_files); in stat_show()
525 si->ndirty_qdata, si->nquota_files); in stat_show()
527 si->ndirty_meta, si->meta_pages); in stat_show()
529 si->ndirty_imeta); in stat_show()
532 &si->sbi->rf_node_block_count)); in stat_show()
534 si->dirty_nats, si->nats, si->dirty_sits, si->sits); in stat_show()
536 si->free_nids, si->avail_nids, si->alloc_nids); in stat_show()
541 for (j = 0; j < si->util_valid; j++) in stat_show()
545 for (j = 0; j < si->util_invalid; j++) in stat_show()
549 for (j = 0; j < si->util_free; j++) in stat_show()
552 seq_printf(s, "IPU: %u blocks\n", si->inplace_count); in stat_show()
554 si->block_count[SSR], si->segment_count[SSR]); in stat_show()
556 si->block_count[LFS], si->segment_count[LFS]); in stat_show()
559 f2fs_update_sit_info(si->sbi); in stat_show()
561 si->bimodal, si->avg_vblocks); in stat_show()
564 update_mem_info(si->sbi); in stat_show()
566 (si->base_mem + si->cache_mem + si->page_mem) >> 10); in stat_show()
568 si->base_mem >> 10); in stat_show()
570 si->cache_mem >> 10); in stat_show()
572 si->page_mem >> 10); in stat_show()
584 struct f2fs_stat_info *si; in f2fs_build_stats() local
588 si = f2fs_kzalloc(sbi, sizeof(struct f2fs_stat_info), GFP_KERNEL); in f2fs_build_stats()
589 if (!si) in f2fs_build_stats()
592 si->all_area_segs = le32_to_cpu(raw_super->segment_count); in f2fs_build_stats()
593 si->sit_area_segs = le32_to_cpu(raw_super->segment_count_sit); in f2fs_build_stats()
594 si->nat_area_segs = le32_to_cpu(raw_super->segment_count_nat); in f2fs_build_stats()
595 si->ssa_area_segs = le32_to_cpu(raw_super->segment_count_ssa); in f2fs_build_stats()
596 si->main_area_segs = le32_to_cpu(raw_super->segment_count_main); in f2fs_build_stats()
597 si->main_area_sections = le32_to_cpu(raw_super->section_count); in f2fs_build_stats()
598 si->main_area_zones = si->main_area_sections / in f2fs_build_stats()
600 si->sbi = sbi; in f2fs_build_stats()
601 sbi->stat_info = si; in f2fs_build_stats()
622 list_add_tail(&si->stat_list, &f2fs_stat_list); in f2fs_build_stats()
630 struct f2fs_stat_info *si = F2FS_STAT(sbi); in f2fs_destroy_stats() local
634 list_del(&si->stat_list); in f2fs_destroy_stats()
637 kfree(si); in f2fs_destroy_stats()