Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1450303
| From | "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCHv1, RFC 20/33] thp: introduce hpage_size() and hpage_mask() |
| Date | 2016-07-26 02:50 +0200 |
| Message-ID | <rYYJk-3t1-55@gated-at.bofh.it> (permalink) |
| References | <rYYzD-3py-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Introduce new helpers which return size/mask of the page:
HPAGE_PMD_SIZE/HPAGE_PMD_MASK if the page is PageTransHuge() and
PAGE_SIZE/PAGE_MASK otherwise.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
include/linux/huge_mm.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 6f14de45b5ce..de2789b4402c 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -138,6 +138,20 @@ static inline int hpage_nr_pages(struct page *page)
return 1;
}
+static inline int hpage_size(struct page *page)
+{
+ if (unlikely(PageTransHuge(page)))
+ return HPAGE_PMD_SIZE;
+ return PAGE_SIZE;
+}
+
+static inline unsigned long hpage_mask(struct page *page)
+{
+ if (unlikely(PageTransHuge(page)))
+ return HPAGE_PMD_MASK;
+ return PAGE_MASK;
+}
+
extern int do_huge_pmd_numa_page(struct fault_env *fe, pmd_t orig_pmd);
extern struct page *huge_zero_page;
@@ -163,6 +177,8 @@ void put_huge_zero_page(void);
#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
#define hpage_nr_pages(x) 1
+#define hpage_size(x) PAGE_SIZE
+#define hpage_mask(x) PAGE_MASK
#define transparent_hugepage_enabled(__vma) 0
--
2.8.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHv1, RFC 00/33] ext4: support of huge pages "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200
[PATCHv1, RFC 30/33] ext4: relax assert in ext4_da_page_release_reservation() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200
[PATCHv1, RFC 32/33] mm, fs, ext4: expand use of page_mapping() and page_to_pgoff() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200
[PATCHv1, RFC 28/33] ext4: handle huge pages in __ext4_block_zero_page_range() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200
[PATCHv1, RFC 06/33] radix-tree: Handle multiorder entries being deleted by replace_clear_tags "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200
[PATCHv1, RFC 07/33] mm, shmem: swich huge tmpfs to multi-order radix-tree entries "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200
[PATCHv1, RFC 18/33] HACK: block: bump BIO_MAX_PAGES "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200
[PATCHv1, RFC 20/33] thp: introduce hpage_size() and hpage_mask() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200
Re: [PATCHv1, RFC 00/33] ext4: support of huge pages Theodore Ts'o <tytso@mit.edu> - 2016-07-26 19:40 +0200
Re: [PATCHv1, RFC 00/33] ext4: support of huge pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-07-26 21:20 +0200
Re: [PATCHv1, RFC 00/33] ext4: support of huge pages Jan Kara <jack@suse.cz> - 2016-07-27 11:20 +0200
Re: [PATCHv1, RFC 00/33] ext4: support of huge pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-07-27 12:40 +0200
Re: [PATCHv1, RFC 00/33] ext4: support of huge pages Andrea Arcangeli <aarcange@redhat.com> - 2016-07-27 16:10 +0200
[PATCH] mm, hugetlb: switch hugetlbfs to multi-order radix-tree entries Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-08-10 03:00 +0200
csiph-web