Re: linux-next: slab shrinkers: BUG at mm/list_lru.c:92

From: Michal Hocko
Date: Tue Jun 18 2013 - 04:26:18 EST


On Tue 18-06-13 10:26:24, Glauber Costa wrote:
[...]
> Which is obviously borked since I did not fix the other callers so to move I_FREEING
> after lru del.
>
> Michal, would you mind testing the following patch?

I was about to start testing with inode_lru_isolate fix. I will give it
few runs and then test this one if it is still relevant.

> diff --git a/fs/inode.c b/fs/inode.c
> index 00b804e..48eafa6 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -419,6 +419,8 @@ void inode_add_lru(struct inode *inode)
>
> static void inode_lru_list_del(struct inode *inode)
> {
> + if (inode->i_state & I_FREEING)
> + return;
>
> if (list_lru_del(&inode->i_sb->s_inode_lru, &inode->i_lru))
> this_cpu_dec(nr_unused);
> @@ -609,8 +611,8 @@ void evict_inodes(struct super_block *sb)
> continue;
> }
>
> - inode->i_state |= I_FREEING;
> inode_lru_list_del(inode);
> + inode->i_state |= I_FREEING;
> spin_unlock(&inode->i_lock);
> list_add(&inode->i_lru, &dispose);
> }
> @@ -653,8 +655,8 @@ int invalidate_inodes(struct super_block *sb, bool kill_dirty)
> continue;
> }
>
> - inode->i_state |= I_FREEING;
> inode_lru_list_del(inode);
> + inode->i_state |= I_FREEING;
> spin_unlock(&inode->i_lock);
> list_add(&inode->i_lru, &dispose);
> }
> @@ -1381,9 +1383,8 @@ static void iput_final(struct inode *inode)
> inode->i_state &= ~I_WILL_FREE;
> }
>
> + inode_lru_list_del(inode);
> inode->i_state |= I_FREEING;
> - if (!list_empty(&inode->i_lru))
> - inode_lru_list_del(inode);
> spin_unlock(&inode->i_lock);
>
> evict(inode);


--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/