• Home
  • Raw
  • Download

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->inmem_pages = get_pages(sbi, F2FS_INMEM_PAGES); in update_general_status()
95 si->aw_cnt = sbi->atomic_files; in update_general_status()
96 si->vw_cnt = atomic_read(&sbi->vw_cnt); in update_general_status()
97 si->max_aw_cnt = atomic_read(&sbi->max_aw_cnt); in update_general_status()
98 si->max_vw_cnt = atomic_read(&sbi->max_vw_cnt); in update_general_status()
99 si->nr_dio_read = get_pages(sbi, F2FS_DIO_READ); in update_general_status()
100 si->nr_dio_write = get_pages(sbi, F2FS_DIO_WRITE); in update_general_status()
101 si->nr_wb_cp_data = get_pages(sbi, F2FS_WB_CP_DATA); in update_general_status()
102 si->nr_wb_data = get_pages(sbi, F2FS_WB_DATA); in update_general_status()
103 si->nr_rd_data = get_pages(sbi, F2FS_RD_DATA); in update_general_status()
104 si->nr_rd_node = get_pages(sbi, F2FS_RD_NODE); in update_general_status()
105 si->nr_rd_meta = get_pages(sbi, F2FS_RD_META); in update_general_status()
107 si->nr_flushed = in update_general_status()
109 si->nr_flushing = in update_general_status()
111 si->flush_list_empty = in update_general_status()
115 si->nr_discarded = in update_general_status()
117 si->nr_discarding = in update_general_status()
119 si->nr_discard_cmd = in update_general_status()
121 si->undiscard_blks = SM_I(sbi)->dcc_info->undiscard_blks; in update_general_status()
123 si->total_count = (int)sbi->user_block_count / sbi->blocks_per_seg; in update_general_status()
124 si->rsvd_segs = reserved_segments(sbi); in update_general_status()
125 si->overp_segs = overprovision_segments(sbi); in update_general_status()
126 si->valid_count = valid_user_blocks(sbi); in update_general_status()
127 si->discard_blks = discard_blocks(sbi); in update_general_status()
128 si->valid_node_count = valid_node_count(sbi); in update_general_status()
129 si->valid_inode_count = valid_inode_count(sbi); in update_general_status()
130 si->inline_xattr = atomic_read(&sbi->inline_xattr); in update_general_status()
131 si->inline_inode = atomic_read(&sbi->inline_inode); in update_general_status()
132 si->inline_dir = atomic_read(&sbi->inline_dir); in update_general_status()
133 si->compr_inode = atomic_read(&sbi->compr_inode); in update_general_status()
134 si->compr_blocks = atomic64_read(&sbi->compr_blocks); in update_general_status()
135 si->append = sbi->im[APPEND_INO].ino_num; in update_general_status()
136 si->update = sbi->im[UPDATE_INO].ino_num; in update_general_status()
137 si->orphans = sbi->im[ORPHAN_INO].ino_num; in update_general_status()
138 si->utilization = utilization(sbi); in update_general_status()
140 si->free_segs = free_segments(sbi); in update_general_status()
141 si->free_secs = free_sections(sbi); in update_general_status()
142 si->prefree_count = prefree_segments(sbi); in update_general_status()
143 si->dirty_count = dirty_segments(sbi); in update_general_status()
145 si->node_pages = NODE_MAPPING(sbi)->nrpages; in update_general_status()
147 si->meta_pages = META_MAPPING(sbi)->nrpages; in update_general_status()
148 si->nats = NM_I(sbi)->nat_cnt[TOTAL_NAT]; in update_general_status()
149 si->dirty_nats = NM_I(sbi)->nat_cnt[DIRTY_NAT]; in update_general_status()
150 si->sits = MAIN_SEGS(sbi); in update_general_status()
151 si->dirty_sits = SIT_I(sbi)->dirty_sentries; in update_general_status()
152 si->free_nids = NM_I(sbi)->nid_cnt[FREE_NID]; in update_general_status()
153 si->avail_nids = NM_I(sbi)->available_nids; in update_general_status()
154 si->alloc_nids = NM_I(sbi)->nid_cnt[PREALLOC_NID]; in update_general_status()
155 si->io_skip_bggc = sbi->io_skip_bggc; in update_general_status()
156 si->other_skip_bggc = sbi->other_skip_bggc; in update_general_status()
157 si->skipped_atomic_files[BG_GC] = sbi->skipped_atomic_files[BG_GC]; in update_general_status()
158 si->skipped_atomic_files[FG_GC] = sbi->skipped_atomic_files[FG_GC]; in update_general_status()
159 si->util_free = (int)(free_user_blocks(sbi) >> sbi->log_blocks_per_seg) in update_general_status()
162 si->util_valid = (int)(written_block_count(sbi) >> in update_general_status()
166 si->util_invalid = 50 - si->util_free - si->util_valid; in update_general_status()
169 si->curseg[i] = curseg->segno; in update_general_status()
170 si->cursec[i] = GET_SEC_FROM_SEG(sbi, curseg->segno); in update_general_status()
171 si->curzone[i] = GET_ZONE_FROM_SEC(sbi, si->cursec[i]); in update_general_status()
175 si->meta_count[i] = atomic_read(&sbi->meta_count[i]); in update_general_status()
178 si->dirty_seg[i] = 0; in update_general_status()
179 si->full_seg[i] = 0; in update_general_status()
180 si->valid_blks[i] = 0; in update_general_status()
191 si->full_seg[type]++; in update_general_status()
193 si->dirty_seg[type]++; in update_general_status()
194 si->valid_blks[type] += blks; in update_general_status()
198 si->segment_count[i] = sbi->segment_count[i]; in update_general_status()
199 si->block_count[i] = sbi->block_count[i]; in update_general_status()
202 si->inplace_count = atomic_read(&sbi->inplace_count); in update_general_status()
210 struct f2fs_stat_info *si = F2FS_STAT(sbi); in update_mem_info() local
213 if (si->base_mem) in update_mem_info()
217 si->base_mem = sizeof(struct f2fs_stat_info); in update_mem_info()
220 si->base_mem += sizeof(struct f2fs_sb_info) + sbi->sb->s_blocksize; in update_mem_info()
221 si->base_mem += 2 * sizeof(struct f2fs_inode_info); in update_mem_info()
222 si->base_mem += sizeof(*sbi->ckpt); in update_mem_info()
225 si->base_mem += sizeof(struct f2fs_sm_info); in update_mem_info()
228 si->base_mem += sizeof(struct sit_info); in update_mem_info()
229 si->base_mem += MAIN_SEGS(sbi) * sizeof(struct seg_entry); in update_mem_info()
230 si->base_mem += f2fs_bitmap_size(MAIN_SEGS(sbi)); in update_mem_info()
231 si->base_mem += 2 * SIT_VBLOCK_MAP_SIZE * MAIN_SEGS(sbi); in update_mem_info()
232 si->base_mem += SIT_VBLOCK_MAP_SIZE * MAIN_SEGS(sbi); in update_mem_info()
233 si->base_mem += SIT_VBLOCK_MAP_SIZE; in update_mem_info()
235 si->base_mem += MAIN_SECS(sbi) * sizeof(struct sec_entry); in update_mem_info()
236 si->base_mem += __bitmap_size(sbi, SIT_BITMAP); in update_mem_info()
239 si->base_mem += sizeof(struct free_segmap_info); in update_mem_info()
240 si->base_mem += f2fs_bitmap_size(MAIN_SEGS(sbi)); in update_mem_info()
241 si->base_mem += f2fs_bitmap_size(MAIN_SECS(sbi)); in update_mem_info()
244 si->base_mem += sizeof(struct curseg_info) * NR_CURSEG_TYPE; in update_mem_info()
245 si->base_mem += PAGE_SIZE * NR_CURSEG_TYPE; in update_mem_info()
248 si->base_mem += sizeof(struct dirty_seglist_info); in update_mem_info()
249 si->base_mem += NR_DIRTY_TYPE * f2fs_bitmap_size(MAIN_SEGS(sbi)); in update_mem_info()
250 si->base_mem += f2fs_bitmap_size(MAIN_SECS(sbi)); in update_mem_info()
253 si->base_mem += sizeof(struct f2fs_nm_info); in update_mem_info()
254 si->base_mem += __bitmap_size(sbi, NAT_BITMAP); in update_mem_info()
255 si->base_mem += (NM_I(sbi)->nat_bits_blocks << F2FS_BLKSIZE_BITS); in update_mem_info()
256 si->base_mem += NM_I(sbi)->nat_blocks * in update_mem_info()
258 si->base_mem += NM_I(sbi)->nat_blocks / 8; in update_mem_info()
259 si->base_mem += NM_I(sbi)->nat_blocks * sizeof(unsigned short); in update_mem_info()
262 si->cache_mem = 0; in update_mem_info()
266 si->cache_mem += sizeof(struct f2fs_gc_kthread); in update_mem_info()
270 si->cache_mem += sizeof(struct flush_cmd_control); in update_mem_info()
272 si->cache_mem += sizeof(struct discard_cmd_control); in update_mem_info()
273 si->cache_mem += sizeof(struct discard_cmd) * in update_mem_info()
278 si->cache_mem += (NM_I(sbi)->nid_cnt[FREE_NID] + in update_mem_info()
281 si->cache_mem += NM_I(sbi)->nat_cnt[TOTAL_NAT] * in update_mem_info()
283 si->cache_mem += NM_I(sbi)->nat_cnt[DIRTY_NAT] * in update_mem_info()
285 si->cache_mem += si->inmem_pages * sizeof(struct inmem_pages); in update_mem_info()
287 si->cache_mem += sbi->im[i].ino_num * sizeof(struct ino_entry); in update_mem_info()
288 si->cache_mem += atomic_read(&sbi->total_ext_tree) * in update_mem_info()
290 si->cache_mem += atomic_read(&sbi->total_ext_node) * in update_mem_info()
293 si->page_mem = 0; in update_mem_info()
296 si->page_mem += (unsigned long long)npages << PAGE_SHIFT; in update_mem_info()
300 si->page_mem += (unsigned long long)npages << PAGE_SHIFT; in update_mem_info()
306 struct f2fs_stat_info *si; in stat_show() local
312 list_for_each_entry(si, &f2fs_stat_list, stat_list) { in stat_show()
313 update_general_status(si->sbi); in stat_show()
316 si->sbi->sb->s_bdev, i++, in stat_show()
317 f2fs_readonly(si->sbi->sb) ? "RO": "RW", in stat_show()
318 is_set_ckpt_flags(si->sbi, CP_DISABLED_FLAG) ? in stat_show()
319 "Disabled": (f2fs_cp_error(si->sbi) ? "Error": "Good")); in stat_show()
321 si->sit_area_segs, si->nat_area_segs); in stat_show()
323 si->ssa_area_segs, si->main_area_segs); in stat_show()
325 si->overp_segs, si->rsvd_segs); in stat_show()
328 SIT_I(si->sbi)->mounted_time); in stat_show()
329 if (test_opt(si->sbi, DISCARD)) in stat_show()
331 si->utilization, si->valid_count, si->discard_blks); in stat_show()
334 si->utilization, si->valid_count); in stat_show()
337 si->valid_node_count, si->valid_inode_count); in stat_show()
339 si->valid_node_count - si->valid_inode_count, in stat_show()
340 si->valid_count - si->valid_node_count); in stat_show()
342 si->inline_xattr); in stat_show()
344 si->inline_inode); in stat_show()
346 si->inline_dir); in stat_show()
348 si->compr_inode, si->compr_blocks); in stat_show()
350 si->orphans, si->append, si->update); in stat_show()
352 si->main_area_segs, si->main_area_sections, in stat_show()
353 si->main_area_zones); in stat_show()
357 si->curseg[CURSEG_COLD_DATA], in stat_show()
358 si->cursec[CURSEG_COLD_DATA], in stat_show()
359 si->curzone[CURSEG_COLD_DATA], in stat_show()
360 si->dirty_seg[CURSEG_COLD_DATA], in stat_show()
361 si->full_seg[CURSEG_COLD_DATA], in stat_show()
362 si->valid_blks[CURSEG_COLD_DATA]); in stat_show()
364 si->curseg[CURSEG_WARM_DATA], in stat_show()
365 si->cursec[CURSEG_WARM_DATA], in stat_show()
366 si->curzone[CURSEG_WARM_DATA], in stat_show()
367 si->dirty_seg[CURSEG_WARM_DATA], in stat_show()
368 si->full_seg[CURSEG_WARM_DATA], in stat_show()
369 si->valid_blks[CURSEG_WARM_DATA]); in stat_show()
371 si->curseg[CURSEG_HOT_DATA], in stat_show()
372 si->cursec[CURSEG_HOT_DATA], in stat_show()
373 si->curzone[CURSEG_HOT_DATA], in stat_show()
374 si->dirty_seg[CURSEG_HOT_DATA], in stat_show()
375 si->full_seg[CURSEG_HOT_DATA], in stat_show()
376 si->valid_blks[CURSEG_HOT_DATA]); in stat_show()
378 si->curseg[CURSEG_HOT_NODE], in stat_show()
379 si->cursec[CURSEG_HOT_NODE], in stat_show()
380 si->curzone[CURSEG_HOT_NODE], in stat_show()
381 si->dirty_seg[CURSEG_HOT_NODE], in stat_show()
382 si->full_seg[CURSEG_HOT_NODE], in stat_show()
383 si->valid_blks[CURSEG_HOT_NODE]); in stat_show()
385 si->curseg[CURSEG_WARM_NODE], in stat_show()
386 si->cursec[CURSEG_WARM_NODE], in stat_show()
387 si->curzone[CURSEG_WARM_NODE], in stat_show()
388 si->dirty_seg[CURSEG_WARM_NODE], in stat_show()
389 si->full_seg[CURSEG_WARM_NODE], in stat_show()
390 si->valid_blks[CURSEG_WARM_NODE]); in stat_show()
392 si->curseg[CURSEG_COLD_NODE], in stat_show()
393 si->cursec[CURSEG_COLD_NODE], in stat_show()
394 si->curzone[CURSEG_COLD_NODE], in stat_show()
395 si->dirty_seg[CURSEG_COLD_NODE], in stat_show()
396 si->full_seg[CURSEG_COLD_NODE], in stat_show()
397 si->valid_blks[CURSEG_COLD_NODE]); in stat_show()
399 si->curseg[CURSEG_COLD_DATA_PINNED], in stat_show()
400 si->cursec[CURSEG_COLD_DATA_PINNED], in stat_show()
401 si->curzone[CURSEG_COLD_DATA_PINNED]); in stat_show()
403 si->curseg[CURSEG_ALL_DATA_ATGC], in stat_show()
404 si->cursec[CURSEG_ALL_DATA_ATGC], in stat_show()
405 si->curzone[CURSEG_ALL_DATA_ATGC]); in stat_show()
407 si->main_area_segs - si->dirty_count - in stat_show()
408 si->prefree_count - si->free_segs, in stat_show()
409 si->dirty_count); in stat_show()
411 si->prefree_count, si->free_segs, si->free_secs); in stat_show()
413 si->cp_count, si->bg_cp_count); in stat_show()
414 seq_printf(s, " - cp blocks : %u\n", si->meta_count[META_CP]); in stat_show()
416 si->meta_count[META_SIT]); in stat_show()
418 si->meta_count[META_NAT]); in stat_show()
420 si->meta_count[META_SSA]); in stat_show()
422 si->call_count, si->bg_gc); in stat_show()
424 si->data_segs, si->bg_data_segs); in stat_show()
426 si->node_segs, si->bg_node_segs); in stat_show()
427 seq_printf(s, "Try to move %d blocks (BG: %d)\n", si->tot_blks, in stat_show()
428 si->bg_data_blks + si->bg_node_blks); in stat_show()
429 seq_printf(s, " - data blocks : %d (%d)\n", si->data_blks, in stat_show()
430 si->bg_data_blks); in stat_show()
431 seq_printf(s, " - node blocks : %d (%d)\n", si->node_blks, in stat_show()
432 si->bg_node_blks); in stat_show()
434 si->skipped_atomic_files[BG_GC] + in stat_show()
435 si->skipped_atomic_files[FG_GC], in stat_show()
436 si->skipped_atomic_files[BG_GC]); in stat_show()
438 si->io_skip_bggc, si->other_skip_bggc); in stat_show()
441 si->hit_largest, si->hit_cached, in stat_show()
442 si->hit_rbtree); in stat_show()
444 !si->total_ext ? 0 : in stat_show()
445 div64_u64(si->hit_total * 100, si->total_ext), in stat_show()
446 si->hit_total, si->total_ext); in stat_show()
448 si->ext_tree, si->zombie_tree, si->ext_node); in stat_show()
451 si->nr_dio_read, si->nr_dio_write); in stat_show()
453 si->nr_rd_data, si->nr_rd_node, si->nr_rd_meta); in stat_show()
456 si->nr_wb_cp_data, si->nr_wb_data, in stat_show()
457 si->nr_flushing, si->nr_flushed, in stat_show()
458 si->flush_list_empty, in stat_show()
459 si->nr_discarding, si->nr_discarded, in stat_show()
460 si->nr_discard_cmd, si->undiscard_blks); in stat_show()
463 si->inmem_pages, si->aw_cnt, si->max_aw_cnt, in stat_show()
464 si->vw_cnt, si->max_vw_cnt); in stat_show()
466 si->ndirty_node, si->node_pages); in stat_show()
468 si->ndirty_dent, si->ndirty_dirs, si->ndirty_all); in stat_show()
470 si->ndirty_data, si->ndirty_files); in stat_show()
472 si->ndirty_qdata, si->nquota_files); in stat_show()
474 si->ndirty_meta, si->meta_pages); in stat_show()
476 si->ndirty_imeta); in stat_show()
478 si->dirty_nats, si->nats, si->dirty_sits, si->sits); in stat_show()
480 si->free_nids, si->avail_nids, si->alloc_nids); in stat_show()
485 for (j = 0; j < si->util_valid; j++) in stat_show()
489 for (j = 0; j < si->util_invalid; j++) in stat_show()
493 for (j = 0; j < si->util_free; j++) in stat_show()
496 seq_printf(s, "IPU: %u blocks\n", si->inplace_count); in stat_show()
498 si->block_count[SSR], si->segment_count[SSR]); in stat_show()
500 si->block_count[LFS], si->segment_count[LFS]); in stat_show()
503 f2fs_update_sit_info(si->sbi); in stat_show()
505 si->bimodal, si->avg_vblocks); in stat_show()
508 update_mem_info(si->sbi); in stat_show()
510 (si->base_mem + si->cache_mem + si->page_mem) >> 10); in stat_show()
512 si->base_mem >> 10); in stat_show()
514 si->cache_mem >> 10); in stat_show()
516 si->page_mem >> 10); in stat_show()
528 struct f2fs_stat_info *si; in f2fs_build_stats() local
532 si = f2fs_kzalloc(sbi, sizeof(struct f2fs_stat_info), GFP_KERNEL); in f2fs_build_stats()
533 if (!si) in f2fs_build_stats()
536 si->all_area_segs = le32_to_cpu(raw_super->segment_count); in f2fs_build_stats()
537 si->sit_area_segs = le32_to_cpu(raw_super->segment_count_sit); in f2fs_build_stats()
538 si->nat_area_segs = le32_to_cpu(raw_super->segment_count_nat); in f2fs_build_stats()
539 si->ssa_area_segs = le32_to_cpu(raw_super->segment_count_ssa); in f2fs_build_stats()
540 si->main_area_segs = le32_to_cpu(raw_super->segment_count_main); in f2fs_build_stats()
541 si->main_area_sections = le32_to_cpu(raw_super->section_count); in f2fs_build_stats()
542 si->main_area_zones = si->main_area_sections / in f2fs_build_stats()
544 si->sbi = sbi; in f2fs_build_stats()
545 sbi->stat_info = si; in f2fs_build_stats()
566 list_add_tail(&si->stat_list, &f2fs_stat_list); in f2fs_build_stats()
574 struct f2fs_stat_info *si = F2FS_STAT(sbi); in f2fs_destroy_stats() local
578 list_del(&si->stat_list); in f2fs_destroy_stats()
581 kfree(si); in f2fs_destroy_stats()