[rh7,2/3] mm/tcache: rebalance tree is isolation failed.

Submitted by Andrey Ryabinin on Oct. 18, 2018, 9:02 a.m.

Details

Message ID 20181018090231.7924-2-aryabinin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Ryabinin Oct. 18, 2018, 9:02 a.m.
tcache_lru_isolate() doesn't rebalance reclaim tree if isolation
failed. If the first pool in tree is empty, without rebalancing it
may stay first indefinitely long preventing reclaim.

https://jira.sw.ru/browse/PSBM-89403
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/tcache.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/tcache.c b/mm/tcache.c
index 960450bb825e..eb9c9dea4e51 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -1109,9 +1109,6 @@  tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
 	spin_lock_irq(&pni->lock);
 	nr_isolated = __tcache_lru_isolate(pni, pages, nr_to_isolate);
 
-	if (!nr_isolated)
-		goto unlock;
-
 	if (!RB_EMPTY_NODE(rbn) || !list_empty(&pni->lru)) {
 		spin_lock(&ni->lock);
 		if (!RB_EMPTY_NODE(rbn))
@@ -1123,7 +1120,7 @@  tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
 		update_ni_rb_first(ni);
 		spin_unlock(&ni->lock);
 	}
-unlock:
+
 	spin_unlock_irq(&pni->lock);
 	tcache_put_pool(pni->pool);
 out:

Comments

Kirill Tkhai Oct. 18, 2018, 12:47 p.m.
On 18.10.2018 12:02, Andrey Ryabinin wrote:
> tcache_lru_isolate() doesn't rebalance reclaim tree if isolation
> failed. If the first pool in tree is empty, without rebalancing it
> may stay first indefinitely long preventing reclaim.
> 
> https://jira.sw.ru/browse/PSBM-89403
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>

1 and 2 are brilliant :) 3 haven't seen yet.

Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>

> ---
>  mm/tcache.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/tcache.c b/mm/tcache.c
> index 960450bb825e..eb9c9dea4e51 100644
> --- a/mm/tcache.c
> +++ b/mm/tcache.c
> @@ -1109,9 +1109,6 @@ tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
>  	spin_lock_irq(&pni->lock);
>  	nr_isolated = __tcache_lru_isolate(pni, pages, nr_to_isolate);
>  
> -	if (!nr_isolated)
> -		goto unlock;
> -
>  	if (!RB_EMPTY_NODE(rbn) || !list_empty(&pni->lru)) {
>  		spin_lock(&ni->lock);
>  		if (!RB_EMPTY_NODE(rbn))
> @@ -1123,7 +1120,7 @@ tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
>  		update_ni_rb_first(ni);
>  		spin_unlock(&ni->lock);
>  	}
> -unlock:
> +
>  	spin_unlock_irq(&pni->lock);
>  	tcache_put_pool(pni->pool);
>  out:
>