02 Apr, 2014
2 commits
-
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
20 Mar, 2014
1 commit
-
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
4 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
10 Mar, 2014
1 commit
-
Signed-off-by: Gu Zheng
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
1 commit
-
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
17 Feb, 2014
4 commits
-
This patch shows the counts of checkpoint in f2fs' status.
Signed-off-by: Changman Lee
Signed-off-by: Jaegeuk Kim -
This patch help us to cleanup the readahead code by merging ra_{sit,nat}_pages
function into ra_meta_pages.
Additionally the new function is used to readahead cp block in
recover_orphan_inodes.Change log from v1:
o fix a deadloop bug pointed by Jaegeuk Kim.Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
This patch integrates inode_[inc|dec]_dirty_dents with inc_page_count to remove
redundant calls.Signed-off-by: Jaegeuk Kim
-
If f2fs entered errorneous checkpoint status, it should skip writing meta
pages instead of redirtying the pages out.
Otherwise, it cannot unmount the partition even though f2fs is under read-only
status.Signed-off-by: Jaegeuk Kim
22 Jan, 2014
3 commits
-
This patch adds NODE_MAPPING which is similar as META_MAPPING introduced by
Gu Zheng.Cc: Gu Zheng
Signed-off-by: Jaegeuk Kim -
As the orphan_blocks may be max to 504, so it is not security
and rigorous to store such a large array in the kernel stack
as Dan Carpenter said.
In fact, grab_meta_page has locked the page in the page cache,
and we can use find_get_page() to fetch the page safely in the
downstream, so we can remove the page array directly.Reported-by: Dan Carpenter
Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim -
Introduce help function META_MAPPING() to get the cache meta blocks'
address space.Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim
14 Jan, 2014
3 commits
-
With the 2 previous changes, all the long time operations are moved out
of the protection region, so here we can use spinlock rather than mutex
(orphan_inode_mutex) for lower overhead.Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim -
Move alloc new orphan node out of lock protection region.
Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim -
Move grabing orphan block page out of protection region, and grab all
the orphan block pages ahead.Signed-off-by: Gu Zheng
Reviewed-by: Chao Yu
[Jaegeuk Kim: remove unnecessary code pointed by Chao Yu]
Signed-off-by: Jaegeuk Kim
26 Dec, 2013
1 commit
-
Previously, we need to calculate the max orphan num when we try to acquire an
orphan inode, but it's a stable value since the super block was inited. So
converting it to a field of f2fs_sb_info and use it directly when needed seems
a better choose.Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim
23 Dec, 2013
12 commits
-
This patch enhances writing dirty meta pages collectively in background.
During the file data writes, it'd better avoid to write small dirty meta pages
frequently.
So let's give a chance to collect a number of dirty meta pages for a while.Signed-off-by: Jaegeuk Kim
-
This patch introduces f2fs_io_info to mitigate the complex parameter list.
struct f2fs_io_info {
enum page_type type; /* contains DATA/NODE/META/META_FLUSH */
int rw; /* contains R/RS/W/WS */
int rw_flag; /* contains REQ_META/REQ_PRIO */
}1. f2fs_write_data_pages
- DATA
- WRITE_SYNC is set when wbc->WB_SYNC_ALL.2. sync_node_pages
- NODE
- WRITE_SYNC all the time3. sync_meta_pages
- META
- WRITE_SYNC all the time
- REQ_META | REQ_PRIO all the time** f2fs_submit_merged_bio() handles META_FLUSH.
4. ra_nat_pages, ra_sit_pages, ra_sum_pages
- META
- READ_SYNCCc: Fan Li
Cc: Changman Lee
Signed-off-by: Jaegeuk Kim -
This patch adds unlikely() macro into the most of codes.
The basic rule is to add that when:
- checking unusual errors,
- checking page mappings,
- and the other unlikely conditions.Change log from v1:
- Don't add unlikely for the NULL test and error test: advised by Andi Kleen.Cc: Chao Yu
Cc: Andi Kleen
Reviewed-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
As we know, some of our branch condition will rarely be true. So we could add
'unlikely' to let compiler optimize these code, by this way we could drop
unneeded 'jump' assemble code to improve performance.change log:
o add *unlikely* as many as possible across the whole source files at once
suggested by Jaegeuk Kim.Suggested-by: Jaegeuk Kim
Signed-off-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
This patch integrates redundant bio operations on read and write IOs.
1. Move bio-related codes to the top of data.c.
2. Replace f2fs_submit_bio with f2fs_submit_merged_bio, which handles read
bios additionally.
3. Introduce __submit_merged_bio to submit the merged bio.
4. Change f2fs_readpage to f2fs_submit_page_bio.
5. Introduce f2fs_submit_page_mbio to integrate previous submit_read_page and
submit_write_page.Reviewed-by: Gu Zheng
Reviewed-by: Chao Yu
Signed-off-by: Jaegeuk Kim -
The recover_orphan_inodes() returns no error all the time, so we don't need to
check its errors.Signed-off-by: Chao Yu
[Jaegeuk Kim: add description]
Signed-off-by: Jaegeuk Kim -
Because we will write node summaries when do_checkpoint with umount flag,
our number of max orphan blocks should minus NR_CURSEG_NODE_TYPE additional.Signed-off-by: Chao Yu
Signed-off-by: Shu Tan
Signed-off-by: Jaegeuk Kim -
This patch fixes some bit overflows by the shift operations.
Dan Carpenter reported potential bugs on bit overflows as follows.
fs/f2fs/segment.c:910 submit_write_page()
warn: should 'blk_addr << ((sbi)->log_blocksize - 9)' be a 64 bit type?
fs/f2fs/checkpoint.c:429 get_valid_checkpoint()
warn: should '1 << ()' be a 64 bit type?
fs/f2fs/data.c:408 f2fs_readpage()
warn: should 'blk_addr << ((sbi)->log_blocksize - 9)' be a 64 bit type?
fs/f2fs/data.c:457 submit_read_page()
warn: should 'blk_addr << ((sbi)->log_blocksize - 9)' be a 64 bit type?
fs/f2fs/data.c:525 get_data_block_ro()
warn: should 'i << blkbits' be a 64 bit type?Bug-Reported-by: Dan Carpenter
Signed-off-by: Jaegeuk Kim -
Fix a potential out of range issue introduced by commit:
22fb72225a
f2fs: simplify write_orphan_inodes for better readableSigned-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim -
Let's send REQ_META or REQ_PRIO when reading meta area such as NAT/SIT
etc.Signed-off-by: Changman Lee
Signed-off-by: Jaegeuk Kim -
Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim -
Simplify write_orphan_inodes for better readable. Because we hold the
orphan_inode_mutex, so it's safe to use list_for_each_entry instead of
list_for_each_safe.Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim
08 Nov, 2013
1 commit
-
use genernal method supported by kernel
o changes from v1
If any waiter exists at end io, wake up it.Signed-off-by: Changman Lee
Signed-off-by: Jaegeuk Kim
29 Oct, 2013
1 commit
-
If you want to remove unnecessary BUG_ONs, you can just turn off F2FS_CHECK_FS
in your kernel config.Signed-off-by: Jaegeuk Kim
25 Oct, 2013
3 commits
-
This patch adds a tracepoint for set_page_dirty.
Signed-off-by: Jaegeuk Kim
-
Signed-off-by: Haicheng Li
Signed-off-by: Jaegeuk Kim -
This patch cleans up improper definitions that update some status information.
Signed-off-by: Jaegeuk Kim
22 Oct, 2013
1 commit
-
Introduce the unfailed version of kmem_cache_alloc named f2fs_kmem_cache_alloc
to hide the retry routine and make the code a bit cleaner.v2:
Fix the wrong use of 'retry' tag pointed out by Gao feng.
Use more neat code to remove redundant tag suggested by Haicheng Li.Signed-off-by: Gu Zheng
Signed-off-by: Jaegeuk Kim
18 Oct, 2013
1 commit
-
This patch enhances the recovery routine not to write any data/node/meta until
its completion.
If any writes are sent to the disk, it could contaminate the written history
that will be used for further recovery.Signed-off-by: Jaegeuk Kim