aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs/debug.c
Commit message (Collapse)AuthorAgeFilesLines
* f2fs: remove unneeded memory footprint accountingChao Yu2018-05-231-1/+0
| | | | | | | | | We forgot to remov memory footprint accounting of per-cpu type variables, fix it. Fixes: 35782b233f37 ("f2fs: remove percpu_count due to performance regression") Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: fix to show ino management cache size correctlyChao Yu2017-12-061-1/+1
| | | | | | | | | It needs to stat size of ino management cache with all type instead of orphan ino type. Fixes: 652be55162dc ("f2fs: show # of orphan inodes") Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: obsolete ALLOC_NID_LIST listChao Yu2017-12-061-4/+4
| | | | | | | | | | As Fan Li reported, there is no user traversing nid_list[ALLOC_NID_LIST] which is used for tracking preallocated nids. Let's drop it, and only track preallocated nids in free_nid_root radix-tree. Reported-by: Fan Li <fanofcode.li@samsung.com> Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show flush list status in sysfsChao Yu2017-12-061-1/+4
| | | | | | | This patch adds to show flush list status in sysfs. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show available_nids in f2fs/statusJaegeuk Kim2017-05-211-2/+3
| | | | | | This patch adds an entry in f2fs/status to show # of available nids. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: add undiscard blocks statChao Yu2017-05-211-2/+3
| | | | | | This patch adds to account undiscard blocks. Signed-off-by: Chao Yu <yuchao0@huawei.com>
* f2fs: clean up some macros in terms of GET_SEGNOJaegeuk Kim2017-05-211-3/+3
| | | | | | | | | | | This patch cleans several macros by introducing: - BLKS_PER_SEC - GET_SEC_FROM_SEG - GET_SEG_FROM_SEC - GET_ZONE_FROM_SEC - GET_ZONE_FROM_SEG Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: clean up get_valid_blocks with consistent parameterJaegeuk Kim2017-05-211-1/+1
| | | | | | This patch cleans up get_valid_blocks, which has no functional change. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: count discard command entryChao Yu2017-05-211-3/+9
| | | | | | | | | Adds to count discard command entry and show the number in debugfs, also fix to add cost of discard command cache into total comsumed memory footprint. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show issued flush/discard countChao Yu2017-05-211-8/+16
| | | | | | | Show historical count of flush command and discard command. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show the max number of volatile operationsChao Yu2017-05-211-2/+8
| | | | | | | | This patch adds to show the max number of volatile operations which are conducting concurrently. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: calculate the f2fs_stat_info into base_memKinglong Mee2017-05-211-1/+5
| | | | | | | The memory size of f2fs_stat_info also should be calculated. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: skip scanning free nid bitmap of full NAT blocksChao Yu2017-05-211-0/+1
| | | | | | | | | | | | This patch adds to account free nids for each NAT blocks, and while scanning all free nid bitmap, do check count and skip lookuping in full NAT block. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/node.c
* f2fs: introduce free nid bitmapChao Yu2017-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | In scenario of intensively node allocation, free nids will be ran out soon, then it needs to stop to load free nids by traversing NAT blocks, in worse case, if NAT blocks does not be cached in memory, it generates IOs which slows down our foreground operations. In order to speed up node allocation, in this patch we introduce a new free_nid_bitmap array, so there is an bitmap table for each NAT block, Once the NAT block is loaded, related bitmap cache will be switched on, and bitmap will be set during traversing nat entries in NAT block, later we can query and update nid usage status in memory completely. With such implementation, I expect performance of node allocation can be improved in the long-term after filesystem image is mounted. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: include/linux/f2fs_fs.h
* f2fs: add bitmaps for empty or full NAT blocksJaegeuk Kim2017-04-131-0/+1
| | | | | | | | | | | | | | | | | This patches adds bitmaps to represent empty or full NAT blocks containing free nid entries. If we can find valid crc|cp_ver in the last block of checkpoint pack, we'll use these bitmaps when building free nids. In order to avoid checkpointing burden, up-to-date bitmaps will be flushed only during umount time. So, normally we can get this gain, but when power-cut happens, we rely on fsck.f2fs which recovers this bitmap again. After this patch, we build free nids from nid #0 at mount time to make more full NAT blocks, but in runtime, we check empty NAT blocks to load free nids without loading any NAT pages from disk. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show # of APPEND and UPDATE inodesJaegeuk Kim2017-04-131-2/+4
| | | | | | This patch shows cached # of APPEND and UPDATE inode entries. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show # of on-going flush and discard biosJaegeuk Kim2017-04-131-2/+9
| | | | | | | | | This patch adds stat information for flush and discard commands. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/segment.c
* f2fs: factor out discard command info into discard_cmd_controlJaegeuk Kim2017-04-131-0/+2
| | | | | | This patch adds discard_cmd_control with the existing discarding controls. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: reorganize stat informationJaegeuk Kim2017-04-131-4/+4
| | | | | | This patch modifies stat information more clearly. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: clean up flush/discard command namingsJaegeuk Kim2017-04-131-1/+1
| | | | | | | | | This patch simply cleans up the names for flush/discard commands. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/segment.c
* f2fs: show the max number of atomic operationsJaegeuk Kim2017-04-131-0/+7
| | | | | | | | This patch adds to show the max number of atomic operations which are conducting concurrently. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: set ->owner for debugfs status file's file_operationsNicolai Stange2017-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The struct file_operations instance serving the f2fs/status debugfs file lacks an initialization of its ->owner. This means that although that file might have been opened, the f2fs module can still get removed. Any further operation on that opened file, releasing included, will cause accesses to unmapped memory. Indeed, Mike Marshall reported the following: BUG: unable to handle kernel paging request at ffffffffa0307430 IP: [<ffffffff8132a224>] full_proxy_release+0x24/0x90 <...> Call Trace: [] __fput+0xdf/0x1d0 [] ____fput+0xe/0x10 [] task_work_run+0x8e/0xc0 [] do_exit+0x2ae/0xae0 [] ? __audit_syscall_entry+0xae/0x100 [] ? syscall_trace_enter+0x1ca/0x310 [] do_group_exit+0x44/0xc0 [] SyS_exit_group+0x14/0x20 [] do_syscall_64+0x61/0x150 [] entry_SYSCALL64_slow_path+0x25/0x25 <...> ---[ end trace f22ae883fa3ea6b8 ]--- Fixing recursive fault but reboot is needed! Fix this by initializing the f2fs/status file_operations' ->owner with THIS_MODULE. This will allow debugfs to grab a reference to the f2fs module upon any open on that file, thus preventing it from getting removed. Fixes: 902829aa0b72 ("f2fs: move proc files to debugfs") Reported-by: Mike Marshall <hubcap@omnibond.com> Reported-by: Martin Brandenburg <martin@omnibond.com> Cc: stable@vger.kernel.org Signed-off-by: Nicolai Stange <nicstange@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: don't wait writeback for datas during checkpointChao Yu2017-04-131-3/+4
| | | | | | | | | | | | | | | | | | | Normally, while committing checkpoint, we will wait on all pages to be writebacked no matter the page is data or metadata, so in scenario where there are lots of data IO being submitted with metadata, we may suffer long latency for waiting writeback during checkpoint. Indeed, we only care about persistence for pages with metadata, but not pages with data, as file system consistent are only related to metadate, so in order to avoid encountering long latency in above scenario, let's recognize and reference metadata in submitted IOs, wait writeback only for metadatas. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/data.c
* f2fs: remove percpu_count due to performance regressionJaegeuk Kim2017-04-131-6/+6
| | | | | | | | | | This patch removes percpu_count usage due to performance regression in iozone. Fixes: 523be8a6b3 ("f2fs: use percpu_counter for page counters") Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/super.c
* f2fs: split free nid listChao Yu2017-04-131-4/+7
| | | | | | | | | | | | | | | | | | | During free nid allocation, in order to do preallocation, we will tag free nid entry as allocated one and still leave it in free nid list, for other allocators who want to grab free nids, it needs to traverse the free nid list for lookup. It becomes overhead in scenario of allocating free nid intensively by multithreads. This patch splits free nid list to two list: {free,alloc}_nid_list, to keep free nids and preallocated free nids separately, after that, traverse latency will be gone, besides split nid_cnt for separate statistic. Additionally, introduce __insert_nid_to_list and __remove_nid_from_list for cleanup. Signed-off-by: Chao Yu <yuchao0@huawei.com> [Jaegeuk Kim: modify f2fs_bug_on to avoid needless branches] Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show dirty inode numberChao Yu2017-04-131-0/+3
| | | | | | | This patch enables showing dirty inode number in procfs. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: add discard info to sys entry of f2fs statusYunlei He2017-04-131-2/+8
| | | | | | | This patch add discard block count to sys entry of f2fs status Signed-off-by: Yunlei He <heyunlei@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: do not use discard_map for hard disksJaegeuk Kim2017-04-131-1/+3
| | | | | | We don't need to keep discard_map, if disk does not support discard command. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: flush inode metadata when checkpoint is doingJaegeuk Kim2017-04-131-2/+3
| | | | | | | This patch registers all the inodes which have dirty metadata to sync when checkpoint is doing. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: adjust other changesJaegeuk Kim2017-04-131-3/+3
| | | | | | | | This patch changes: - PAGE_CACHE_* - inode_lock Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: use percpu_counter for page countersJaegeuk Kim2017-04-131-5/+6
| | | | | | | This patch substitutes percpu_counter for atomic_counter when counting various types of pages. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: use bio count instead of F2FS_WRITEBACK page countJaegeuk Kim2017-04-131-3/+3
| | | | | | This can reduce page counting overhead. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show # of orphan inodesJaegeuk Kim2017-04-131-1/+4
| | | | | | This adds debug information for # of orphan inodes. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: show current mount statusJaegeuk Kim2017-04-131-2/+3
| | | | | | This patch remains the current mount status to f2fs status info. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: monitor the number of background checkpointJaegeuk Kim2017-04-131-1/+2
| | | | | | This patch adds to show the number of background checkpoint. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: monitor zombie_tree countJaegeuk Kim2017-04-131-2/+3
| | | | | | This patch adds an entry to show the number of zombie extent_tree. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: use atomic variable for total_extent_treeJaegeuk Kim2017-04-131-2/+3
| | | | | | | It would be better to use atomic variable for total_extent_tree. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: stat dirty regular/symlink inodesChao Yu2017-04-131-1/+5
| | | | | | | Add to stat dirty regular and symlink inode for showing in debugfs. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: introduce dirty list node in inode infoChao Yu2017-04-131-1/+0
| | | | | | | | | | | | Add a new dirt list node member in inode info for linking the inode to global dirty list in superblock, instead of old implementation which allocate slab cache memory as an entry to inode. It avoids memory pressure due to slab cache allocation, and also makes codes more clean. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: use sbi->blocks_per_seg to avoid unnecessary calculationChao Yu2017-04-131-1/+1
| | | | | | | | Use sbi->blocks_per_seg directly to avoid unnecessary calculation when using 1 << sbi->log_blocks_per_seg. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: report error of f2fs_create_root_statsChao Yu2017-04-131-2/+5
| | | | | | | f2fs_create_root_stats can fail due to no memory, report it to user. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: catch up to v4.4-rc1Jaegeuk Kim2017-04-131-77/+156
| | | | | | | | | | | | | | | | The last patch is: commit beaa57dd986d4f398728c060692fc2452895cfd8 Author: Chao Yu <chao2.yu@samsung.com> Date: Thu Oct 22 18:24:12 2015 +0800 f2fs: fix to skip shrinking extent nodes In f2fs_shrink_extent_tree we should stop shrink flow if we have already shrunk enough nodes in extent cache. Change-Id: I704e8e1a29a871604c63689d67c9005ab3ac6e5c Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* first commitMeizu OpenSource2016-08-151-0/+353