From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx206.postini.com [74.125.245.206]) by kanga.kvack.org (Postfix) with SMTP id 4927E6B004A for ; Fri, 6 Apr 2012 02:40:58 -0400 (EDT) Received: by ggeq1 with SMTP id q1so1510909gge.14 for ; Thu, 05 Apr 2012 23:40:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1333643534-1591-2-git-send-email-b.zolnierkie@samsung.com> References: <1333643534-1591-1-git-send-email-b.zolnierkie@samsung.com> <1333643534-1591-2-git-send-email-b.zolnierkie@samsung.com> Date: Fri, 6 Apr 2012 15:40:56 +0900 Message-ID: Subject: Re: [PATCH 1/2] mm: compaction: try harder to isolate free pages From: Minchan Kim Content-Type: multipart/alternative; boundary=001636c5c28e59a56c04bcfcf03d Sender: owner-linux-mm@kvack.org List-ID: To: Bartlomiej Zolnierkiewicz Cc: linux-mm@kvack.org, mgorman@suse.de, Kyungmin Park --001636c5c28e59a56c04bcfcf03d Content-Type: text/plain; charset=UTF-8 On Fri, Apr 6, 2012 at 1:32 AM, Bartlomiej Zolnierkiewicz < b.zolnierkie@samsung.com> wrote: > In isolate_freepages() check each page in a pageblock > instead of checking only first pages of pageblock_nr_pages > intervals (suitable_migration_target(page) is called before > isolate_freepages_block() so if page is "unsuitable" whole > pageblock_nr_pages pages will be ommited from the check). > It greatly improves possibility of finding free pages to > isolate during compaction_alloc() phase. > I doubt how this can help keeping free pages. Now, compaction works by pageblock_nr_pages unit so although you work by per page, all pages in a block would have same block type. It means we can't pass suitable_migration_target. No? > Cc: Mel Gorman > Signed-off-by: Bartlomiej Zolnierkiewicz > Signed-off-by: Kyungmin Park > --- > mm/compaction.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index d9ebebe..bc77135 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -65,7 +65,7 @@ static unsigned long isolate_freepages_block(struct zone > *zone, > > /* Get the last PFN we should scan for free pages at */ > zone_end_pfn = zone->zone_start_pfn + zone->spanned_pages; > - end_pfn = min(blockpfn + pageblock_nr_pages, zone_end_pfn); > + end_pfn = min(blockpfn + 1, zone_end_pfn); > > /* Find the first usable PFN in the block to initialse page cursor > */ > for (; blockpfn < end_pfn; blockpfn++) { > @@ -160,8 +160,7 @@ static void isolate_freepages(struct zone *zone, > * pages on cc->migratepages. We stop searching if the migrate > * and free page scanners meet or enough free pages are isolated. > */ > - for (; pfn > low_pfn && cc->nr_migratepages > nr_freepages; > - pfn -= pageblock_nr_pages) { > + for (; pfn > low_pfn && cc->nr_migratepages > nr_freepages; pfn--) > { > unsigned long isolated; > > if (!pfn_valid(pfn)) > -- > 1.7.9.4 > > -- > 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: email@kvack.org > -- Kind regards, Minchan Kim --001636c5c28e59a56c04bcfcf03d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Fri, Apr 6, 2012 at 1:32 AM, Bartlomi= ej Zolnierkiewicz <b.zolnierkie@samsung.com> wrote:
In isolate_freepages() check each page in a pageblock
instead of checking only first pages of pageblock_nr_pages
intervals (suitable_migration_target(page) is called before
isolate_freepages_block() so if page is "unsuitable" whole
pageblock_nr_pages pages will be ommited from the check).
It greatly improves possibility of finding free pages to
isolate during compaction_alloc() phase.

I doubt how this can help keeping free pages.
Now, compaction w= orks by pageblock_nr_pages unit so although you work by per page, all pages= in a block would have same block type.
It means we can't pass suitable_migration_target. No?

Cc: Mel Gorman <mgorman@suse.de&g= t;
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
=C2=A0mm/compaction.c | =C2=A0 =C2=A05 ++---
=C2=A01 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index d9ebebe..bc77135 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -65,7 +65,7 @@ static unsigned long isolate_freepages_block(struct zone = *zone,

=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Get the last PFN we should scan for free pag= es at */
=C2=A0 =C2=A0 =C2=A0 =C2=A0zone_end_pfn =3D zone->zone_start_pfn + zone= ->spanned_pages;
- =C2=A0 =C2=A0 =C2=A0 end_pfn =3D min(blockpfn + pageblock_nr_pages, zone_= end_pfn);
+ =C2=A0 =C2=A0 =C2=A0 end_pfn =3D min(blockpfn + 1, zone_end_pfn);

=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Find the first usable PFN in the block to in= itialse page cursor */
=C2=A0 =C2=A0 =C2=A0 =C2=A0for (; blockpfn < end_pfn; blockpfn++) {
@@ -160,8 +160,7 @@ static void isolate_freepages(struct zone *zone,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * pages on cc->migratepages. We stop search= ing if the migrate
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * and free page scanners meet or enough free p= ages are isolated.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 */
- =C2=A0 =C2=A0 =C2=A0 for (; pfn > low_pfn && cc->nr_migrate= pages > nr_freepages;
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pfn -=3D pagebl= ock_nr_pages) {
+ =C2=A0 =C2=A0 =C2=A0 for (; pfn > low_pfn && cc->nr_migrate= pages > nr_freepages; pfn--) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned long isola= ted;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!pfn_valid(pfn)= )
--
1.7.9.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.= =C2=A0For more info on Linux MM,
see: http://www.linu= x-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=3Dmailto:"dont@kvack.org"> email@kva= ck.org </a>



-- Kind regards,
Minchan Kim
--001636c5c28e59a56c04bcfcf03d-- -- 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: email@kvack.org