|
@@ -25,6 +25,9 @@
|
|
/* control the memory footprint threshold (10MB per 1GB ram) */
|
|
/* control the memory footprint threshold (10MB per 1GB ram) */
|
|
#define DEF_RAM_THRESHOLD 10
|
|
#define DEF_RAM_THRESHOLD 10
|
|
|
|
|
|
|
|
+/* control dirty nats ratio threshold (default: 10% over max nid count) */
|
|
|
|
+#define DEF_DIRTY_NAT_RATIO_THRESHOLD 10
|
|
|
|
+
|
|
/* vector size for gang look-up from nat cache that consists of radix tree */
|
|
/* vector size for gang look-up from nat cache that consists of radix tree */
|
|
#define NATVEC_SIZE 64
|
|
#define NATVEC_SIZE 64
|
|
#define SETVEC_SIZE 32
|
|
#define SETVEC_SIZE 32
|
|
@@ -117,6 +120,12 @@ static inline void raw_nat_from_node_info(struct f2fs_nat_entry *raw_ne,
|
|
raw_ne->version = ni->version;
|
|
raw_ne->version = ni->version;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline bool excess_dirty_nats(struct f2fs_sb_info *sbi)
|
|
|
|
+{
|
|
|
|
+ return NM_I(sbi)->dirty_nat_cnt >= NM_I(sbi)->max_nid *
|
|
|
|
+ DEF_DIRTY_NAT_RATIO_THRESHOLD / 100;
|
|
|
|
+}
|
|
|
|
+
|
|
enum mem_type {
|
|
enum mem_type {
|
|
FREE_NIDS, /* indicates the free nid list */
|
|
FREE_NIDS, /* indicates the free nid list */
|
|
NAT_ENTRIES, /* indicates the cached nat entry */
|
|
NAT_ENTRIES, /* indicates the cached nat entry */
|