From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by kanga.kvack.org (Postfix) with ESMTP id 9FCCA28026B for ; Thu, 15 Sep 2016 07:56:42 -0400 (EDT) Received: by mail-pa0-f70.google.com with SMTP id fu14so17663880pad.0 for ; Thu, 15 Sep 2016 04:56:42 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com. [192.55.52.43]) by mx.google.com with ESMTPS id ud5si3964823pac.137.2016.09.15.04.56.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 04:56:42 -0700 (PDT) From: "Kirill A. Shutemov" Subject: [PATCHv3 22/41] thp: do not threat slab pages as huge in hpage_{nr_pages,size,mask} Date: Thu, 15 Sep 2016 14:55:04 +0300 Message-Id: <20160915115523.29737-23-kirill.shutemov@linux.intel.com> In-Reply-To: <20160915115523.29737-1-kirill.shutemov@linux.intel.com> References: <20160915115523.29737-1-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Theodore Ts'o , Andreas Dilger , Jan Kara , Andrew Morton Cc: Alexander Viro , Hugh Dickins , Andrea Arcangeli , Dave Hansen , Vlastimil Babka , Matthew Wilcox , Ross Zwisler , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, "Kirill A. Shutemov" Slab pages can be compound, but we shouldn't threat them as THP for pupose of hpage_* helpers, otherwise it would lead to confusing results. For instance, ext4 uses slab pages for journal pages and we shouldn't confuse them with THPs. The easiest way is to exclude them in hpage_* helpers. Signed-off-by: Kirill A. Shutemov --- include/linux/huge_mm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index de2789b4402c..5c5466ba37df 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -133,21 +133,21 @@ static inline spinlock_t *pmd_trans_huge_lock(pmd_t *pmd, } static inline int hpage_nr_pages(struct page *page) { - if (unlikely(PageTransHuge(page))) + if (unlikely(!PageSlab(page) && PageTransHuge(page))) return HPAGE_PMD_NR; return 1; } static inline int hpage_size(struct page *page) { - if (unlikely(PageTransHuge(page))) + if (unlikely(!PageSlab(page) && PageTransHuge(page))) return HPAGE_PMD_SIZE; return PAGE_SIZE; } static inline unsigned long hpage_mask(struct page *page) { - if (unlikely(PageTransHuge(page))) + if (unlikely(!PageSlab(page) && PageTransHuge(page))) return HPAGE_PMD_MASK; return PAGE_MASK; } -- 2.9.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org