Re: [PATCH 3/3] mm: fix return value in__alloc_contig_migrate_range()

From: Michal Nazarewicz
Date: Tue Jul 17 2012 - 09:16:42 EST

On Mon, 16 Jul 2012 20:40:56 +0200, JoonSoo Kim <js1304@xxxxxxxxx> wrote:

2012/7/17 Michal Nazarewicz <mina86@xxxxxxxxxx>:
Joonsoo Kim <js1304@xxxxxxxxx> writes:

migrate_pages() would return positive value in some failure case,
so 'ret > 0 ? 0 : ret' may be wrong.
This fix it and remove one dead statement.

Signed-off-by: Joonsoo Kim <js1304@xxxxxxxxx>
Cc: Michal Nazarewicz <mina86@xxxxxxxxxx>
Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
Cc: Minchan Kim <minchan@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>

Have you actually encountered this problem? If migrate_pages() fails
with a positive value, the code that you are removing kicks in and
-EBUSY is assigned to ret (now that I look at it, I think that in the
current code the "return ret > 0 ? 0 : ret;" statement could be reduced
to "return ret;"). Your code seems to be cleaner, but the commit
message does not look accurate to me.

I don't encounter this problem yet.

If migrate_pages() with offlining false meets KSM page, then migration failed.
In this case, failed page is removed from cc.migratepage list and
return failed count.

Good point.

Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, MichaÅ âmina86â Nazarewicz (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at