[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130814164100.e4ba87e694e3c6563c91bf0e@linux-foundation.org>
Date: Wed, 14 Aug 2013 16:41:00 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Cc: linux-mm@...ck.org, Mel Gorman <mgorman@...e.de>,
Hugh Dickins <hughd@...gle.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Andi Kleen <andi@...stfloor.org>,
Hillf Danton <dhillf@...il.com>, Michal Hocko <mhocko@...e.cz>,
Rik van Riel <riel@...hat.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Wanpeng Li <liwanp@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org,
Naoya Horiguchi <nao.horiguchi@...il.com>
Subject: Re: [PATCH 3/9] migrate: add hugepage migration code to
migrate_pages()
On Fri, 9 Aug 2013 01:21:36 -0400 Naoya Horiguchi <n-horiguchi@...jp.nec.com> wrote:
> +static void check_hugetlb_pmd_range(struct vm_area_struct *vma, pmd_t *pmd,
> + const nodemask_t *nodes, unsigned long flags,
> + void *private)
> +{
> +#ifdef CONFIG_HUGETLB_PAGE
> + int nid;
> + struct page *page;
> +
> + spin_lock(&vma->vm_mm->page_table_lock);
> + page = pte_page(huge_ptep_get((pte_t *)pmd));
> + nid = page_to_nid(page);
> + if (node_isset(nid, *nodes) == !!(flags & MPOL_MF_INVERT))
> + goto unlock;
> + /* With MPOL_MF_MOVE, we migrate only unshared hugepage. */
> + if (flags & (MPOL_MF_MOVE_ALL) ||
> + (flags & MPOL_MF_MOVE && page_mapcount(page) == 1))
> + isolate_huge_page(page, private);
> +unlock:
> + spin_unlock(&vma->vm_mm->page_table_lock);
> +#else
> + BUG();
> +#endif
> +}
The function is poorly named. What does it "check"? And it does more
than checking things - at actually makes alterations!
Can we have a better name here please, and some docmentation explaining
what it does and why it does it?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists