linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff()
@ 2017-04-06 20:16 David Rientjes
  2017-04-07  8:00 ` Michal Hocko
  2017-04-10 14:19 ` Johannes Weiner
  0 siblings, 2 replies; 3+ messages in thread
From: David Rientjes @ 2017-04-06 20:16 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Johannes Weiner, Vladimir Davydov, KAMEZAWA Hiroyuki,
	linux-kernel, linux-mm

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);
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff()
  2017-04-06 20:16 [patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff() David Rientjes
@ 2017-04-07  8:00 ` Michal Hocko
  2017-04-10 14:19 ` Johannes Weiner
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Hocko @ 2017-04-07  8:00 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Johannes Weiner, Vladimir Davydov,
	KAMEZAWA Hiroyuki, linux-kernel, linux-mm

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff()
  2017-04-06 20:16 [patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff() David Rientjes
  2017-04-07  8:00 ` Michal Hocko
@ 2017-04-10 14:19 ` Johannes Weiner
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Weiner @ 2017-04-10 14:19 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Vladimir Davydov, KAMEZAWA Hiroyuki, linux-kernel,
	linux-mm

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-10 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 20:16 [patch] mm, swap_cgroup: reschedule when neeed in swap_cgroup_swapoff() David Rientjes
2017-04-07  8:00 ` Michal Hocko
2017-04-10 14:19 ` Johannes Weiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).