Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1618323 > unrolled thread

[patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff()

Started byDavid Rientjes <rientjes@google.com>
First post2017-04-06 22:20 +0200
Last post2017-04-10 16:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [patch] mm, swap_cgroup: reschedule when neeed in  swap_cgroup_swapoff() David Rientjes <rientjes@google.com> - 2017-04-06 22:20 +0200
    Re: [patch] mm, swap_cgroup: reschedule when neeed in  swap_cgroup_swapoff() Michal Hocko <mhocko@kernel.org> - 2017-04-07 10:10 +0200
    Re: [patch] mm, swap_cgroup: reschedule when neeed in  swap_cgroup_swapoff() Johannes Weiner <hannes@cmpxchg.org> - 2017-04-10 16:20 +0200

#1618323 — [patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff()

FromDavid Rientjes <rientjes@google.com>
Date2017-04-06 22:20 +0200
Subject[patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff()
Message-ID<ttm2R-5DN-9@gated-at.bofh.it>
We got need_resched() warnings in swap_cgroup_swapoff() because
swap_cgroup_ctrl[type].length is particularly large.

Reschedule when needed.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/swap_cgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/swap_cgroup.c b/mm/swap_cgroup.c
--- a/mm/swap_cgroup.c
+++ b/mm/swap_cgroup.c
@@ -201,6 +201,8 @@ void swap_cgroup_swapoff(int type)
 			struct page *page = map[i];
 			if (page)
 				__free_page(page);
+			if (!(i % SWAP_CLUSTER_MAX))
+				cond_resched();
 		}
 		vfree(map);
 	}

[toc] | [next] | [standalone]


#1618559

FromMichal Hocko <mhocko@kernel.org>
Date2017-04-07 10:10 +0200
Message-ID<ttx7X-4xA-7@gated-at.bofh.it>
In reply to#1618323
On Thu 06-04-17 13:16:24, David Rientjes wrote:
> We got need_resched() warnings in swap_cgroup_swapoff() because
> swap_cgroup_ctrl[type].length is particularly large.
> 
> Reschedule when needed.
> 
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/swap_cgroup.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/swap_cgroup.c b/mm/swap_cgroup.c
> --- a/mm/swap_cgroup.c
> +++ b/mm/swap_cgroup.c
> @@ -201,6 +201,8 @@ void swap_cgroup_swapoff(int type)
>  			struct page *page = map[i];
>  			if (page)
>  				__free_page(page);
> +			if (!(i % SWAP_CLUSTER_MAX))
> +				cond_resched();
>  		}
>  		vfree(map);
>  	}
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1619964

FromJohannes Weiner <hannes@cmpxchg.org>
Date2017-04-10 16:20 +0200
Message-ID<tuIkF-1KS-9@gated-at.bofh.it>
In reply to#1618323
On Thu, Apr 06, 2017 at 01:16:24PM -0700, David Rientjes wrote:
> We got need_resched() warnings in swap_cgroup_swapoff() because
> swap_cgroup_ctrl[type].length is particularly large.
> 
> Reschedule when needed.
> 
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web