From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A204EC352A4 for ; Wed, 12 Feb 2020 04:19:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D6D92086A for ; Wed, 12 Feb 2020 04:19:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FAdp2tXx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D6D92086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3D5266B03A7; Tue, 11 Feb 2020 23:18:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BF5E6B03B0; Tue, 11 Feb 2020 23:18:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 92CAE6B03A7; Tue, 11 Feb 2020 23:18:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 4395A6B03A4 for ; Tue, 11 Feb 2020 23:18:48 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C7DFC8248076 for ; Wed, 12 Feb 2020 04:18:47 +0000 (UTC) X-FDA: 76480169094.18.straw48_128fdaa5cd346 X-HE-Tag: straw48_128fdaa5cd346 X-Filterd-Recvd-Size: 2637 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Feb 2020 04:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=i7vboR3/DJp/zECAeL6j4GiEm3ZUJFUzH7UtZQ9ZEF0=; b=FAdp2tXxaIowBuCaDAdUtlgPMI REH220rdRzBHCOYiuA1BN9W47EQ538R6k5uZEtBF5gMgY1fSqKoONpkywoiMJYaTBVacuHgS1XX+5 /ypXgTWDk74QCFtWDsO33RDqXvZqkbaQIv1735c50gFF7JWhNnPtRp18/lI1u3ogH9s0cZ2nclgDr nXd/qmh9tgn5N2nr2dZndgBL0oz0wuJZVqkOggxHGrl/I0AJqJ+VoKG5i2qF8m4FOVYnsvambdbMt VuFwGES8IyvxbUvH3bpT4T7NR4wNGX10JWVDUqKfgiN2Sh3rQaeZhjpZndaJGkIXb3P9rpzojlF1d Iz4gnKbg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1jU6-0006n7-Q5; Wed, 12 Feb 2020 04:18:46 +0000 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org Subject: [PATCH v2 08/25] mm: Introduce thp_order Date: Tue, 11 Feb 2020 20:18:28 -0800 Message-Id: <20200212041845.25879-9-willy@infradead.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200212041845.25879-1-willy@infradead.org> References: <20200212041845.25879-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Matthew Wilcox (Oracle)" Like compound_order() except 0 when THP is disabled. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/huge_mm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 3680ae2d9019..3de788ee25bd 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -233,6 +233,7 @@ static inline spinlock_t *pud_trans_huge_lock(pud_t *= pud, =20 #define hpage_nr_pages(page) (long)compound_nr(page) #define thp_size(page) page_size(page) +#define thp_order(page) compound_order(page) =20 struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long= addr, pmd_t *pmd, int flags, struct dev_pagemap **pgmap); @@ -288,6 +289,7 @@ static inline struct list_head *page_deferred_list(st= ruct page *page) =20 #define hpage_nr_pages(x) 1L #define thp_size(x) PAGE_SIZE +#define thp_order(x) 0U =20 static inline bool __transparent_hugepage_enabled(struct vm_area_struct = *vma) { --=20 2.25.0