[Devel] [PATCH v2] tcache: Repeat invalidation in tcache_invalidate_node_pages()
Andrey Ryabinin
aryabinin at virtuozzo.com
Fri Dec 1 18:50:17 MSK 2017
On 12/01/2017 06:02 PM, Kirill Tkhai wrote:
> When there are more than 2 users of a page, __tcache_page_tree_delete()
> fails to freeze it. We skip it and never try to freeze it again.
>
> In this case the page remains not invalidated, and tcache_node->nr_pages
> never decremented. Later, we catch WARN_ON() reporting about this.
>
> tcache_shrink_scan() tcache_destroy_pool
> tcache_lru_isolate()
> tcache_grab_pool()
> ...
> page_cache_get_speculative() -->cnt == 2
>
> ...
> tcache_put_pool() --> pool cnt zero
> ... wait_for_completion(&pool->completion);
> tcache_reclaim_pages tcache_invalidate_node_pages()
> __tcache_reclaim_page() tcache_lookup()
> page_cache_get_speculative --> cnt == 3
> __tcache_page_tree_delete
> page_ref_freeze(2) -->fail page_ref_freeze(2) -->fail
>
> The patch fixes the problem. In case of we failed to invalidate a page,
> we remember this, and return to such pages after others are invalidated.
>
> https://jira.sw.ru/browse/PSBM-78354
>
> v2: Also fix tcache_detach_page()
>
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
Acked-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
More information about the Devel
mailing list