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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AA2CC5479D for ; Wed, 11 Jan 2023 14:29:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 111048E000E; Wed, 11 Jan 2023 09:29:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A60A28E0005; Wed, 11 Jan 2023 09:29:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CC118E0005; Wed, 11 Jan 2023 09:29:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 350768E000B for ; Wed, 11 Jan 2023 09:29:09 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 069ED1C6354 for ; Wed, 11 Jan 2023 14:29:09 +0000 (UTC) X-FDA: 80342750418.04.4A7D66C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id 85BD516000A for ; Wed, 11 Jan 2023 14:29:07 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YeiWvpAL; dmarc=none; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673447347; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=glmfC0MZHhVXgE0NJOKhxVOTmYgJGmkWJ0aBpVK64Po=; b=61ROGnZRmObfRzNHq97AZUaRGL1o7gXL22aPAdju7ai8ZmfdQi8YdFPb1/iSy3r6nJQyex X/G/DyJeiKJ1bwxvJV8v3J+Y6zQWz0vhxKhdFk3fWDU6PYTUQHmXx+/bglSKLf0cVImXUw 5XHCx/RAwkbctd/dLidFB38J2VsKmQ0= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YeiWvpAL; dmarc=none; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673447347; a=rsa-sha256; cv=none; b=KITFPNTQNQyp/8JhHFl9WOZxAJ0yiveq0cyuduZeOY8vR0+KM2JIp8c7zc37P7n+Ops7Ya a5lVOEaiCHsBu5Fa/QNcZClHT6MPgmfwYtwtcAmiXYhbfuj4iFhev1D2mJluneKSfhK7OY B0dJQTzhVP7eBtLvv18Y4b/lBaHWcD0= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=glmfC0MZHhVXgE0NJOKhxVOTmYgJGmkWJ0aBpVK64Po=; b=YeiWvpALCFMluvgkgDmEDDk7a8 VQp5mlYfDByvKj+Z3QiT6LA1iPXXcFh5Rla56zAE3jun+fmkwK1T7dPKOwOWYUaCkUFr5a1L4ya7l YDEM6pNe6d1S+Hx0mVrrClyiFNb4HoijZO7LYuK4r9CPIT8q8+rtdL3ltyrITxyVpgj9Mta6xE91v hz4nqQgIESKZR2l+FGbQsi1Mn5wdDm7fIgOakEHKU5iA3R0VaLk2ZkUaKMs4v+VZ6fNfVyr7hQf1A K0yZ5819kfcddKbOV28gdoGrYZUa4A4VPAEQIRZISKbfQHs8J0HJ8zgsLi3TVAg7zcCmOrKEA9HRd B5ARv2Eg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFc6Q-004CZF-K6; Wed, 11 Jan 2023 14:29:18 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Hugh Dickins Subject: [PATCH 15/28] mm: Remove head_compound_mapcount() and _ptr functions Date: Wed, 11 Jan 2023 14:29:01 +0000 Message-Id: <20230111142915.1001531-16-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230111142915.1001531-1-willy@infradead.org> References: <20230111142915.1001531-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85BD516000A X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: dwugdfdxt77sxgjd6epgh1pnw34zqg8i X-HE-Tag: 1673447347-123229 X-HE-Meta: U2FsdGVkX1/yrw/CnGv0sufVh+JpVEJHaO5VBXHDFinjCPqE6BMpf1/COfcWLHUi1oBYn9NMsw0f/5JxqaJWjwVJNjp0gQbsUssc8zvYq2PqUsXH2P1HX/cp2nyehk2mZ6S7eXYKDokdecPS9AHvYy5uDelrHnyvTj2weUlQuRr07hh3ZGEXvIdA3KLAzLfU5KQ2i/4Q+8Grefkq5Tcqe6H/33CZT0RYf52MqP74mk4BLbzzB3pX+cM25sS+/ymNty8Nnb1wTrKR6wDWS3Bl15v9vzMd6qRvg/c4RE4TiE8U5rHN38ONBFuhhkYz6YQseBqpf46Oa0fPN6UrWGZ0xhVKbN7UgtXw9ct8r1e2uNsBxSneMKHVkGw90OrL/G6o/CVZVjf911aAsvbjwjPdFM00RjtMytmQc1VI87QxbRKH3yP3GA+Kj8+SOyGZ1hyo67b3PO+ZB/58Za6Cks9DCy2HxOZF7bKi32FXGH3d4JsPAELnuyh9VOq7DbF35O/1U2zY0w3iFLYexVwNtOmDlJ7/SqaKVKao3oqmzsHUVy1dWobQU4yvOyg8aEPGLkSF/pipZtSBfyAgjjry7qSzKtpTaRAaGR/ih7LeUxbYbc9bQSDfzXxRXIXI9LN+h4k0cex8BaF4uG+HqxGAIVGBd3U1EXMg+LwuTrn7WiXYDtYVUB9h6oSlpp8U1xGwhPZ5ENiSevWSKzx+LBzIIUhUgld6XMv4g78B0iGSEBwMysrOb2bUKEdvRfbPg3R8b98K4VxA6BAIBa7uYGw72esQs6D5H6PpDu7rQ6hasolCFpwypeqy/ZAUZD0NKe1jbGvvQ+abEYx8SUSnMn2AqV2pMpBGcRasuW3TuVXsWFcEasMcrTlnxpVTP2dY31dRdl+zvP4vP9NNcJbm5/li0CKdqARdFk//AGnlQs9B/Ymqm1of6cUnb9VAZQ== 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: folio_mapcount_ptr(), compound_mapcount_ptr() and subpages_mapcount_ptr() are all now unused. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 15 +++------------ include/linux/mm_types.h | 16 ---------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 554b73dae188..5002dd4db544 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -831,16 +831,7 @@ static inline int is_vmalloc_or_module_addr(const void *x) static inline int folio_entire_mapcount(struct folio *folio) { VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); - return atomic_read(folio_mapcount_ptr(folio)) + 1; -} - -/* - * Mapcount of compound page as a whole, does not include mapped sub-pages. - * Must be called only on head of compound page. - */ -static inline int head_compound_mapcount(struct page *head) -{ - return atomic_read(compound_mapcount_ptr(head)) + 1; + return atomic_read(&folio->_entire_mapcount) + 1; } /* @@ -905,11 +896,11 @@ static inline int total_mapcount(struct page *page) static inline bool folio_large_is_mapped(struct folio *folio) { /* - * Reading folio_mapcount_ptr() below could be omitted if hugetlb + * Reading _entire_mapcount below could be omitted if hugetlb * participated in incrementing nr_pages_mapped when compound mapped. */ return atomic_read(&folio->_nr_pages_mapped) > 0 || - atomic_read(folio_mapcount_ptr(folio)) >= 0; + atomic_read(&folio->_entire_mapcount) >= 0; } /** diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index a66054a9f0b6..1cf0fcd99d49 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -421,22 +421,6 @@ FOLIO_MATCH(hugetlb_cgroup_rsvd, _hugetlb_cgroup_rsvd); FOLIO_MATCH(hugetlb_hwpoison, _hugetlb_hwpoison); #undef FOLIO_MATCH -static inline atomic_t *folio_mapcount_ptr(struct folio *folio) -{ - struct page *tail = &folio->page + 1; - return &tail->compound_mapcount; -} - -static inline atomic_t *compound_mapcount_ptr(struct page *page) -{ - return &page[1].compound_mapcount; -} - -static inline atomic_t *subpages_mapcount_ptr(struct page *page) -{ - return &page[1].subpages_mapcount; -} - /* * Used for sizing the vmemmap region on some architectures */ -- 2.35.1