07 Apr, 2014
3 commits
-
If we remove a file that has inline data after mount, our statistics turns to
inaccurate.cat /sys/kernel/debug/f2fs/status
- Inline_data Inode: 4294967295Let's add stat_inc_inline_inode() to stat inline info of the file when lookup.
Change log from v1:
o stat in f2fs_lookup() instead of in do_read_inode() for excluding wrong stat.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
Before setting the acl, call posix_acl_valid() to check if it is
valid or not.Signed-off-by: zhangzhen
Signed-off-by: Jaegeuk Kim -
Some storage devices show relatively high latencies to complete cache_flush
commands, even though their normal IO speed is prettry much high. In such
the case, it needs to merge cache_flush commands as much as possible to avoid
issuing them redundantly.
So, this patch introduces a mount option, "-o flush_merge", to mitigate such
the overhead.If this option is enabled by user, F2FS merges the cache_flush commands and then
issues just one cache_flush on behalf of them. Once the single command is
finished, F2FS sends a completion signal to all the pending threads.Note that, this option can be used under a workload consisting of very intensive
concurrent fsync calls, while the storage handles cache_flush commands slowly.Signed-off-by: Jaegeuk Kim
02 Apr, 2014
4 commits
-
In the f2fs_wait_on_page_writeback, io->bio should be covered by io_rwsem.
Otherwise, the bio pointer can become a dangling pointer due to data races.Signed-off-by: Jaegeuk Kim
-
We should unlock page in ->readpage() path and also should unlock & release page
in error path of ->write_begin() to avoid deadlock or memory leak.
So let's add release code to fix the problem when we fail to read inline data.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
This patch use list_for_each_entry{_safe} instead of list_for_each{_safe} for
simplfying code.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
Move kmem_cache_free out of spinlock protection region for better performance.
Change log from v1:
o remove spinlock protection for kmem_cache_free in destroy_node_manager
suggested by Jaegeuk Kim.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim
01 Apr, 2014
3 commits
-
In f2fs_setxattr we have limit this attribute name length, so we should also
check it in f2fs_getxattr to avoid useless lookup caused by invalid name length.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
This patch introduce is_merged_page() to check whether current page is merged
in f2fs bio cache. When page is not in cache, we can avoid submitting bio cache,
resulting in having more chance to merge pages.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
During the cleaing of node segments, F2FS can get errored node blocks due to
data race between node page lock and its valid bitmap operations.
In that case, it needs to return an error to skip such the obsolete block copy.Signed-off-by: Jaegeuk Kim
20 Mar, 2014
9 commits
-
This patch should resolve the following possible bug.
RECLAIM_FS-ON-W at:
mark_held_locks+0xb9/0x140
lockdep_trace_alloc+0x85/0xf0
__kmalloc+0x53/0x1d0
read_all_xattrs+0x3d1/0x3f0 [f2fs]
f2fs_getxattr+0x4f/0x100 [f2fs]
f2fs_get_acl+0x4c/0x290 [f2fs]
get_acl+0x4f/0x80
posix_acl_create+0x72/0x180
f2fs_init_acl+0x29/0xcc [f2fs]
__f2fs_add_link+0x259/0x710 [f2fs]
f2fs_create+0xad/0x1c0 [f2fs]
vfs_create+0xed/0x150
do_last+0xd36/0xed0
path_openat+0xc5/0x680
do_filp_open+0x43/0xa0
do_sys_open+0x13c/0x230
SyS_creat+0x1e/0x20
system_call_fastpath+0x16/0x1bSigned-off-by: Jaegeuk Kim
-
If multiple redundant fsync calls are triggered, we don't need to write its
node pages with fsync mark continuously.So, this patch adds FI_NEED_FSYNC to track whether the latest node block is
written with the fsync mark or not.
If the mark was set, a new fsync doesn't need to write a node block.
Otherwise, we should do a new node block with the mark for roll-forward
recovery.Signed-off-by: Jaegeuk Kim
-
This patch introduces fi->i_sem to protect fi's info that includes xattr_ver,
pino, i_nlink.
This enables to remove i_mutex during f2fs_sync_file, resulting in performance
improvement when a number of fsync calls are triggered from many concurrent
threads.Signed-off-by: Jaegeuk Kim
-
It is more reasonable to determine the reclaiming rate of prefree segments
according to the volume size, which is set to 5% by default.
For example, if the volume is 128GB, the prefree segments are reclaimed
when the number reaches to 6.4GB.Signed-off-by: Jaegeuk Kim
-
This patch adds missing dir_level documentation.
Signed-off-by: Jaegeuk Kim
-
The NM_WOUT_THRESHOLD is now obsolete since f2fs starts to control on a basis
of the memory footprint.Signed-off-by: Jaegeuk Kim
-
This patch introduces ram_thresh, a sysfs entry, which controls the memory
footprint used by the free nid list and the nat cache.Previously, the free nid list was controlled by MAX_FREE_NIDS, while the nat
cache was managed by NM_WOUT_THRESHOLD.
However, this approach cannot be applied dynamically according to the system.So, this patch adds ram_thresh that users can specify the threshold, which is
in order of 1 / 1024.
For example, if the total ram size is 4GB and the value is set to 10 by default,
f2fs tries to control the number of free nids and nat caches not to consume over
10 * (4GB / 1024) = 10MB.Signed-off-by: Jaegeuk Kim
-
The try_to_free_nats should not receive the negative nr_shrink.
Otherwise, it can drop all the nat entries by the while loop.Signed-off-by: Jaegeuk Kim
-
If a page is on writeback, f2fs can face with deadlock due to under writepages.
This is caused by merging IOs inside f2fs, so if it comes to detect, let's throw
merged IOs, which is implemented by f2fs_wait_on_page_writeback.Signed-off-by: Jaegeuk Kim
18 Mar, 2014
8 commits
-
This patch introduces nr_pages_to_write to align page writes to the segment
or other operational unit size, which can be tuned according to the system
environment.Signed-off-by: Jaegeuk Kim
-
This patch increases pages_skipped when skipping writepages.
Signed-off-by: Jaegeuk Kim
-
This patch introduces nr_pages_to_skip(sbi, type) to determine writepages can
be skipped.
The dentry, node, and meta pages can be conrolled by F2FS without breaking the
FS consistency.Signed-off-by: Jaegeuk Kim
-
The get_dirty_dents gives us the number of dirty dentry pages.
Signed-off-by: Jaegeuk Kim
-
Previously 'background_gc={on***,off***}' is being parsed as correct option,
with this patch we cloud fix the trivial bug in mount process.Change log from v1:
o need to check length of parameter suggested by Jaegeuk Kim.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
We should return error number of read_normal_summaries instead of -EINVAL when
read_normal_summaries failed.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
This patch introduces a help function f2fs_has_xattr_block for better
readability.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
The original segment_info's show looks out-of-format:
cat /proc/fs/f2fs/loop0/segment_info
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 512
512 512 512 512 512 512 512 0 0 512
348 0 263 0 0 512 0 0 512 512
512 512 0 512 512 512 512 512 512 512
512 512 511 328 512 512 512 512 512 512
512 512 512 512 512 512 512 0 0 175Let's fix this and show type for each segment.
cat /proc/fs/f2fs/loop0/segment_info
format: segment_type|valid_blocks
segment_type(0:HD, 1:WD, 2:CD, 3:HN, 4:WN, 5:CN)
0 2|0 1|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0
10 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0
20 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0
30 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0
40 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0 0|0
50 3|0 3|0 3|0 3|0 3|0 3|0 3|0 0|0 3|0 3|0
60 3|0 3|0 3|0 3|0 3|0 3|0 3|0 3|0 3|0 3|512
70 3|512 3|512 3|512 3|512 3|512 3|512 3|512 3|0 3|0 3|512
80 3|0 3|0 3|0 3|0 3|0 3|512 3|0 3|0 3|512 3|512
90 3|512 0|512 3|274 0|512 0|512 0|512 0|512 0|512 0|512 3|512
100 3|512 0|512 3|511 0|328 3|512 0|512 0|512 3|512 0|512 0|512
110 0|512 0|512 0|512 0|512 0|512 0|512 0|512 5|0 4|0 3|512Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim
12 Mar, 2014
2 commits
-
Upper bound checking of ino should be added to f2fs_nfs_get_inode, so unneeded
process before do_read_inode in f2fs_iget could be avoided when ino is invalid.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
This patch introduces a help function f2fs_has_inline_xattr for better
readability.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim
11 Mar, 2014
1 commit
-
Previously we do not recover inline xattr data of inode after power-cut, so
inline xattr data may be lost.
We should recover the data during the roll-forward process.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim
10 Mar, 2014
4 commits
-
Previously, we ra_sum_pages to pre-read contiguous pages as more
as possible, and if we fail to alloc more pages, an ENOMEM error
will be reported upstream, even though we have alloced some pages
yet. In fact, we can use the available pages to do the job partly,
and continue the rest in the following circle. Only reporting ENOMEM
upstream if we really can not alloc any available page.And another fix is ignoring dealing with the following pages if an
EIO occurs when reading page from page_list.Signed-off-by: Gu Zheng
Reviewed-by: Chao Yu
[Jaegeuk Kim: modify the flow for better neat code]
Signed-off-by: Jaegeuk Kim -
The original segment_info's show is a bit out-of-format:
[root@guz Demoes]# cat /proc/fs/f2fs/loop0/segment_info
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
......
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 1 [root@guz Demoes]#so we fix it here for better legibility.
[root@guz Demoes]# cat /proc/fs/f2fs/loop0/segment_info
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
......
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 1
[root@guz Demoes]#Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim -
Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim -
Integrated a couple of minor changes for better readability suggested by
Chao Yu.Signed-off-by: Gu Zheng
Reviewed-by: Chao Yu
Signed-off-by: Jaegeuk Kim
05 Mar, 2014
1 commit
-
This patch includes a simple fix to adjust coding style.
Signed-off-by: Jaegeuk Kim
03 Mar, 2014
1 commit
-
This patch fixes performance regression of dbench reported by
Alex .This issue was revealed by Phoronix tests results:
http://www.phoronix.com/scan.php?page=article&item=linux_314_ssdfs&num=2It turns out that we need to assign WRITE_SYNC to the node writes, if
fsync is triggered.The performance numbers are like below, which is measured by Alex.
1. 355MB/s ext4
2. 225MB/s f2fs : WRITE for node writes
3. 525MB/s f2fs : WRITE_SYNC for node writesReported-And-Tested-by: Alex .
Signed-off-by: Jaegeuk Kim
28 Feb, 2014
1 commit
-
We should de-account dirty counters for page when redirty in ->writepage().
Wu Fengguang described in 'commit 971767caf632190f77a40b4011c19948232eed75':
"writeback: fix dirtied pages accounting on redirty
De-account the accumulative dirty counters on page redirty.Page redirties (very common in ext4) will introduce mismatch between
counters (a) and (b)a) NR_DIRTIED, BDI_DIRTIED, tsk->nr_dirtied
b) NR_WRITTEN, BDI_WRITTENThis will introduce systematic errors in balanced_rate and result in
dirty page position errors (ie. the dirty pages are no longer balanced
around the global/bdi setpoints)."Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim
27 Feb, 2014
3 commits
-
This patch use existing macro F2FS_INODE/NEXT_FREE_BLKADDR to clean up some
codes.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
If there are multi segments in one section, we will read those SSA blocks which
have contiguous address one by one in f2fs_gc. It may lost performance, let's
read ahead SSA blocks by merge multi read request.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
This patch adds an sysfs entry to control dir_level used by the large directory.
The description of this entry is:
dir_level This parameter controls the directory level to
support large directory. If a directory has a
number of files, it can reduce the file lookup
latency by increasing this dir_level value.
Otherwise, it needs to decrease this value to
reduce the space overhead. The default value is 0.Signed-off-by: Jaegeuk Kim