lkml.org 
[lkml]   [2013]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 8/9] memory-hotplug: enable memory hotplug to handle hugepage
From
Hello Naoya

[add Michal in cc list]

On Fri, Feb 22, 2013 at 3:41 AM, Naoya Horiguchi
<n-horiguchi@ah.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;
> +}


\
 
 \ /
  Last update: 2013-02-23 08:21    [W:0.163 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site