From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752312AbaEAVCg (ORCPT ); Thu, 1 May 2014 17:02:36 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:58452 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbaEAVCf (ORCPT ); Thu, 1 May 2014 17:02:35 -0400 Date: Thu, 1 May 2014 14:02:32 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Naoya Horiguchi cc: Andrew Morton , Mel Gorman , Rik van Riel , vbabka@suse.cz, iamjoonsoo.kim@lge.com, gthelen@google.com, Hugh Dickins , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch 1/2] mm, migration: add destination page freeing callback In-Reply-To: <5361d71e.236ec20a.1b3d.ffffc8aeSMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: References: <5361d71e.236ec20a.1b3d.ffffc8aeSMTPIN_ADDED_BROKEN@mx.google.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 May 2014, Naoya Horiguchi wrote: > Looks good to me. > Reviewed-by: Naoya Horiguchi > Thanks! > I have one comment below ... > > [snip] > > > @@ -1056,20 +1059,30 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, > > if (!page_mapped(hpage)) > > rc = move_to_new_page(new_hpage, hpage, 1, mode); > > > > - if (rc) > > + if (rc != MIGRATEPAGE_SUCCESS) > > remove_migration_ptes(hpage, hpage); > > > > if (anon_vma) > > put_anon_vma(anon_vma); > > > > - if (!rc) > > + if (rc == MIGRATEPAGE_SUCCESS) > > hugetlb_cgroup_migrate(hpage, new_hpage); > > > > unlock_page(hpage); > > out: > > if (rc != -EAGAIN) > > putback_active_hugepage(hpage); > > - put_page(new_hpage); > > + > > + /* > > + * If migration was not successful and there's a freeing callback, use > > + * it. Otherwise, put_page() will drop the reference grabbed during > > + * isolation. > > + */ > > This comment is true both for normal page and huge page, and people more likely > to see unmap_and_move() at first, so this had better be (also) in unmap_and_move(). > Ok!