Re: dcache endless loop in d_invalidate

From: Martin Schwidefsky
Date: Thu Oct 25 2018 - 07:43:56 EST


On Tue, 16 Oct 2018 13:15:28 +0200
Martin Schwidefsky <schwidefsky@xxxxxxxxxx> wrote:

> In short, this if-statement in select_collect:
>
> if (dentry->d_flags & DCACHE_SHRINK_LIST) {
> data->found++;
> }
>
> with assumption that "somebody else" will do the shrinking seems broken.
>
> Do you agree?

If I am not mistaken this problem should be fixed by upstream commit
4fb4887140 "restore cond_resched() in shrink_dcache_parent()"
which goes on top of
ff17fa561a "d_invalidate(): unhash immediately"

Due to the cond_resched() the task that set DCACHE_SHRINK_LIST for the
remaining two dcache entries will be scheduled eventually. This will
allow the task waiting for the deletion of these dcache entries
to continue, although some CPU cycles may get wasted.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.