From patchwork Wed Feb 12 04:18:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11377487 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0796E14E3 for ; Wed, 12 Feb 2020 04:19:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C8A86215A4 for ; Wed, 12 Feb 2020 04:19:01 +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 C8A86215A4 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) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2BF5E6B03B0; Tue, 11 Feb 2020 23:18:49 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org 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-Original-To: linux-mm@kvack.org 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-Spam-Summary: 2,0,0,a05f57ea547ee1d1,d41d8cd98f00b204,willy@infradead.org,:linux-fsdevel@vger.kernel.org::willy@infradead.org:linux-kernel@vger.kernel.org,RULES_HIT:41:355:379:541:560:800:960:973:988:989:1260:1311:1314:1345:1359:1515:1534:1541:1711:1714:1730:1747:1777:1792:2198:2199:2393:2559:2562:3138:3139:3140:3141:3142:3351:3871:3876:4250:5007:6119:6261:6653:7576:10004:11026:11658:11914:12043:12296:12297:12438:12555:12895:13069:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:21966,0,RBL:198.137.202.133:@infradead.org:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none 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 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, #define hpage_nr_pages(page) (long)compound_nr(page) #define thp_size(page) page_size(page) +#define thp_order(page) compound_order(page) 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(struct page *page) #define hpage_nr_pages(x) 1L #define thp_size(x) PAGE_SIZE +#define thp_order(x) 0U static inline bool __transparent_hugepage_enabled(struct vm_area_struct *vma) {