From patchwork Mon Feb 26 14:13:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13572245 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 F1810C48BF6 for ; Mon, 26 Feb 2024 14:14:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8270244016D; Mon, 26 Feb 2024 09:14:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D5F5440147; Mon, 26 Feb 2024 09:14:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C5A044016D; Mon, 26 Feb 2024 09:14:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5C6D2440147 for ; Mon, 26 Feb 2024 09:14:10 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 386E01608A3 for ; Mon, 26 Feb 2024 14:14:10 +0000 (UTC) X-FDA: 81834149460.15.FD45C0E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id AE8351A001B for ; Mon, 26 Feb 2024 14:14:08 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Q9lxCbt0; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708956848; 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=fzz4oIdsJNeqF+PoyUnhajnBU3sMK99bnWW/MxMH7Ys=; b=6vWDI1DL727tfht+EH+5lYeicSb2FXaNOs2CAlSsQU4AFz/44gjcH5CYKWrPRtX16TX29a dlsBqgeZB4YyyLmFpg96iAt4CLbZDmaF6woTkENFgw7dq650LqrSLu7pRGAdZ6lobD8tND F9JaE1KF7sV7m2AZ43M0DNXuW8BZMtQ= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Q9lxCbt0; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708956848; a=rsa-sha256; cv=none; b=6CnYQgxWzjAMZFxcfggcRGl1lUKq+xWFFS0PdMPDgBMiyCte95uxpiTFM1IY6fHkP5Rq2H GhZJ6nZAcYQrSIwnQ8I1KZGBw0WbIIdejCrZWfbi/skOSyb43nsF7ZSZ1UOZiSWjpV22HN da8UFdZvLMQcE+Sg0TZBqX2PavLZbaU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708956848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fzz4oIdsJNeqF+PoyUnhajnBU3sMK99bnWW/MxMH7Ys=; b=Q9lxCbt0MEHadsa1VBLIoQbLEOlr+EcnLg4NSfYCQy9rRSXdQJGB5dSqAbc8HKtsWwQ/Fc CGJrkYL3ZfMUgdwO9XeDU4pjSjjYal59AmdG+1qLY3LCb3PbUO1yj0D/Tc9B07EnS6k3JI uck9cf+dE/NuBGAeC3UlMXbXG1ghJXI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-531-a1B9APTNPEOyuSsYVlQSgg-1; Mon, 26 Feb 2024 09:13:32 -0500 X-MC-Unique: a1B9APTNPEOyuSsYVlQSgg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 864803C28642; Mon, 26 Feb 2024 14:13:32 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.192.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEC821C06710; Mon, 26 Feb 2024 14:13:29 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Matthew Wilcox Subject: [PATCH v2 2/2] mm: remove total_mapcount() Date: Mon, 26 Feb 2024 15:13:24 +0100 Message-ID: <20240226141324.278526-3-david@redhat.com> In-Reply-To: <20240226141324.278526-1-david@redhat.com> References: <20240226141324.278526-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Rspamd-Queue-Id: AE8351A001B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 1raachupxaa3hi6yw8nu6ukb7gif56ab X-HE-Tag: 1708956848-658218 X-HE-Meta: U2FsdGVkX19LVSLqyJj/sPpk06gwe9OmTbUPYc+tSaSVN8Y9cfZcQTrB4s6PoVDTFMLWyCfOfVRXIroz7IqInyXYuePYCW1RGFvNnmzu/lkkL214qcguzQO9ZdgoHgkBSt76XIq7Drxpl1Ry0Ps/YfmPkMs+G+V0CizgYsx7o9bkuWoLLuLMEnDIwcGmyUYgJlzIu0KC4pSjQwWqaJfMOnF3jiPqC43pgqBPtmr0teZ7MHHP/ym2rS6aZugmiYKCndssaqiLptIR290DPtlHKhhYd81lraPs+xSXvQa+UJpphueoOeV0Ms8HaxfoHONw6AbvjReB2GoGZFtDn0Tdr0e46vmi/RI8kLhXHJJIoeh/OhsKp3Y9Q6QE88HWHcTRNIRTF+Bp5d/fJRkdwUwFpG8IWfqnQI8SZ0taN1heK/2ontaOstfH2e7Ra+v1S8ued4aNjMfZBe5BTd4mWRjesWuHVysmd/ra1jakytIutiffzc8v7LZ+VZu61P2D8IZZ8OTtxSn7nac9cNdA1xNu8a7wF+Z7Wk+8Xwp0w1Y1V/Kk7DkrjlRThIXy2Jriih5y65eQPU3sNpNLD4b3c12afdP/+unk9ngVQh+0NMoc2QMSiafsGC5NxnAfFWqntPGnyneCZiw7ZjvCVZ4dKsxLLOEQn8jJnB6H3+vBaZLaUz6CpHmnsUlIdswTF++74fu+K35xRbNRFkYh36TLu43z2h02Vm1NNrUrE0FXNzHoi4pFSi7sFohjZQPX+LuwKUDzKXGpvdQ9OlC/kJmiMUnoSVtRbxAevcDOvxWqriP6wvZEBRGu0hAuN608n7v4fvwjVejSo2b16oCe1+MiQ/b1BzQ5RlbLamMWAzPb03ko/eFhUnwBUaveXVdJO+ME7kjQtiDe/tcuSXrx06J/tent7H4/m5E64mRCaEu+PMjaUw32yDTbLIQ/mVJWPuj1pb4j 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: List-Subscribe: List-Unsubscribe: All users of total_mapcount() are gone, let's remove it. Signed-off-by: David Hildenbrand Reviewed-by: Matthew Wilcox (Oracle) --- include/linux/mm.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 6f4825d829656..49e22a2f6cccc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1183,7 +1183,7 @@ static inline int is_vmalloc_or_module_addr(const void *x) * How many times the entire folio is mapped as a single unit (eg by a * PMD or PUD entry). This is probably not what you want, except for * debugging purposes - it does not include PTE-mapped sub-pages; look - * at folio_mapcount() or page_mapcount() or total_mapcount() instead. + * at folio_mapcount() or page_mapcount() instead. */ static inline int folio_entire_mapcount(struct folio *folio) { @@ -1243,13 +1243,6 @@ static inline int folio_mapcount(struct folio *folio) return folio_total_mapcount(folio); } -static inline int total_mapcount(struct page *page) -{ - if (likely(!PageCompound(page))) - return atomic_read(&page->_mapcount) + 1; - return folio_total_mapcount(page_folio(page)); -} - static inline bool folio_large_is_mapped(struct folio *folio) { /*