]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/mm.h
mm: thp: microoptimize compound_mapcount()
[karo-tx-linux.git] / include / linux / mm.h
index 9c2852cabf01c0bf835b637708f9b200b2cf6dfe..65d18a45b8e8452c646c55ad32b6c40a71c31457 100644 (file)
@@ -475,8 +475,7 @@ static inline atomic_t *compound_mapcount_ptr(struct page *page)
 
 static inline int compound_mapcount(struct page *page)
 {
-       if (!PageCompound(page))
-               return 0;
+       VM_BUG_ON_PAGE(!PageCompound(page), page);
        page = compound_head(page);
        return atomic_read(compound_mapcount_ptr(page)) + 1;
 }
@@ -850,10 +849,7 @@ extern int page_cpupid_xchg_last(struct page *page, int cpupid);
 
 static inline void page_cpupid_reset_last(struct page *page)
 {
-       int cpupid = (1 << LAST_CPUPID_SHIFT) - 1;
-
-       page->flags &= ~(LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT);
-       page->flags |= (cpupid & LAST_CPUPID_MASK) << LAST_CPUPID_PGSHIFT;
+       page->flags |= LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT;
 }
 #endif /* LAST_CPUPID_NOT_IN_PAGE_FLAGS */
 #else /* !CONFIG_NUMA_BALANCING */