lkml.org 
[lkml]   [2014]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch v3 6/6] mm, compaction: terminate async compaction when rescheduling
On 05/07/2014 04:22 AM, David Rientjes wrote:
> Async compaction terminates prematurely when need_resched(), see
> compact_checklock_irqsave(). This can never trigger, however, if the
> cond_resched() in isolate_migratepages_range() always takes care of the
> scheduling.
>
> If the cond_resched() actually triggers, then terminate this pageblock scan for
> async compaction as well.
>
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
> mm/compaction.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -500,8 +500,13 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
> return 0;
> }
>
> + if (cond_resched()) {
> + /* Async terminates prematurely on need_resched() */
> + if (cc->mode == MIGRATE_ASYNC)
> + return 0;
> + }
> +
> /* Time to isolate some pages for migration */
> - cond_resched();
> for (; low_pfn < end_pfn; low_pfn++) {
> /* give a chance to irqs before checking need_resched() */
> if (locked && !(low_pfn % SWAP_CLUSTER_MAX)) {
>



\
 
 \ /
  Last update: 2014-05-07 14:21    [W:0.276 / U:2.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site