From patchwork Fri Mar 21 12:02:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 14025321 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 153D1C35FFF for ; Fri, 21 Mar 2025 12:02:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A8517280003; Fri, 21 Mar 2025 08:02:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A314B280001; Fri, 21 Mar 2025 08:02:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D242280003; Fri, 21 Mar 2025 08:02:56 -0400 (EDT) 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 6EAA3280001 for ; Fri, 21 Mar 2025 08:02:56 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0DEBA1CC77A for ; Fri, 21 Mar 2025 12:02:57 +0000 (UTC) X-FDA: 83245421994.16.5C66F04 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 1B3AB120032 for ; Fri, 21 Mar 2025 12:02:54 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PL3RrN9q; spf=pass (imf29.hostedemail.com: domain of gshan@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=gshan@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1742558575; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Tssdr9ycuQAxVV+JKQvCwDsGSIohsIi0k9uUE/7l9cI=; b=d92qP/CLec+/jAHHnDrlFIi+qrko8s5h392vXu+2TGUw2gQaPgJqVajikUbfE2YZ8Q+6L8 bMtTh/B0v26vsRfKzMDptlKmL2tOHopc0yYec4aAxmDn9r2/1+KofZLShXnKvzkZPaPcpg 9Ofy3F0Sxj0lI3rC9nXiTkVeE+DgonQ= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PL3RrN9q; spf=pass (imf29.hostedemail.com: domain of gshan@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=gshan@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1742558575; a=rsa-sha256; cv=none; b=JlTsyY+Sv0WXt2E4OngedDrrPwVU7WFRW7OlrV15PqXkIdMvoLlQ11WDjxe2QeddEhTWC6 pSEAVW5fj+sbfB3L4gBI2PU9Jc+EzGM9ntbArN7RXpK8fgE1qeP+7jA+VEz1+mGh6NS15B hH9J+EzKjyoc14cPezueaI6o7Yim2i0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742558574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tssdr9ycuQAxVV+JKQvCwDsGSIohsIi0k9uUE/7l9cI=; b=PL3RrN9qdgmiP0oOSBtoTKcz4FqBe7XO6T7AJeaZECuNzPizqAHLFntISNH4pZIuZU5uv8 jUR+HTqH+d6tBY8Jd45C8pjJD6wpbqOhgw08ZXqrJtjeHRBpajYQrsNT1sAtWq3tbc3qxi ZfcwQMlFtmjzzG07LnP52f0wxDRijOc= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-541-Vi-M0uomOBeNTpdc9FVFGA-1; Fri, 21 Mar 2025 08:02:53 -0400 X-MC-Unique: Vi-M0uomOBeNTpdc9FVFGA-1 X-Mimecast-MFC-AGG-ID: Vi-M0uomOBeNTpdc9FVFGA_1742558571 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D2139196D2D8; Fri, 21 Mar 2025 12:02:50 +0000 (UTC) Received: from gshan-thinkpadx1nanogen2.remote.csb (unknown [10.64.136.79]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0F0E71801752; Fri, 21 Mar 2025 12:02:44 +0000 (UTC) From: Gavin Shan To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, david@redhat.com, vbabka@suse.cz, linmiaohe@huawei.com, gehao@kylinos.cn, shan.gavin@gmail.com Subject: [PATCH v2 1/2] mm: Fix parameter passed to page_mapcount_is_type() Date: Fri, 21 Mar 2025 22:02:21 +1000 Message-ID: <20250321120222.1456770-2-gshan@redhat.com> In-Reply-To: <20250321120222.1456770-1-gshan@redhat.com> References: <20250321120222.1456770-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Rspamd-Queue-Id: 1B3AB120032 X-Stat-Signature: guesysowsw9j88ew7bm6jq1gh5idhkm3 X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1742558574-594478 X-HE-Meta: U2FsdGVkX1+HawVCVazdfgOz3nVuGs31vRa58pnK/Q+aHrQTkgk1QiDHLpIaL4BfxKvw4UN0PvYIGSr7Zxg1ROX8zUY4df3JpSkp0mAC46gyXH4C7cKiZunLm7xxHlpX0c+4B3R9NyuDOgDgVpGY9OdPyfyWy1aVCMelK2+qohfZLAlcThqxr2Q4UjGatwYs+Umd0GvtLW0xaKVFolFVbZq/Gg8W/7W9LkR8wVURjt/BpADM4StxRvBjgUlFhnzDBkTB+6cP/KnC6ABtZ1Cq6NOHaKvGujFmRnRovXSRlM/2Z3UbWVUV2DrQmplUR1alhT5TDUp4MNBQoOz5eGbMrFn7kg4S9N9X5amSjUo8CbW+G8+IYeNl3hfpCDfi7sCtaqQIBivIBM/bZwYyigIMvNVWC3lhGvO5skcQcTPQp+YdBfm9SyUrKdprYxND9gkZjcfq9AQNUIM/tJQ/jl0BtkoC6jmPu5YAidiUKheFWMYUaojBfuH3grekeOlccomWK5aB2l8roD5zbGKH8uOiST6aPTN03s8F2b0VQWaSo60tIloHSTKL7fEgT/X6W+rdrO9XOfkJ9iANfxLa6D2L3Ubcl5VWx/aPyPCWccyQlrdnA7n36a90xbhq/a9GIHQAO5uwInAVydfqj95tQEqjZeZ0Bf5iQZv0D1PdxxtkNICVXuNBQiBUA0oGd6XvMZNRrhay1PXRcpxJBSoqbsmNDKgdGD2vg8hehicp6kYVqP/YuqN+K3zG8C/GIo756Q5rm2XvIfIPasyEg6RDMvav+fC1iDzjDvHwl9UhFG9wZNOuLPibwDUqV3YqgWsQmwuE7rmZm0vKs+YQi0rYOxUfSJzeeoQgj7T18OxlgG+9PC6eShM02g0dvjhOq2y/6XL2EnkiYM/nbmMK4lYT+hvSpw70cDCmltUr0rqDT0A4rv7LDuZxQuQ3qYWtQ2UgazN8Qr2lAkfDjF+k0NhjABy mxsfcaET CCRQg2u+XiviipUgqahG++zn9WsEHmthVpuIAUhjhs+MmroLUYs7lPmYhR29ICrTHQBCvo0PSZAQfCsXlgVmmdUoDatGDFaBoAmtO1dOkS1Wllw+1j8dMATgBV/wLkk7eua5YCu2/S//gJ7xZuba8eXknnZ3mLkExgACjbJ4TddeHRQybF8oaLVMG5KzS1OQHa1bGnWve7iLd8BNoGYysJ911u0SSlIGPcPMfSkUFAJ67WF09Qpwni/mn8h99r4T3ZqDm38yF2xiSTHAbmGNKKZQRhgcUilmuMWotP776xN36NjBh7bLZ+r0mgo+we+b1NUkmyqaZIeeQlM5Pt0d40oCYnyjXxkjye3yfjhWQDst2RZophhyqgUrXPCVyqlyBaREeJn9poJuNDYKkwisJL0zSS9eptrDeoroQv8wo8+nMS5yH/0mTH9cxI4WP/VE59zSrhakbnj577rQ= 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: As the comments of page_mapcount_is_type() indicate, the parameter passed to the function should be one more than page->_mapcount. However, page->_mapcount (equivalent to page->page_type) is passed to the function by commit 4ffca5a96678 ("mm: support only one page_type per page") page_type_has_type() is replaced by page_mapcount_is_type(), but the parameter isn't adjusted. Fix it by replacing page_mapcount_is_type() with page_type_has_type() in page_has_type(). Note that the issue doesn't cause any visible impacts due to the safety gap introduced by PGTY_mapcount_underflow limit. Fixes: 4ffca5a96678 ("mm: support only one page_type per page") Signed-off-by: Gavin Shan Acked-by: David Hildenbrand Acked-by: Vlastimil Babka --- include/linux/page-flags.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 36d283552f80..e1a9f84bd5ab 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -950,7 +950,7 @@ static inline bool page_mapcount_is_type(unsigned int mapcount) static inline bool page_has_type(const struct page *page) { - return page_mapcount_is_type(data_race(page->page_type)); + return page_type_has_type(data_race(page->page_type)); } #define FOLIO_TYPE_OPS(lname, fname) \ From patchwork Fri Mar 21 12:02:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 14025322 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 AA382C35FFF for ; Fri, 21 Mar 2025 12:03:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B1D6280004; Fri, 21 Mar 2025 08:03:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5620F280001; Fri, 21 Mar 2025 08:03:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42A20280004; Fri, 21 Mar 2025 08:03:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 250BC280001 for ; Fri, 21 Mar 2025 08:03:05 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B9E391CDD11 for ; Fri, 21 Mar 2025 12:03:05 +0000 (UTC) X-FDA: 83245422330.17.51E5C74 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id F0F2C4000A for ; Fri, 21 Mar 2025 12:03:03 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LdjtTZ+Q; spf=pass (imf27.hostedemail.com: domain of gshan@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=gshan@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1742558584; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kfyBhRJTzJJrkSB7WfOD6keM2Nw7kHit0uDNIvdviMc=; b=LpXlc/uyDCm7fKDlpzW4V6G7EvhxE05mQa/nWscvlwJOpHwtSq689FjGdOJdvqHF8jw/RY xirmQLCfffDZ9HHwL9nUAm/1TsZqTjFzGeFxN9Bg6cYdtew9KnVw+8YszozB2SlA1/qS97 gJmTfX8l4fw6n5My1WNNedYQheKsofo= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LdjtTZ+Q; spf=pass (imf27.hostedemail.com: domain of gshan@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=gshan@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1742558584; a=rsa-sha256; cv=none; b=AtvS2WTJoaOwjE2+IBBad0aJyjN1UuKbEwOjopfueQKu7AjtlhRnaS3fJDeH4GDpTUuDKv I9XwgYh6JJstAD/FjWbbSncCwGFzzmPsvCEMy1UdfKp2qX9yMMLlyLjqHg+dvKiq537zrg O2NmNjPgXNFxT5rYT1lGtF+0MkEhSJ0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742558583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kfyBhRJTzJJrkSB7WfOD6keM2Nw7kHit0uDNIvdviMc=; b=LdjtTZ+QKvWEh8BFqDUTcze30rAwVKlQFa2bqgq9V5fCzbEYLQy9cnQgvgRiXSqrkKtsGl iQkHSQjU0WI13eKqkpzli54StLGn6RR3WlpbdyfY0RIJ1ijmm4vUjU1S5fgs3peeg5c2Gw lPDBX2mqjXnzt6x2n73OrCznO4S/aNo= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-svVIeqkMOq-3xOm8K140mw-1; Fri, 21 Mar 2025 08:02:59 -0400 X-MC-Unique: svVIeqkMOq-3xOm8K140mw-1 X-Mimecast-MFC-AGG-ID: svVIeqkMOq-3xOm8K140mw_1742558578 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 848051800258; Fri, 21 Mar 2025 12:02:57 +0000 (UTC) Received: from gshan-thinkpadx1nanogen2.remote.csb (unknown [10.64.136.79]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D3C981801752; Fri, 21 Mar 2025 12:02:51 +0000 (UTC) From: Gavin Shan To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, david@redhat.com, vbabka@suse.cz, linmiaohe@huawei.com, gehao@kylinos.cn, shan.gavin@gmail.com Subject: [PATCH v2 2/2] mm/debug: Fix parameter passed to page_mapcount_is_type() Date: Fri, 21 Mar 2025 22:02:22 +1000 Message-ID: <20250321120222.1456770-3-gshan@redhat.com> In-Reply-To: <20250321120222.1456770-1-gshan@redhat.com> References: <20250321120222.1456770-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Rspamd-Queue-Id: F0F2C4000A X-Stat-Signature: qnyddp7ug6pfw5b71o14a3p4pdy6ikpm X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1742558583-407761 X-HE-Meta: U2FsdGVkX19kVCyuGPnTxC5qVcE/czKUvCkS5rkyIm+tIVTZXuGj0So89M0aR/o5EkAgUETcNKj0rbj1TWEJuFADXP0UNxZzY7Gh16Ybl4YXmEaGHxauY3K4jhGg0TplJJVChHjArpVRbQIUe9tRuiRILDmhSvLB2p7Uop1mXccIihDcva9rWB09dskZrJB/+yY48tECrmSSL5eWJ4Au6HjhoF1FgQkH4rBiQ4TG2THsv8KhaMw8cpb9qgdGVn5dnEl+j0kU/bAxCEXlCRKqRDQibiaQ5AFzd5wB6BvbPb+xELosrAXgdRSX9zCAOWMYs8q6aI3pvwfcU7K4k665VkZR1pXcuIWbIaJhg5hvKxVSiGXr6aAWnxTR0S7XOP1aGwYCAU4TotRGbtP2z7MLaoV0ZC1cJ3zCukCZ4kBExMp2ZknaACo5HxMZ6fovu8Icgg3vyvjmSArdMfd+aWnNVIg/iwlNOXv1q/ANzT+VV77QVz5kIAsnZKKnxiWn4jxmVsJPBBAA1SOEkEPVUceyVNdEBA8ETAdwFa2cthwfE4MlLj/42YXK/0WVd9DM0lgDRUg1GNE3/0B2rDfDpX5exhA7HSFXEdyr3VN0GymEOnqwGhvCxNGgekOZEOj0OhyxeTfaLjKFp0hslJ8qp6tFXZpcu2c+x5H1dn6hEoOmdAsyldGW99u1OYp1Mt6gXd06ogqM1ZjB/9qYC/VZEBXkgUayUbT/EzIAfBP79V5Qd0L6mmtZdwlyX23Rj2n3RKNLdLfCMtBLETJY3AML4mjOFh25PbLDI84xf+Q1KQC2tglcYEPZcKt+gWjK8428K08z0P8s0d5Ux5t+pTrpHSex7h2bGzbUo6fbztSZGJ177P36TpuiPvF550ch78qkoWpIaDbQKJ6LTmNAlh4fGvFMhben2ZWrBtU35kSannV8/wfVA5ni8rL+o5magNaFIUoSG/cqxwYtasvEoBLo5B6 CQL8922l U0JFENfNgnS1ui1DKd92yjeA7xoLVIs63jYE7FiU6d7rHH0SpvIQ9foKo60HRF1dCMfhcXr2sjcaTbjcYsAa8ieFev5eNJ83lID5/LfEO95WQMyPDNivM9VQpz1pdwRtWeIpz+G0LICaIm5RroJrHjbgaxqWAc/LgDeRkYdy9ANVxgcjMKRcQRi2pweAEU7jNcEa7psW+jAxklFHOWJhdd40o+MC4TRiXYYNu/K6L7VunBi3g5etXdhXUyvoEVL9WHl5vIbKglk7AIx0M3gXsnwuEbhXlCvWQZTtgJzvJ5vXmLB3ebF1y1XtlWDiISHw36EXYsAsPtpSIkPHW53lbU1H4SHXot9XjD63UZ0HzZVm8iocStPlBud0df6wI8jPRXI4FxLM8InjBy5nd2yx1SNKBSpkpZV2j8mtzInOr29EA99nfB7kR7aMv1VP3bZZBqcfofGTbSw0VRzw= 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: As the comments of page_mapcount_is_type() indicate, the parameter passed to the function should be one more than page->_mapcount. However, page->_mapcount is passed to the function by commit 4ffca5a96678 ("mm: support only one page_type per page") where page_type_has_type() is replaced by page_mapcount_is_type(), but the parameter isn't adjusted. Fix the parameter for page_mapcount_is_type() to be (page->__mapcount + 1). Note that the issue doesn't cause any visible impacts due to the safety gap introduced by PGTY_mapcount_underflow limit. Fixes: 4ffca5a96678 ("mm: support only one page_type per page") Signed-off-by: Gavin Shan Acked-by: David Hildenbrand Acked-by: Vlastimil Babka --- mm/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/debug.c b/mm/debug.c index 8d2acf432385..b6bd9555ec7b 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -71,10 +71,10 @@ static void __dump_folio(struct folio *folio, struct page *page, unsigned long pfn, unsigned long idx) { struct address_space *mapping = folio_mapping(folio); - int mapcount = atomic_read(&page->_mapcount); + int mapcount = atomic_read(&page->_mapcount) + 1; char *type = ""; - mapcount = page_mapcount_is_type(mapcount) ? 0 : mapcount + 1; + mapcount = page_mapcount_is_type(mapcount) ? 0 : mapcount; pr_warn("page: refcount:%d mapcount:%d mapping:%p index:%#lx pfn:%#lx\n", folio_ref_count(folio), mapcount, mapping, folio->index + idx, pfn);