Re: [PATCH] CMA: call to putback_lru_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On 12/17/2012 11:24 PM, Michal Nazarewicz wrote:
[+marek]

On Mon, Dec 17 2012, Srinivas Pandruvada wrote:
> As per documentation and other places calling putback_lru_pages,
> on error only, except for CMA. I am not sure this is a problem
> for CMA or not.

If ret >= 0 than the list is empty anyway so the effect of this patch is
to save a function call.  It's also true that other callers call it only
on error so __alloc_contig_migrate_range() is an odd man out here.  As
such:

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

Like Michal said, this is just a code cleanup without any functional change.

Acked-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>

> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
> ---
>  mm/page_alloc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 83637df..5a887bf 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5802,8 +5802,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
>  				    alloc_migrate_target,
>  				    0, false, MIGRATE_SYNC);
>  	}
> -
> -	putback_movable_pages(&cc->migratepages);
> +	if (ret < 0)
> +		putback_movable_pages(&cc->migratepages);
>  	return ret > 0 ? 0 : ret;
>  }


Best regards
--
Marek Szyprowski
Samsung Poland R&D Center


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]