Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking changes from Ingo Molnar: "Four miscellanous standalone fixes for futexes, rtmutexes and Kconfig.locks." * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: futex: Use freezable blocking call futex: Take hugepages into account when generating futex_key rtmutex: Document rt_mutex_adjust_prio_chain() locking: Fix copy/paste errors of "ARCH_INLINE_*_UNLOCK_BH"
This commit is contained in:
17
mm/hugetlb.c
17
mm/hugetlb.c
@@ -690,6 +690,23 @@ int PageHuge(struct page *page)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(PageHuge);
|
||||
|
||||
pgoff_t __basepage_index(struct page *page)
|
||||
{
|
||||
struct page *page_head = compound_head(page);
|
||||
pgoff_t index = page_index(page_head);
|
||||
unsigned long compound_idx;
|
||||
|
||||
if (!PageHuge(page_head))
|
||||
return page_index(page);
|
||||
|
||||
if (compound_order(page_head) >= MAX_ORDER)
|
||||
compound_idx = page_to_pfn(page) - page_to_pfn(page_head);
|
||||
else
|
||||
compound_idx = page - page_head;
|
||||
|
||||
return (index << compound_order(page_head)) + compound_idx;
|
||||
}
|
||||
|
||||
static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
|
||||
{
|
||||
struct page *page;
|
||||
|
Reference in New Issue
Block a user