Skip to content

Commit 9ff9870

Browse files
author
Suraj Jitindar Singh
committed
Revert "vfs: Don't evict inode under the inode lru traversing context"
This reverts commit 03880af. Signed-off-by: Suraj Jitindar Singh <[email protected]>
1 parent d7140cb commit 9ff9870

File tree

2 files changed

+2
-42
lines changed

2 files changed

+2
-42
lines changed

fs/inode.c

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -453,39 +453,6 @@ static void inode_lru_list_del(struct inode *inode)
453453
this_cpu_dec(nr_unused);
454454
}
455455

456-
static void inode_pin_lru_isolating(struct inode *inode)
457-
{
458-
lockdep_assert_held(&inode->i_lock);
459-
WARN_ON(inode->i_state & (I_LRU_ISOLATING | I_FREEING | I_WILL_FREE));
460-
inode->i_state |= I_LRU_ISOLATING;
461-
}
462-
463-
static void inode_unpin_lru_isolating(struct inode *inode)
464-
{
465-
spin_lock(&inode->i_lock);
466-
WARN_ON(!(inode->i_state & I_LRU_ISOLATING));
467-
inode->i_state &= ~I_LRU_ISOLATING;
468-
smp_mb();
469-
wake_up_bit(&inode->i_state, __I_LRU_ISOLATING);
470-
spin_unlock(&inode->i_lock);
471-
}
472-
473-
static void inode_wait_for_lru_isolating(struct inode *inode)
474-
{
475-
spin_lock(&inode->i_lock);
476-
if (inode->i_state & I_LRU_ISOLATING) {
477-
DEFINE_WAIT_BIT(wq, &inode->i_state, __I_LRU_ISOLATING);
478-
wait_queue_head_t *wqh;
479-
480-
wqh = bit_waitqueue(&inode->i_state, __I_LRU_ISOLATING);
481-
spin_unlock(&inode->i_lock);
482-
__wait_on_bit(wqh, &wq, bit_wait, TASK_UNINTERRUPTIBLE);
483-
spin_lock(&inode->i_lock);
484-
WARN_ON(inode->i_state & I_LRU_ISOLATING);
485-
}
486-
spin_unlock(&inode->i_lock);
487-
}
488-
489456
/**
490457
* inode_sb_list_add - add inode to the superblock list of inodes
491458
* @inode: inode to add
@@ -598,8 +565,6 @@ static void evict(struct inode *inode)
598565

599566
inode_sb_list_del(inode);
600567

601-
inode_wait_for_lru_isolating(inode);
602-
603568
/*
604569
* Wait for flusher thread to be done with the inode so that filesystem
605570
* does not start destroying it while writeback is still running. Since
@@ -803,7 +768,7 @@ static enum lru_status inode_lru_isolate(struct list_head *item,
803768
}
804769

805770
if (inode_has_buffers(inode) || inode->i_data.nrpages) {
806-
inode_pin_lru_isolating(inode);
771+
__iget(inode);
807772
spin_unlock(&inode->i_lock);
808773
spin_unlock(lru_lock);
809774
if (remove_inode_buffers(inode)) {
@@ -816,7 +781,7 @@ static enum lru_status inode_lru_isolate(struct list_head *item,
816781
if (current->reclaim_state)
817782
current->reclaim_state->reclaimed_slab += reap;
818783
}
819-
inode_unpin_lru_isolating(inode);
784+
iput(inode);
820785
spin_lock(lru_lock);
821786
return LRU_RETRY;
822787
}

include/linux/fs.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,9 +2286,6 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src,
22862286
* Used to detect that mark_inode_dirty() should not move
22872287
* inode between dirty lists.
22882288
*
2289-
* I_LRU_ISOLATING Inode is pinned being isolated from LRU without holding
2290-
* i_count.
2291-
*
22922289
* Q: What is the difference between I_WILL_FREE and I_FREEING?
22932290
*/
22942291
#define I_DIRTY_SYNC (1 << 0)
@@ -2311,8 +2308,6 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src,
23112308
#define I_CREATING (1 << 15)
23122309
#define I_DONTCACHE (1 << 16)
23132310
#define I_SYNC_QUEUED (1 << 17)
2314-
#define __I_LRU_ISOLATING 19
2315-
#define I_LRU_ISOLATING (1 << __I_LRU_ISOLATING)
23162311

23172312
#define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC)
23182313
#define I_DIRTY (I_DIRTY_INODE | I_DIRTY_PAGES)

0 commit comments

Comments
 (0)