diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-05-28 13:04:25 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-05-28 13:04:25 -0700 |
commit | 75caf310d16cc5e2f851c048cd597f5437013368 (patch) | |
tree | f492f135a0d9a9f88f569a32b2d3f2083b1bd997 /include/linux | |
parent | d16eea2fa5a1ed9bc1788db39a76017916dc7f25 (diff) | |
parent | 4377748c7b5187c3342a60fa2ceb60c8a57a8488 (diff) | |
download | linux-stable-75caf310d16cc5e2f851c048cd597f5437013368.tar.gz linux-stable-75caf310d16cc5e2f851c048cd597f5437013368.tar.bz2 linux-stable-75caf310d16cc5e2f851c048cd597f5437013368.zip |
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton:
"5 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
include/asm-generic/topology.h: guard cpumask_of_node() macro argument
fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
mm: remove VM_BUG_ON(PageSlab()) from page_mapcount()
mm,thp: stop leaking unreleased file pages
mm/z3fold: silence kmemleak false positives of slots
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mm.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 5a323422d783..f3fe7371855c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -782,6 +782,11 @@ static inline void *kvcalloc(size_t n, size_t size, gfp_t flags) extern void kvfree(const void *addr); +/* + * Mapcount of compound page as a whole, does not include mapped sub-pages. + * + * Must be called only for compound pages or any their tail sub-pages. + */ static inline int compound_mapcount(struct page *page) { VM_BUG_ON_PAGE(!PageCompound(page), page); @@ -801,10 +806,16 @@ static inline void page_mapcount_reset(struct page *page) int __page_mapcount(struct page *page); +/* + * Mapcount of 0-order page; when compound sub-page, includes + * compound_mapcount(). + * + * Result is undefined for pages which cannot be mapped into userspace. + * For example SLAB or special types of pages. See function page_has_type(). + * They use this place in struct page differently. + */ static inline int page_mapcount(struct page *page) { - VM_BUG_ON_PAGE(PageSlab(page), page); - if (unlikely(PageCompound(page))) return __page_mapcount(page); return atomic_read(&page->_mapcount) + 1; |