[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBDvqFYUgy+d=DJTBZoaafXoDP+QodAh2CzV2XpDMjaw7Q@mail.gmail.com>
Date: Sat, 23 Feb 2013 15:05:30 +0800
From: Hillf Danton <dhillf@...il.com>
To: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mel@....ul.ie>, Hugh Dickins <hughd@...gle.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
Hillf Danton <dhillf@...il.com>, Michal Hocko <mhocko@...e.cz>
Subject: Re: [PATCH 8/9] memory-hotplug: enable memory hotplug to handle hugepage
Hello Naoya
[add Michal in cc list]
On Fri, Feb 22, 2013 at 3:41 AM, Naoya Horiguchi
<n-horiguchi@...jp.nec.com> wrote:
>
> +/* Returns true for head pages of in-use hugepages, otherwise returns false. */
> +int is_hugepage_movable(struct page *hpage)
s/int/bool/ can we?
> +{
> + struct page *page;
> + struct page *tmp;
> + struct hstate *h = page_hstate(hpage);
Make sense to compute hstate for a tail page?
> + int ret = 0;
> +
> + VM_BUG_ON(!PageHuge(hpage));
> + if (PageTail(hpage))
> + return 0;
VM_BUG_ON(!PageHuge(hpage) || PageTail(hpage)), can we?
> + spin_lock(&hugetlb_lock);
> + list_for_each_entry_safe(page, tmp, &h->hugepage_activelist, lru)
s/_safe// can we?
> + if (page == hpage)
> + ret = 1;
Can we bail out with ret set to be true?
> + spin_unlock(&hugetlb_lock);
> + return ret;
> +}
--
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