summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2022-05-06 18:30:31 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2022-05-06 14:26:33 -0700
commit71419129625a50cfb5e3c5cc215948a3f98c806d (patch)
tree1c98cc9d1aa6447472d0f9eaa72237fccdb44a27 /fs/f2fs/segment.h
parent6b8beca0edd32075a769bfe4178ca00c0dcd22a9 (diff)
downloadlinux-stable-71419129625a50cfb5e3c5cc215948a3f98c806d.tar.gz
linux-stable-71419129625a50cfb5e3c5cc215948a3f98c806d.tar.bz2
linux-stable-71419129625a50cfb5e3c5cc215948a3f98c806d.zip
f2fs: give priority to select unpinned section for foreground GC
Previously, during foreground GC, if victims contain data of pinned file, it will fail migration of the data, and meanwhile i_gc_failures of that pinned file may increase, and when it exceeds threshold, GC will unpin the file, result in breaking pinfile's semantics. In order to mitigate such condition, let's record and skip section which has pinned file's data and give priority to select unpinned one. Signed-off-by: Chao Yu <chao.yu@oppo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 1fa26a9603cb..8fbc9f6afa55 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -295,6 +295,9 @@ struct dirty_seglist_info {
struct mutex seglist_lock; /* lock for segment bitmaps */
int nr_dirty[NR_DIRTY_TYPE]; /* # of dirty segments */
unsigned long *victim_secmap; /* background GC victims */
+ unsigned long *pinned_secmap; /* pinned victims from foreground GC */
+ unsigned int pinned_secmap_cnt; /* count of victims which has pinned data */
+ bool enable_pin_section; /* enable pinning section */
};
/* victim selection function for cleaning and SSR */