lkml.org 
[lkml]   [2013]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/10] memory-hotplug: enable memory hotplug to handle hugepage
On Tue, Mar 26, 2013 at 05:31:51PM +0530, Aneesh Kumar K.V wrote:
> Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> writes:
>
> > +/* Returns true for head pages of in-use hugepages, otherwise returns false. */
> > +bool is_hugepage_movable(struct page *hpage)
> > +{
> > + struct page *page;
> > + struct hstate *h;
> > + bool ret = false;
> > +
> > + VM_BUG_ON(!PageHuge(hpage));
> > + /*
> > + * This function can be called for a tail page because memory hotplug
> > + * scans movability of pages by pfn range of a memory block.
> > + * Larger hugepages (1GB for x86_64) are larger than memory block, so
> > + * the scan can start at the tail page of larger hugepages.
> > + * 1GB hugepage is not movable now, so we return with false for now.
> > + */
> > + if (PageTail(hpage))
> > + return false;
> > + h = page_hstate(hpage);
> > + spin_lock(&hugetlb_lock);
> > + list_for_each_entry(page, &h->hugepage_activelist, lru)
> > + if (page == hpage) {
> > + ret = true;
> > + break;
> > + }
> > + spin_unlock(&hugetlb_lock);
> > + return ret;
> > +}
> > +
>
> May be is_hugepage_active() ?

Yes, it would be nice.

Thanks,
Naoya


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