Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp607643lqp; Wed, 22 May 2024 14:04:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBueUDbzEXpvjVRSMFwsOslXR1lW3TfxQXnG7AHlHIC/S1alqudBEoeJ/KUilig596JrWsB2ATKLJRJ5mYHsZSX/2SqNA5gmj0qNTozg== X-Google-Smtp-Source: AGHT+IH+Ub6xMtBqkCz10Au8teJXlygzrUIchV3hEGIGW8lJ3McZ35pnhBYozgWdRq8RSuS/i2mt X-Received: by 2002:a17:90a:4889:b0:2b0:e883:270e with SMTP id 98e67ed59e1d1-2bd9f48e6d6mr3233682a91.28.1716411884457; Wed, 22 May 2024 14:04:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716411884; cv=pass; d=google.com; s=arc-20160816; b=bMOhSMFAIa6olZyET6EuUAsRY2th99tCmVoyv166KR4Cuq3P9upjcr8eUvqiAGhqrw L5TbyR7J457SNv6Qkd8sg0I/Nu3Z/yTraCUcP6bpBlN9WAIxbNCICTQmMerpGdgVRQRP 81dFvJsDWa1KyxItozyRNKhVDoerAA3Y91r5JSFHpgnQFIf/Je4gZLEy72sidYo4SIfl i/z0yiWN8TRRu5jFtYcBkk6pJCJzRCjACpk4dkIYWX2Odjpo/Rwwyo3+4i1yMjL9B3o6 +115OHcO6lPFGqLNUAnnzOyLkRFLO+gXNlcu/R8ZMoE/1CueTO3OSSDGNbGfEUhYYeCS c+iA== 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=UoCowHIZmwbvZhrcmlKDIE01w7msvc9uRa4jOe21Z9s=; fh=4qo2wXwF6+wBmVpKt9nE5vXwAOEbbhXPZvwe/C5tp4o=; b=1Fxj0giSH0/CGIQfNk0P1eI9oC0ttaRBmgku0ov3k88kjIx9z5B6O10w4c9bpJ+u7f NfRXOXA8ZzWXnEM2DkYdzG5l/5ReeGqNE0d1cfu9OBRryQivbw8qna641EfXuPNUoQ/Q hd8Wc1ueIG/2yX2eccws9xsGJF3tXK31MjoOEB6h5bxCGbHJFOZczozD5AdEmzCvs558 OTGDht/et161jx9PktrhTWEhIM0imj5qZXx8hLO6qOthY4q6ttx6hd6ySB0tJBCUSjP5 4h0LO7y8KftQbQMIXs8SBmiz3VfnLYxI0B8bm6HvvS9TTPyeImIoZebCB+CW5ZSeo3Gb zvUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fDK8cwoi; 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-186709-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bdda34d129si28578a91.172.2024.05.22.14.04.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 14:04:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186709-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fDK8cwoi; 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-186709-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186709-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A6658B21946 for ; Wed, 22 May 2024 21:04:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5799146A71; Wed, 22 May 2024 21:04:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fDK8cwoi" 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 BF714146001 for ; Wed, 22 May 2024 21:04:00 +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=1716411842; cv=none; b=BbQjWA0Bw1kSZZoGbx3MiYyU/HbPV9cVEo7ukq3Frddoffby+QY+XgYx3oTJvEICRXVDvP4NMTeGuK8xLHc3bbpUttUy7jZmreSTuvZ1/JydZ88jxzSSQKvUXpGmvdJFeTBlzrjVHWCn4yPBOTD+T7/xdEpWzn6f51m/cQtChos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716411842; c=relaxed/simple; bh=AU3lGkdx+T9Jc19ZDNExTERbtu67kY/YvVysSe7kqEI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tn4PZ8rdlvgwMzvotFe9OMbzlzH0ptfH4jafdJ9VdXQhEWfBEzFo+k5i7HWa1+24+0N3old+7tzd7GWzKfXNRelel9p6zpEdzz5QIjiI8U3xQDPcOEUttC1ZV9DLIjJtAHknqaLKgNSVY8PJLgt9gBSydtWBtLPZ2jzM+DPsu64= 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=fDK8cwoi; 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=1716411839; 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=UoCowHIZmwbvZhrcmlKDIE01w7msvc9uRa4jOe21Z9s=; b=fDK8cwoiQNoatJAyBKfnz+0bvyZsSWKkac4gb7gAS9GPUlN1FBTex9AaOXexKOf2l+PC56 NxQBLBorZSRODFf/pPrccHwyhW1IIEHJU3xzNkYMErdEmsQFtM2c5WyDDK7cuCrym55/Ht qqQiBWG/zwDUKMMFbVdcmMxW6Ahqt0I= 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-194-SYtBQfzfNPKl0OuyCBwpzw-1; Wed, 22 May 2024 17:03:58 -0400 X-MC-Unique: SYtBQfzfNPKl0OuyCBwpzw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 C62691C05142; Wed, 22 May 2024 21:03:57 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8409628E2; Wed, 22 May 2024 21:03:55 +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 RFC 5/6] mm/filemap: reinitialize folio->_mapcount directly Date: Wed, 22 May 2024 23:03:40 +0200 Message-ID: <20240522210341.1030552-6-david@redhat.com> In-Reply-To: <20240522210341.1030552-1-david@redhat.com> References: <20240522210341.1030552-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.5 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 382c3d06bfb1..c4ac7289e88a 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.0