[Devel] [PATCH rh7 1/2] mm/tcache: Reset index before repeating invalidation
Kirill Tkhai
ktkhai at virtuozzo.com
Wed Feb 28 19:06:36 MSK 2018
On 28.02.2018 18:01, Andrey Ryabinin wrote:
> Commit 25176cdcdcc0 ("tcache: Fix race between tcache_invalidate_node()
> and tcache_attach_page()")
> removed reseting index before repeating invalidation. Essentially this
> broke repeat logic entirely as we retry invalidation past the end of
> the file.
>
> Reset index to zero before invalidation retry.
>
> https://jira.sw.ru/browse/PSBM-81760
> Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
Acked-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
> mm/tcache.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/tcache.c b/mm/tcache.c
> index 6e0c10dd3339..31a9eb3d1e12 100644
> --- a/mm/tcache.c
> +++ b/mm/tcache.c
> @@ -918,7 +918,7 @@ tcache_invalidate_node_pages(struct tcache_node *node)
> bool repeat, synchronize_sched_once = true;
> pgoff_t indices[TCACHE_PAGEVEC_SIZE];
> struct page *pages[TCACHE_PAGEVEC_SIZE];
> - pgoff_t index = 0;
> + pgoff_t index;
> unsigned nr_pages;
> int i;
>
> @@ -926,6 +926,7 @@ tcache_invalidate_node_pages(struct tcache_node *node)
> * First forbid new page insertions - see tcache_page_tree_replace.
> */
> again:
> + index = 0;
> repeat = false;
> while ((nr_pages = tcache_lookup(pages, node, index,
> TCACHE_PAGEVEC_SIZE, indices))) {
>
More information about the Devel
mailing list