[Devel] [PATCH rh7 v2 07/10] tcache: Move erase-insert logic out of tcache_check_events()
Andrey Ryabinin
aryabinin at virtuozzo.com
Wed Aug 16 16:40:24 MSK 2017
On 08/16/2017 02:53 PM, Kirill Tkhai wrote:
> Make the function return true, when erase-insert (requeue)
> should be executed. Move erase-insert out of the function.
>
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
> /*
> @@ -277,11 +274,12 @@ static void tcache_lru_add(struct tcache_pool *pool, struct page *page)
> pni->recent_puts /= 2;
> }
>
> - __tcache_check_events(ni, pni);
> -
> - if (unlikely(RB_EMPTY_NODE(&pni->reclaim_node)))
> + if (tcache_check_events(pni) || RB_EMPTY_NODE(&pni->reclaim_node)) {
> + if (!RB_EMPTY_NODE(&pni->reclaim_node))
> + rb_erase(&pni->reclaim_node, &ni->reclaim_tree);
> __tcache_insert_reclaim_node(ni, pni);
> -
> + update_ni_rb_first(ni);
Ok, now I see that you added it here. I guess that supposed to be in patch 05.
> + }
> spin_unlock(&pni->lock);
> spin_unlock(&ni->lock);
> }
More information about the Devel
mailing list