Received: by 2002:a05:7208:31d3:b0:81:e143:7c29 with SMTP id v19csp2634068rbd; Tue, 9 Apr 2024 12:27:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWS8j36ZBJYvKY2nOiY5NRLmaNFBQZIVN3r2siCsJ98NxAXfsOXQsMl8j7y6Di5QeljrYMgTbA04jAHbucnXdYVVklIwdvAI9Z/ItBWNg== X-Google-Smtp-Source: AGHT+IHdpOOfbYCQWwFWSK9u2N/O0p2UE17t2bLHYDyP9el/LtWhzOr12BX1wvL85O1xoRoPF9hk X-Received: by 2002:a05:6830:1050:b0:6ea:27c3:6342 with SMTP id b16-20020a056830105000b006ea27c36342mr766614otp.14.1712690825624; Tue, 09 Apr 2024 12:27:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712690825; cv=pass; d=google.com; s=arc-20160816; b=ZsmMimkRcNn7MAJPqTtkf74xDAvro3ws8KpKFBdUG4+6tGNALrb29Y5I9gcpSg0zMK NvAU2MhBuh2JS3PGVUwbo7s0MafXZBfP1q4q/fN12qhlO9XLKh2wGIHRgaPDWUZF5CQA gKeSr1UYzTNOs8ssmjfc6N35wstxuChMLGJtoyFWqyJxdWY59C0XBGvGPBxb47xotpTs PDfYHM5XmLSkcpE8wBWhylqcQRZdO2e7nCjNlp4MPYs8d22n0OnRTS5m/HHGI0gXiw+q L2mvIMICZLp47GoqYFJUm5KPlhmpZQHoiT97OH/ChM0s3Fepl1x5Kx/WigQWBD+WchXA JUjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=UDO/LuGyFJsgzNpcvXk5nDcpkN8Vm1hlfEW8fwIXGqY=; fh=6UXOkRl8PLWnLRlJFkZ1FKxRpZrfO06mwvecZ/lFyqY=; b=bM4U6U2PK+1N7V37a3iTWd4viyMBdXTaaGMJpVuBO9RWWhFOoNbg6wjBcwNXiWsAe8 etYFdrVyVwEtSCEuoEMyXXmJ+UX61e7lZQmyzMlNefFTPv+KJbEN0Y3U+xCFT6+LZssY WrRzmJzEYZsx7pf3joij07jBLSSl8J3LtheClF4p7kHfybjg+tP+ldVtpJpim7f3Tk5y 5tuTXQbl2BnlZIvWzJxnBb71rllYAeZjd0Ky3DtDhkOtzJyusAlyGnKpuMNcs4w3HJJo y+BjVolMkfWNRfqY1P6LHzyZvkGFn/IKdHwH7UfA6xSz6CRHw8XTQCIOK3dZ89pHXamp 0YgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hbSXSg9k; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-137526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k4-20020a633d04000000b005dc3614f97csi9266942pga.571.2024.04.09.12.27.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 12:27:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hbSXSg9k; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-137526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1F5B2284419 for ; Tue, 9 Apr 2024 19:27:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 049151586F2; Tue, 9 Apr 2024 19:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hbSXSg9k" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF056157A5D for ; Tue, 9 Apr 2024 19:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712690728; cv=none; b=MowOJ+Az/+uNeCi3XXJpAo3oyHlEG6Z9lxz+Qm3Z5bHHGsocFS/8zIXLZb+k7DoMujVwKj6+K5q62M12CAkUjWMMOFWXSC46k5OetKWcCcPLtMR681lWEKCq7lB47LMjHCDvQsJp05sUDNbXqzZuRDbW5ot7wlAKJSwsBSdUUDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712690728; c=relaxed/simple; bh=8ggUQvHKaMkbaZKa6fSqKVjkq7jK/5ChUl8Qcha1vQY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ccB9ohY0WCZr4E4X4WTMGhhyg7K0dwpotUKUAJ2Un4DaqgqmfEvR3xNb4vzvK7AO0zdb8NYOZaovaVbClz+TXqx9E26jE8jz0LKyrXoVsrWc5lUPdk+MwMMi+7tp/Zs0y76HSAFluyIHrQzLCJwRK7YCeUZqQDS3TgifhjL2IL4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hbSXSg9k; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712690725; 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=UDO/LuGyFJsgzNpcvXk5nDcpkN8Vm1hlfEW8fwIXGqY=; b=hbSXSg9kWmcgN2xmphjGZN0sPt36CZWSHo2QDhaLuvRrM203vv+9WLZQLYU61cj0n2rijK Rorb08KxAAm2RTzkacmP/HkRmoHUc47Nom7Do3y4dkuqy75kRmmHHFpGOueJ3e1yiMRTpx VtDkHYCFUYs1BCfwuqELpPKaoNUZnBs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-79-q_7BzCqOO76DTj4PZpIcDA-1; Tue, 09 Apr 2024 15:25:22 -0400 X-MC-Unique: q_7BzCqOO76DTj4PZpIcDA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 E95FE890524; Tue, 9 Apr 2024 19:25:20 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.192.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1E2B40AE784; Tue, 9 Apr 2024 19:25:08 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, cgroups@vger.kernel.org, linux-sh@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, David Hildenbrand , Andrew Morton , "Matthew Wilcox (Oracle)" , Peter Xu , Ryan Roberts , Yin Fengwei , Yang Shi , Zi Yan , Jonathan Corbet , Hugh Dickins , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Chris Zankel , Max Filippov , Muchun Song , Miaohe Lin , Naoya Horiguchi , Richard Chang Subject: [PATCH v1 09/18] mm/memory-failure: use folio_mapcount() in hwpoison_user_mappings() Date: Tue, 9 Apr 2024 21:22:52 +0200 Message-ID: <20240409192301.907377-10-david@redhat.com> In-Reply-To: <20240409192301.907377-1-david@redhat.com> References: <20240409192301.907377-1-david@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 We want to limit the use of page_mapcount() to the places where it is absolutely necessary. We can only unmap full folios; page_mapped(), which we check here, is translated to folio_mapped() -- based on folio_mapcount(). So let's print the folio mapcount instead. Signed-off-by: David Hildenbrand --- mm/memory-failure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 88359a185c5f..ee2f4b8905ef 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1628,8 +1628,8 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, unmap_success = !page_mapped(p); if (!unmap_success) - pr_err("%#lx: failed to unmap page (mapcount=%d)\n", - pfn, page_mapcount(p)); + pr_err("%#lx: failed to unmap page (folio mapcount=%d)\n", + pfn, folio_mapcount(page_folio(p))); /* * try_to_unmap() might put mlocked page in lru cache, so call -- 2.44.0