Received: by 10.223.185.116 with SMTP id b49csp6728792wrg; Wed, 28 Feb 2018 14:33:39 -0800 (PST) X-Google-Smtp-Source: AG47ELtT3fTgbEzWRL7CZ6+Xs7I/ChD3BnMoMqHBBJ+hEVigHOQ9E1I+CZNHNwFE0xBc1lHoVMVL X-Received: by 10.99.164.81 with SMTP id c17mr11577312pgp.114.1519857219271; Wed, 28 Feb 2018 14:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519857219; cv=none; d=google.com; s=arc-20160816; b=Kx/35LPL2XmVuhS4B6dFJ1HlfPRga1w+Z2vPf3CZT6/AHHvljP1jGyoyDEuA7GECdn 4w8czk9vETPRfMg+CQQVbovFtYXtzX7aCLvg2EJELhu8qZECS2eQ5Dd9ZAwaywec4CwU gkhYjrvZwuLNAr6HOAxbCOmCSQoqpAJFqV7cOCjE4UDPjCjPC/SVa/D81gE0tdvW9YFQ p0qRGYO1MRXsUK/Tk3moNFJOweHpttbakucXLeo83U5UfDy1aRs0SQcoBgOa7284M0xi 9tMtSQrgic2Id3jov6tdlPb8qWAx8HcEhMq2bdMosykLOW1IVuO3xTbDQ7wML8FtXPga nDfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=BFp9vZu7RItWlog6ueMKD+Qrds0yyDMdrcSILKX5qVg=; b=D7ADrInreml23CZJXNkY7z8jlxU64qbnXdaIfa9dy9BYBagQOn+toqmqEWOPOhmQ0g 7gg7jhGpMD0MOh5Nrl4v5zw0DfkT5V8vD2VabWrISme0u1JFiBnh72urcIBE5HhEELPn hTb0CdHI8W69TzPU7XNLyykDjxrBcEV/eS7qLLW9Xt+j0Q4Dp+iQla1NaV5yWAiG28Xq 7WPUAergkDljTrxb9fmt2hJFKIfc06hWpgsZDSETkkvQjkL+qzfYp/n9z0WZGlP6XNSS 0NZjzCl2j5QbD4Q4V3AxpjGHc1s5qVGuBXXA1uM+wa5i6aFZp6bOuKZrK4x6lS0tZw89 pK3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pWJFnfEN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23-v6si1902855plo.702.2018.02.28.14.33.24; Wed, 28 Feb 2018 14:33:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pWJFnfEN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935517AbeB1WcZ (ORCPT + 99 others); Wed, 28 Feb 2018 17:32:25 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44522 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935479AbeB1WcL (ORCPT ); Wed, 28 Feb 2018 17:32:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BFp9vZu7RItWlog6ueMKD+Qrds0yyDMdrcSILKX5qVg=; b=pWJFnfENf99RsUWu92X0k7cKr 76Dkpe9Y6KPCiU294S1QYmrj7sv7KHHl6UZRzmhCGS7cz95W4UOrK+T/JHbfHVEBmPxUPDdCochah RybQBT8hoLe1s/DOaKLyD2eTf5Ys+Hde3SQsLe5DCnDpyxWgIK2qCXFnS3BHqa/Nfx15BW084OBhT SQ7/8LrYa9Sxk+CQAzfoE49SAeYCkFea65p2Jw9naMYVPBa0h+zqNBXQEwTA6HMjMlFx1bLrwnvFP 7kjcInQtK8P/rx/uFOMLU6aZ+CxcAUiwMX7mIW1Z5Es4DI9CZiWccGinnCGdNYsR4Nefh2sFwwMIx Z6wJQIF3g==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1erAGe-0002aX-B5; Wed, 28 Feb 2018 22:32:08 +0000 From: Matthew Wilcox To: linux-mm@kvack.org Cc: Matthew Wilcox , Martin Schwidefsky , linux-kernel@vger.kernel.org Subject: [PATCH v3 4/4] mm: Mark pages in use for page tables Date: Wed, 28 Feb 2018 14:31:57 -0800 Message-Id: <20180228223157.9281-5-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228223157.9281-1-willy@infradead.org> References: <20180228223157.9281-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox Define a new PageTable bit in the page_type and use it to mark pages in use as page tables. Signed-off-by: Matthew Wilcox --- include/linux/mm.h | 2 ++ include/linux/page-flags.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index ad06d42adb1a..7a15042d6828 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1829,6 +1829,7 @@ static inline bool pgtable_page_ctor(struct page *page) { if (!ptlock_init(page)) return false; + __SetPageTable(page); inc_zone_page_state(page, NR_PAGETABLE); return true; } @@ -1836,6 +1837,7 @@ static inline bool pgtable_page_ctor(struct page *page) static inline void pgtable_page_dtor(struct page *page) { pte_lock_deinit(page); + __ClearPageTable(page); dec_zone_page_state(page, NR_PAGETABLE); } diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 8142ab716e90..ac6bab90849c 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -644,6 +644,7 @@ PAGEFLAG_FALSE(DoubleMap) #define PG_balloon 0x00000100 #define PG_kmemcg 0x00000200 #define PG_vmalloc 0x00000400 +#define PG_table 0x00000800 #define PageType(page, flag) \ ((page->page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE) @@ -687,6 +688,11 @@ PAGE_TYPE_OPS(Kmemcg, kmemcg) */ PAGE_TYPE_OPS(Vmalloc, vmalloc) +/* + * Marks pages in use as page tables. + */ +PAGE_TYPE_OPS(Table, table) + extern bool is_free_buddy_page(struct page *page); __PAGEFLAG(Isolated, isolated, PF_ANY); -- 2.16.1