Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp559690lqb; Wed, 29 May 2024 04:20:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlMGJTnFinV1ABz6Ef3LRNGGxaGWpFURIfj4z8cS6oS3PuWg3pJFzsNcgjsr4bt9UcIJumvvgoCGqsBm0tqManReBY+Vyz3Fkft8l6Mw== X-Google-Smtp-Source: AGHT+IGkoK2Pa8sR+/vI+Hn2wFsoUBiXIMQ+pmwVaWizgo40Yyc8C5IwJX+gAbF4HSJLVoZUU8zf X-Received: by 2002:a05:6358:63a4:b0:199:1605:edd3 with SMTP id e5c5f4694b2df-1991605ef7dmr312790055d.15.1716981615514; Wed, 29 May 2024 04:20:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716981615; cv=pass; d=google.com; s=arc-20160816; b=GDZBrLhUQKHzt23eqp/U59F+cBDVB/Ffd6WIK445PtX0hxALhv8Aol1+m3vO4t33tL 1B1HfrxqAUQxPUIhffMOcz2hypD4EUixCd4/sLKud9kWz4p3tpqZcz4f+B7aUhXOT6j9 +KsJQorDe8504AwLl02Be4uaJVAIUQQtXx7I7UGrzq+8/FGatzkZonIkfq7WZTUAGRhc hHc3WYL7S6JtMu54yL5T9RlRxsy1N7NqU5uDwwYS5ks2hFTPWchnFfxwkN7M+QGrBiCG YTdaaAPuGvHSol8aQqoiaO1VwvpRr38BQiy/QRqL+vv57tkiB6h0NXuNQtNTWitS0i8T Abxg== 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=O9wGKMA7pg+ELfK4C46qM4+rq+qnJqY5pRyECiTlobg=; fh=4qo2wXwF6+wBmVpKt9nE5vXwAOEbbhXPZvwe/C5tp4o=; b=gbJ3f3MdUtFAz6almk9mA3gcNhINTUQQWzEVCTuKnLfuJBP2mI+n5+GhLCChJFrlx5 VyDzZrQZJseT11EsrXAgo4eNIoyURm0QXC0dnEKdaoZAITTfkHUkXQ2rW69rLrzo050U WLabdthyNXJDYspC0/HCMW0BZIXOG6w9cMdE350dRzvgfgEqmo2Alwnlzo2uxruZkgcY oMGDx5u8v7W0FGi6fDG2bSdVzy28mVPqbDl052qbDYlQ5CYNO8iZXTh0ZN7w1LHuMOKh NTiqfRgswd9likT+inuEh/XxJqP4d2HxMC0cf46rWsbDysrCp6V/MWlNdJNw1C0QhWwm v/AQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PekxWPKT; 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-194009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194009-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68221b7514esi9621759a12.39.2024.05.29.04.20.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 04:20:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PekxWPKT; 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-194009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194009-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 EF389288FC6 for ; Wed, 29 May 2024 11:20:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9401A181310; Wed, 29 May 2024 11:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PekxWPKT" 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 5A0F3180A83 for ; Wed, 29 May 2024 11:19:21 +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=1716981562; cv=none; b=fzjzt4aMVEeu58uJXsilovQbCc23CyePLBvt1XrKoCxKhPDNTQXsVyGFi2dltUprLA9k9ygXFHrSFuygb9tGYLEmZtGzmzb4V9j3cRPBmu9/R4wxvTtlwZj03+MJWm+ZzypAE/vGthEVCHFUOKZV+4Tj+yeXLUzGrRm6cvIBW8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716981562; c=relaxed/simple; bh=u1TfSxJfb/OshHhAS7cl9CkuPjr/yVjayHR5SnVoIyo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ipQB+WcZwYthD5S9RcJlzYFQ9jfwr7e6PRqqX8SJiWqyjlkni5XMrNdflZAwCqZmcm/KFECFlbnS+1HCv1xfhO36B5GigzAmCEVg/kcYC+6GsTvaNs9P5WVBPjtDCCZw4p+ZqYAaSMm42WT0EJrzVVIWDJYLOdKQom3Qnj6XpnU= 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=PekxWPKT; 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=1716981560; 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=O9wGKMA7pg+ELfK4C46qM4+rq+qnJqY5pRyECiTlobg=; b=PekxWPKTRkzVu7/8WIJK3BxLYPPBBF9+F02JjjXzFQB44NDacb7N48NdatcRVhxxaROrQA 0lWBzRYf9vOQgQv2Jw6/G79NHmmNXYd+ftZfb4JrCifDSXuGCLaPo8Fnq8e1soBxETdJwF BDi8C4F+zDMx1zneTgbdUzSWx51Z3Lg= 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-600-YyUVCmUjPleKjz5PsgrFIg-1; Wed, 29 May 2024 07:19:17 -0400 X-MC-Unique: YyUVCmUjPleKjz5PsgrFIg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 6752B3806701; Wed, 29 May 2024 11:19:17 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.193.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA1DAC15BB1; Wed, 29 May 2024 11:19:15 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , "Matthew Wilcox (Oracle)" , Mike Rapoport , Minchan Kim , Sergey Senozhatsky , Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [PATCH v2 5/6] mm/filemap: reinitialize folio->_mapcount directly Date: Wed, 29 May 2024 13:19:03 +0200 Message-ID: <20240529111904.2069608-6-david@redhat.com> In-Reply-To: <20240529111904.2069608-1-david@redhat.com> References: <20240529111904.2069608-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.8 Let's get rid of the page_mapcount_reset() call and simply reinitialize folio->_mapcount directly. 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 ba06237b942d6..9fe5c02ae92e7 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -177,7 +177,7 @@ static void filemap_unaccount_folio(struct address_space *mapping, * and we'd rather not leak it: if we're wrong, * another bad page check should catch it later. */ - page_mapcount_reset(&folio->page); + atomic_set(&folio->_mapcount, -1); folio_ref_sub(folio, mapcount); } } -- 2.45.1