Received: by 2002:a05:7208:31d3:b0:81:e143:7c29 with SMTP id v19csp2634728rbd; Tue, 9 Apr 2024 12:28:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPQ4JI/xAx1gsJ6BqxvLMDylypYms2/mW5SfxJUvmzxL9jo1WVAGaeO37ddf2ZAUt4vjKdvEERWtrZjQsgdiHHjk6IcUf/BJTAd/X0BQ== X-Google-Smtp-Source: AGHT+IGjFDI8ZMKqbl0SpB+QqeKfXf+jeYKpcED4YycJApOtWCCdZup7Q9JyGVpgUNHQGydAW4uE X-Received: by 2002:a50:c345:0:b0:56e:966:be7c with SMTP id q5-20020a50c345000000b0056e0966be7cmr392630edb.2.1712690933096; Tue, 09 Apr 2024 12:28:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712690933; cv=pass; d=google.com; s=arc-20160816; b=gn9shncBSYBaGn5EjcBDq56PolJ0dNV9JtP/EZINg4ER8R+w+jTdM3HjuSLXL5oILs JSN4rA5T0sKO1GDbewlDk0d91vgdbpwh4TXF0gHQHRBm4GfG/R1Zi6dwBR09t55hAXTP Jmpq5lih/GroijF77+cjK4yJMYMpzr0TRDSQLoNRlrts2cqEr0+dQG8eKr/KuJWmaA6J 9j3/UGkOC8kZJwThi61Munu6B+zEun8Q22O2HvUCznY2Tg2Ttq9D9CpZNT89vYrv6P30 vQQNLJ+K+8+DBN6ILBIp6l4Bwc046iEJ2Jx3ErItB+LsE/GqUJntYo1EznHqUfijPOMg 0GFw== 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=z56f15PtBl+UvHHvSB3Qx1+Za4NemO81qqaBL/Rijfc=; fh=6UXOkRl8PLWnLRlJFkZ1FKxRpZrfO06mwvecZ/lFyqY=; b=qKI99XTBQ4ucnJKGl53Bp8inAOSmsruKmXge5qGQihwxLGoWf5/CDmLxoePie3J/Fg r3hr/lQSamD1nnIeq7hiEPEaHkqpeRNNmgYRxyl2pyRA/SDeIYjMYBjwZ0Q1XfWVK/uq S+FXh4ovtPQVkA5GCgrrqfjbpwoGhB5Ykr0CNY23JoYdBnTuVohaUsplu7UQOWQNe6rA ASxPuQotY/Th+zCqIOMPfn5WjELcbKzzugwBo/Hevi8GZ4A2nhlvR3ngXSSxpF81MQeH AgfPibpltVCkl9BZSQafU2R/FED//08pBN8GLRf0C+MMYCkWzJGfuLmG+EKYtexYvaIW NPww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hy2jgp6a; 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-137531-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137531-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f14-20020a50a6ce000000b0056c38f7295fsi4992426edc.602.2024.04.09.12.28.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 12:28:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137531-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hy2jgp6a; 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-137531-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137531-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A10371F23CEE for ; Tue, 9 Apr 2024 19:28:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF0CD1586C1; Tue, 9 Apr 2024 19:26:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Hy2jgp6a" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 BE742157E60 for ; Tue, 9 Apr 2024 19:26:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712690776; cv=none; b=rSV6lyZiB6B5zxI3baZ4Son4BfoH8MAcQe1g18CGDDYoRZcRP0W2ZI1QZKHXLjw3mT+5VnIYsyVmB6WffJ8tQWodDRuZch0ziKNGxWctuu+bfD/lR36t3ceOpDBQLq6kS5Drm4JDjmNtwIjowkV4WMumTYz0OHVFovykzuJKyXc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712690776; c=relaxed/simple; bh=omqhDgTrChEETgeMiUUkVBBhOlzU6W6WQjgKatIId+E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TBOw6bJ+5FDfWOE7r+XFPaIxmZdoCCT/4ks5ypzbuJSBEDbuwXRVtnpDBAy6t1xeGFJgehi1bjPj8qxqN0x5/ipx1EdSVwY14TzaEosWdmCRk+FnhWKN3Z6RbURWVlwquU315Xx5Wc9IFzXiAWFz+zO7NRqvt+kpGfmdKmmpNpU= 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=Hy2jgp6a; arc=none smtp.client-ip=170.10.133.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=1712690773; 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=z56f15PtBl+UvHHvSB3Qx1+Za4NemO81qqaBL/Rijfc=; b=Hy2jgp6a9WdBLZx94x/do/sXJcDdjtSmkgjijMm0Dt9pBRzLptKfB57QuYJWVyIkz2JBPY uoxrgBWxk4JGa/ImnXDq13F/vxBx7QhL/24pOL0gWI7pcL7mkFfPFUgBeUicsFL+77xuDC qdVqsreswdNdm33KiSUe89WsK9yk/SU= 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-14-Ea0Nh1k0ME2JTUIPiSiprg-1; Tue, 09 Apr 2024 15:26:09 -0400 X-MC-Unique: Ea0Nh1k0ME2JTUIPiSiprg-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 3DD5B3C3D0CD; Tue, 9 Apr 2024 19:26:08 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.192.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B0B440C6DAE; Tue, 9 Apr 2024 19:25:56 +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 13/18] mm/filemap: use folio_mapcount() in filemap_unaccount_folio() Date: Tue, 9 Apr 2024 21:22:56 +0200 Message-ID: <20240409192301.907377-14-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. Let's use folio_mapcount() instead of filemap_unaccount_folio(). No functional change intended, because we're only dealing with small folios. Signed-off-by: David Hildenbrand --- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index c668e11cd6ef..d4aa82ad5b59 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -168,7 +168,7 @@ static void filemap_unaccount_folio(struct address_space *mapping, add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); if (mapping_exiting(mapping) && !folio_test_large(folio)) { - int mapcount = page_mapcount(&folio->page); + int mapcount = folio_mapcount(folio); if (folio_ref_count(folio) >= mapcount + 2) { /* -- 2.44.0