#define HAMMER_INODE_DELETED 0x0080 /* inode delete (backend) */
#define HAMMER_INODE_DELONDISK 0x0100 /* delete synchronized to disk */
#define HAMMER_INODE_RO 0x0200 /* read-only (because of as-of) */
-#define HAMMER_INODE_UNUSED0400 0x0400
+#define HAMMER_INODE_RECSW 0x0400 /* waiting on data record flush */
#define HAMMER_INODE_DONDISK 0x0800 /* data records may be on disk */
#define HAMMER_INODE_BUFS 0x1000 /* dirty high level bps present */
#define HAMMER_INODE_REFLUSH 0x2000 /* flush on dependancy / reflush */
if (RB_EMPTY(&record->ip->rec_tree))
hammer_test_inode(record->ip);
- if (ip->rsv_recs == hammer_limit_inode_recs - 1)
+ if ((ip->flags & HAMMER_INODE_RECSW) &&
+ ip->rsv_recs <= hammer_limit_inode_recs/2) {
+ ip->flags &= ~HAMMER_INODE_RECSW;
wakeup(&ip->rsv_recs);
+ }
}
/*
int hammer_limit_dirtybufspace; /* per-mount */
int hammer_limit_running_io; /* per-mount */
int hammer_limit_recs; /* as a whole XXX */
-int hammer_limit_inode_recs = 1024; /* per inode */
+int hammer_limit_inode_recs = 2048; /* per inode */
int hammer_limit_reclaim;
int hammer_live_dedup_cache_size = DEDUP_CACHE_SIZE;
int hammer_limit_redo = 4096 * 1024; /* per inode */
* Control the number of pending records associated with
* this inode. If too many have accumulated start a
* flush. Try to maintain a pipeline with the flusher.
+ *
+ * NOTE: It is possible for other sources to grow the
+ * records but not necessarily issue another flush,
+ * so use a timeout and ensure that a re-flush occurs.
*/
if (ip->rsv_recs >= hammer_limit_inode_recs) {
hammer_flush_inode(ip, HAMMER_FLUSH_SIGNAL);
- }
- if (ip->rsv_recs >= hammer_limit_inode_recs * 2) {
- while (ip->rsv_recs >= hammer_limit_inode_recs) {
+ while (ip->rsv_recs >= hammer_limit_inode_recs * 2) {
+ ip->flags |= HAMMER_INODE_RECSW;
tsleep(&ip->rsv_recs, 0, "hmrwww", hz);
+ hammer_flush_inode(ip, HAMMER_FLUSH_SIGNAL);
}
- hammer_flush_inode(ip, HAMMER_FLUSH_SIGNAL);
}
#if 0