From: Andrea Arcangeli <aarcange@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>, Minchan Kim <minchan.kim@gmail.com>,
Jan Kara <jack@suse.cz>, Andy Isaacson <adi@hexapodia.org>,
Johannes Weiner <jweiner@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: Do not stall in synchronous compaction for THP allocations
Date: Tue, 15 Nov 2011 03:08:31 +0100 [thread overview]
Message-ID: <20111115020831.GF4414@redhat.com> (raw)
In-Reply-To: <20111115020009.GE4414@redhat.com>
On Tue, Nov 15, 2011 at 03:00:09AM +0100, Andrea Arcangeli wrote:
> I didn't fill that gap but I was reading the code again and I don't
> see why we keep retrying for -EAGAIN in the !sync case. Maybe the
> below is good (untested). I doubt it's good to spend cpu to retry the
> trylock or to retry the migrate on a pinned page by O_DIRECT. In fact
> as far as THP success rate is concerned maybe we should "goto out"
> instead of "goto fail" but I didn't change to that as compaction even
> if it fails a subpage may still be successful at creating order
> 1/2/3/4...8 pages. I only avoid 9 loops to retry a trylock or a page
> under O_DIRECT. Maybe that will save a bit of CPU, I doubt it can
> decrease the success rate in any significant way. I'll test it at the
> next build...
At the same time also noticed another minor cleanup (also untested,
will text at next build together with some other stuff).
===
From: Andrea Arcangeli <aarcange@redhat.com>
Subject: [PATCH] compaction: move ISOLATE_CLEAN setting out of
compaction_migratepages loop
cc->sync and mode cannot change within the loop so move it out.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---
mm/compaction.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c
index 899d956..be0be1d 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -291,6 +291,9 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
return ISOLATE_ABORT;
}
+ if (!cc->sync)
+ mode |= ISOLATE_CLEAN;
+
/* Time to isolate some pages for migration */
cond_resched();
spin_lock_irq(&zone->lru_lock);
@@ -349,9 +352,6 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
continue;
}
- if (!cc->sync)
- mode |= ISOLATE_CLEAN;
-
/* Try isolate the page */
if (__isolate_lru_page(page, mode, 0) != 0)
continue;
WARNING: multiple messages have this Message-ID (diff)
From: Andrea Arcangeli <aarcange@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>, Minchan Kim <minchan.kim@gmail.com>,
Jan Kara <jack@suse.cz>, Andy Isaacson <adi@hexapodia.org>,
Johannes Weiner <jweiner@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: Do not stall in synchronous compaction for THP allocations
Date: Tue, 15 Nov 2011 03:08:31 +0100 [thread overview]
Message-ID: <20111115020831.GF4414@redhat.com> (raw)
In-Reply-To: <20111115020009.GE4414@redhat.com>
On Tue, Nov 15, 2011 at 03:00:09AM +0100, Andrea Arcangeli wrote:
> I didn't fill that gap but I was reading the code again and I don't
> see why we keep retrying for -EAGAIN in the !sync case. Maybe the
> below is good (untested). I doubt it's good to spend cpu to retry the
> trylock or to retry the migrate on a pinned page by O_DIRECT. In fact
> as far as THP success rate is concerned maybe we should "goto out"
> instead of "goto fail" but I didn't change to that as compaction even
> if it fails a subpage may still be successful at creating order
> 1/2/3/4...8 pages. I only avoid 9 loops to retry a trylock or a page
> under O_DIRECT. Maybe that will save a bit of CPU, I doubt it can
> decrease the success rate in any significant way. I'll test it at the
> next build...
At the same time also noticed another minor cleanup (also untested,
will text at next build together with some other stuff).
===
From: Andrea Arcangeli <aarcange@redhat.com>
Subject: [PATCH] compaction: move ISOLATE_CLEAN setting out of
compaction_migratepages loop
cc->sync and mode cannot change within the loop so move it out.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---
mm/compaction.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c
index 899d956..be0be1d 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -291,6 +291,9 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
return ISOLATE_ABORT;
}
+ if (!cc->sync)
+ mode |= ISOLATE_CLEAN;
+
/* Time to isolate some pages for migration */
cond_resched();
spin_lock_irq(&zone->lru_lock);
@@ -349,9 +352,6 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
continue;
}
- if (!cc->sync)
- mode |= ISOLATE_CLEAN;
-
/* Try isolate the page */
if (__isolate_lru_page(page, mode, 0) != 0)
continue;
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-11-15 2:09 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 10:06 [PATCH] mm: Do not stall in synchronous compaction for THP allocations Mel Gorman
2011-11-10 10:06 ` Mel Gorman
2011-11-10 10:38 ` Johannes Weiner
2011-11-10 10:38 ` Johannes Weiner
2011-11-10 10:51 ` Alan Cox
2011-11-10 10:51 ` Alan Cox
2011-11-10 12:06 ` Johannes Weiner
2011-11-10 12:06 ` Johannes Weiner
2011-11-10 14:00 ` Andrea Arcangeli
2011-11-10 14:00 ` Andrea Arcangeli
2011-11-10 14:22 ` Mel Gorman
2011-11-10 14:22 ` Mel Gorman
2011-11-10 15:12 ` Minchan Kim
2011-11-10 15:12 ` Minchan Kim
2011-11-10 16:13 ` Mel Gorman
2011-11-10 16:13 ` Mel Gorman
2011-11-10 16:30 ` Minchan Kim
2011-11-10 16:30 ` Minchan Kim
2011-11-10 16:48 ` Mel Gorman
2011-11-10 16:48 ` Mel Gorman
2011-11-10 23:12 ` Andrew Morton
2011-11-10 23:12 ` Andrew Morton
2011-11-10 23:37 ` David Rientjes
2011-11-10 23:37 ` David Rientjes
2011-11-11 10:14 ` Mel Gorman
2011-11-11 10:14 ` Mel Gorman
2011-11-11 10:39 ` David Rientjes
2011-11-11 10:39 ` David Rientjes
2011-11-11 11:17 ` Mel Gorman
2011-11-11 11:17 ` Mel Gorman
2011-11-11 14:21 ` Andrea Arcangeli
2011-11-11 14:21 ` Andrea Arcangeli
2011-11-14 23:44 ` Andrew Morton
2011-11-14 23:44 ` Andrew Morton
2011-11-15 13:25 ` Mel Gorman
2011-11-15 13:25 ` Mel Gorman
2011-11-15 21:07 ` David Rientjes
2011-11-15 21:07 ` David Rientjes
2011-11-15 23:48 ` Mel Gorman
2011-11-15 23:48 ` Mel Gorman
2011-11-16 0:07 ` David Rientjes
2011-11-16 0:07 ` David Rientjes
2011-11-16 4:13 ` Andrea Arcangeli
2011-11-16 4:13 ` Andrea Arcangeli
2011-11-16 13:30 ` Andrea Arcangeli
2011-11-16 13:30 ` Andrea Arcangeli
2011-11-16 15:07 ` Mel Gorman
2011-11-16 15:07 ` Mel Gorman
2011-11-18 17:59 ` Andrea Arcangeli
2011-11-18 17:59 ` Andrea Arcangeli
2011-11-16 14:14 ` Mel Gorman
2011-11-16 14:14 ` Mel Gorman
2011-11-11 10:01 ` Mel Gorman
2011-11-11 10:01 ` Mel Gorman
2011-11-15 0:03 ` Andrew Morton
2011-11-15 0:03 ` Andrew Morton
2011-11-15 2:00 ` Andrea Arcangeli
2011-11-15 2:00 ` Andrea Arcangeli
2011-11-15 2:08 ` Andrea Arcangeli [this message]
2011-11-15 2:08 ` Andrea Arcangeli
2011-11-15 15:01 ` Mel Gorman
2011-11-15 15:01 ` Mel Gorman
2011-11-15 15:00 ` Mel Gorman
2011-11-15 15:00 ` Mel Gorman
2011-11-15 13:07 ` Mel Gorman
2011-11-15 13:07 ` Mel Gorman
2011-11-15 15:47 ` Andrea Arcangeli
2011-11-15 15:47 ` Andrea Arcangeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111115020831.GF4414@redhat.com \
--to=aarcange@redhat.com \
--cc=adi@hexapodia.org \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=jweiner@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan.kim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.