All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>,
	Laura Abbott <lauraa@codeaurora.org>,
	Minchan Kim <minchan@kernel.org>,
	Heesub Shin <heesub.shin@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/3] CMA: remove redundant retrying code in __alloc_contig_migrate_range
Date: Fri, 09 May 2014 08:44:06 -0700	[thread overview]
Message-ID: <xa1t7g5vx8hl.fsf@mina86.com> (raw)
In-Reply-To: <1399509144-8898-2-git-send-email-iamjoonsoo.kim@lge.com>

[-- Attachment #1: Type: text/plain, Size: 2114 bytes --]

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@lge.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@mina86.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@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Michal Nazarewicz <mina86@mina86.com>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Laura Abbott <lauraa@codeaurora.org>,
	Minchan Kim <minchan@kernel.org>,
	Heesub Shin <heesub.shin@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/3] CMA: remove redundant retrying code in __alloc_contig_migrate_range
Date: Fri, 09 May 2014 08:44:06 -0700	[thread overview]
Message-ID: <xa1t7g5vx8hl.fsf@mina86.com> (raw)
In-Reply-To: <1399509144-8898-2-git-send-email-iamjoonsoo.kim@lge.com>

[-- Attachment #1: Type: text/plain, Size: 2114 bytes --]

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@lge.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@mina86.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@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2014-05-09 15:44 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  0:32 [RFC PATCH 0/3] Aggressively allocate the pages on cma reserved memory Joonsoo Kim
2014-05-08  0:32 ` Joonsoo Kim
2014-05-08  0:32 ` [RFC PATCH 1/3] CMA: remove redundant retrying code in __alloc_contig_migrate_range Joonsoo Kim
2014-05-08  0:32   ` Joonsoo Kim
2014-05-09 15:44   ` Michal Nazarewicz [this message]
2014-05-09 15:44     ` Michal Nazarewicz
2014-05-08  0:32 ` [RFC PATCH 2/3] CMA: aggressively allocate the pages on cma reserved memory when not used Joonsoo Kim
2014-05-08  0:32   ` Joonsoo Kim
2014-05-09 15:45   ` Michal Nazarewicz
2014-05-09 15:45     ` Michal Nazarewicz
2014-05-12 17:04   ` Laura Abbott
2014-05-12 17:04     ` Laura Abbott
2014-05-13  1:14     ` Joonsoo Kim
2014-05-13  1:14       ` Joonsoo Kim
2014-05-13  3:05     ` Minchan Kim
2014-05-13  3:05       ` Minchan Kim
2014-05-24  0:57     ` Laura Abbott
2014-05-24  0:57       ` Laura Abbott
2014-05-26  2:44       ` Joonsoo Kim
2014-05-26  2:44         ` Joonsoo Kim
2014-05-13  3:00   ` Minchan Kim
2014-05-13  3:00     ` Minchan Kim
2014-05-15  1:53     ` Joonsoo Kim
2014-05-15  1:53       ` Joonsoo Kim
2014-05-15  2:43       ` Minchan Kim
2014-05-15  2:43         ` Minchan Kim
2014-05-19  2:11         ` Joonsoo Kim
2014-05-19  2:11           ` Joonsoo Kim
2014-05-19  2:53           ` Minchan Kim
2014-05-19  2:53             ` Minchan Kim
2014-05-19  4:50             ` Joonsoo Kim
2014-05-19  4:50               ` Joonsoo Kim
2014-05-19 23:18               ` Minchan Kim
2014-05-19 23:18                 ` Minchan Kim
2014-05-20  6:33                 ` Joonsoo Kim
2014-05-20  6:33                   ` Joonsoo Kim
2014-05-15  2:45       ` Heesub Shin
2014-05-15  2:45         ` Heesub Shin
2014-05-15  5:06         ` Minchan Kim
2014-05-15  5:06           ` Minchan Kim
2014-05-19 23:22         ` Minchan Kim
2014-05-19 23:22           ` Minchan Kim
2014-05-16  8:02       ` [RFC][PATCH] CMA: drivers/base/Kconfig: restrict CMA size to non-zero value Gioh Kim
2014-05-16  8:02         ` Gioh Kim
2014-05-16 17:45         ` Michal Nazarewicz
2014-05-19  1:47           ` Gioh Kim
2014-05-19  1:47             ` Gioh Kim
2014-05-19  5:55             ` Joonsoo Kim
2014-05-19  5:55               ` Joonsoo Kim
2014-05-19  9:14               ` Gioh Kim
2014-05-19  9:14                 ` Gioh Kim
2014-05-19 19:59               ` Michal Nazarewicz
2014-05-20  0:50                 ` Gioh Kim
2014-05-20  0:50                   ` Gioh Kim
2014-05-20  1:28                   ` Michal Nazarewicz
2014-05-20  2:26                     ` Gioh Kim
2014-05-20  2:26                       ` Gioh Kim
2014-05-20 18:15                       ` Michal Nazarewicz
2014-05-20 11:38                   ` Marek Szyprowski
2014-05-20 11:38                     ` Marek Szyprowski
2014-05-20 12:23                     ` Gi-Oh Kim
2014-05-21  0:15                     ` Gioh Kim
2014-05-21  0:15                       ` Gioh Kim
2014-05-14  8:42   ` [RFC PATCH 2/3] CMA: aggressively allocate the pages on cma reserved memory when not used Aneesh Kumar K.V
2014-05-14  8:42     ` Aneesh Kumar K.V
2014-05-15  1:58     ` Joonsoo Kim
2014-05-15  1:58       ` Joonsoo Kim
2014-05-18 17:36       ` Aneesh Kumar K.V
2014-05-18 17:36         ` Aneesh Kumar K.V
2014-05-19  2:29         ` Joonsoo Kim
2014-05-19  2:29           ` Joonsoo Kim
2014-05-08  0:32 ` [RFC PATCH 3/3] CMA: always treat free cma pages as non-free on watermark checking Joonsoo Kim
2014-05-08  0:32   ` Joonsoo Kim
2014-05-09 15:46   ` Michal Nazarewicz
2014-05-09 15:46     ` Michal Nazarewicz
2014-05-09 12:39 ` [RFC PATCH 0/3] Aggressively allocate the pages on cma reserved memory Marek Szyprowski
2014-05-09 12:39   ` Marek Szyprowski
2014-05-13  2:26   ` Joonsoo Kim
2014-05-13  2:26     ` Joonsoo Kim
2014-05-14  9:44     ` Aneesh Kumar K.V
2014-05-14  9:44       ` Aneesh Kumar K.V
2014-05-15  2:10       ` Joonsoo Kim
2014-05-15  2:10         ` Joonsoo Kim
2014-05-15  9:47         ` Mel Gorman
2014-05-15  9:47           ` Mel Gorman
2014-05-19  2:12           ` Joonsoo Kim
2014-05-19  2:12             ` Joonsoo Kim

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=xa1t7g5vx8hl.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=heesub.shin@samsung.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=lauraa@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=riel@redhat.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.