[Devel] [PATCH v3 2/2] tcache: Fix race between tcache_invalidate_node() and tcache_attach_page()

Andrey Ryabinin aryabinin at virtuozzo.com
Tue Jan 23 14:31:44 MSK 2018



On 01/23/2018 11:56 AM, Kirill Tkhai wrote:
> tcache_attach_page()		tcache_invalidate_node()
> ..				__tcache_lookup_node()
> ..				__tcache_delete_node()
> Check node->invalidated		..
> tcache_page_tree_insert()	..
> tcache_lru_add()		..
> ..				tcache_invalidate_node_pages()
> ..				  node->invalidated = true
> 
> Check nr_page to determ if there is a race and repeat
> node pages iterations if so.
> 
> v2: Move invalidate assignment down in tcache_invalidate_node_tree().
> v3: Synchronize sched in case of race with tcache_shrink_count() too
>     to minimize repeats numbers.
> 
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---


Acked-by: Andrey Ryabinin <aryabinin at virtuozzo.com>


More information about the Devel mailing list