[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xa1t7g5vx8hl.fsf@mina86.com>
Date: Fri, 09 May 2014 08:44:06 -0700
From: Michal Nazarewicz <mina86@...a86.com>
To: Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Rik van Riel <riel@...hat.com>,
Johannes Weiner <hannes@...xchg.org>,
Mel Gorman <mgorman@...e.de>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Laura Abbott <lauraa@...eaurora.org>,
Minchan Kim <minchan@...nel.org>,
Heesub Shin <heesub.shin@...sung.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 1/3] CMA: remove redundant retrying code in __alloc_contig_migrate_range
On Wed, May 07 2014, Joonsoo Kim wrote:
> We already have retry logic in migrate_pages(). It does retry 10 times.
> So if we keep this retrying code in __alloc_contig_migrate_range(), we
> would try to migrate some unmigratable page in 50 times. There is just one
> small difference in -ENOMEM case. migrate_pages() don't do retry
> in this case, however, current __alloc_contig_migrate_range() does. But,
> I think that this isn't problem, because in this case, we may fail again
> with same reason.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@....com>
I think there was a reason for the retries in
__alloc_contig_migrate_range but perhaps those are no longer valid.
Acked-by: Michal Nazarewicz <mina86@...a86.com>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 5dba293..674ade7 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -6185,7 +6185,6 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
> /* This function is based on compact_zone() from compaction.c. */
> unsigned long nr_reclaimed;
> unsigned long pfn = start;
> - unsigned int tries = 0;
> int ret = 0;
>
> migrate_prep();
> @@ -6204,10 +6203,6 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
> ret = -EINTR;
> break;
> }
> - tries = 0;
> - } else if (++tries == 5) {
> - ret = ret < 0 ? ret : -EBUSY;
> - break;
> }
>
> nr_reclaimed = reclaim_clean_pages_from_list(cc->zone,
> @@ -6216,6 +6211,10 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
>
> ret = migrate_pages(&cc->migratepages, alloc_migrate_target,
> 0, MIGRATE_SYNC, MR_CMA);
> + if (ret) {
> + ret = ret < 0 ? ret : -EBUSY;
> + break;
> + }
> }
> if (ret < 0) {
> putback_movable_pages(&cc->migratepages);
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +--<mpn@...gle.com>--<xmpp:mina86@...ber.org>--ooO--(_)--Ooo--
Download attachment "signature.asc" of type "application/pgp-signature" (836 bytes)
Powered by blists - more mailing lists