Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2088131lqb; Mon, 27 May 2024 07:31:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVG6G469cy31853A3LRwZwbdLCqnu8Q51MKwIURekDUIxl27GqAa3OsdpKzM/pGNs+kQLZ1HRV85ZW6hX21AUd2jhwCSPmU8K5YaCPYDQ== X-Google-Smtp-Source: AGHT+IGtenAxxLu//laFl1sP0jjpkOimY8DJToaSsDoqMK8LLu4b2I8Qg8Cn4IhZjEorLDQwYRjD X-Received: by 2002:a17:906:318c:b0:a5a:8248:253e with SMTP id a640c23a62f3a-a62646cd4b1mr576745766b.36.1716820281120; Mon, 27 May 2024 07:31:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716820281; cv=pass; d=google.com; s=arc-20160816; b=sDhG1j1rzts9ZrhpIgfwRGHi7k0zxfaPevxZTZp48QOD1ZSK8FxJA5wHbWDo6Kk72S J2sCfpQ7Y2KcANpmsoBcXM7HJP4AjKfuUifgSRvFWzod0nPX8opKryaL+VTa2v7z9PWy hT9+XEYCxFm6vGS0WJUED4loQF/Cl94nb9PtVQuWfpSKIf1KQ5Yl7m45MGVm0Ra3NXA5 MDnyB9UwAzWrzec2ohDXeYnNpv0jzFDehYtIobTY7O+cA4c10APfLG2jmhZTfEy8hyEK ePOJCXBw/AWCEZL/xCuUxvPxxY7DtXGejG31hkBhXyMhQR1OR/kTAsmkyixu1jVWz3qq WXnw== 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=1jgAtxlgpKD5tttWASyjS08Kd902IxQGps+U4uBLOWU=; fh=4qo2wXwF6+wBmVpKt9nE5vXwAOEbbhXPZvwe/C5tp4o=; b=Slp/TgtRDWpoHqqnMn2FBerigWrEV67ly7j7zLuactsE7p87ZKC3pIQS3XgX+LwR0F xqZr9hj1X/CH9ps94svw+fYghAnjxw6cqBYsG5OkpL+7m6SlzWyTwqMpmBh70hZxDAPg 2GOfGOh78Ugp9OSuLuhN6EMESbjQo9cYsA5W4fiE3aImu+ZmzFvijOmHfofTIS3BiYJa NeWgSYZaGDPJmKddF+dPk9wFSdV8hJrB8IqeDkzGQDbVi8H7yLC/0jILdHPpZ7pFTZfF MY/aIVroBeRBH028vRdVTVhfsCVQmeLT+FBcCRUa1/P6aoUhjGEV6y+Y8P4fdaVDRnKo 4FvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bMn+Ayea; 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-190868-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190868-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cc681a7si384487066b.641.2024.05.27.07.31.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:31:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190868-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bMn+Ayea; 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-190868-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190868-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 EDA721F23B9A for ; Mon, 27 May 2024 14:30:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1BB1181306; Mon, 27 May 2024 14:15:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bMn+Ayea" 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 65AD61802A1 for ; Mon, 27 May 2024 14:15:18 +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=1716819319; cv=none; b=WSk61iEtp4C17mt/qz3iNynxJ3C8cfuhMs+ZaCdoIxCylfcykJMnGVMOY0ekWQX7hxFXYNvcZc8l7/E6oVhiVVjvKtIqnIfHY0xJyNT8R/G7ZdSUfVSQF++b4eHbHjezY7a/56msJHtTJe12htZMLOkHEwVEqpNj8rlYGsrdVSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716819319; c=relaxed/simple; bh=xD3et00YAXffq85hFqADbpg70st5gD0nJKk0msmLk+A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V0+h0iwHFTYE9T7r8nLzKC/2pdn54Tpt/NvuIA0yiOcaaskFo+vF1gMRD8qkAT+erMBJ1A1WsAzKugCAgUxxYudWNmN3KqD3JV2aHnLjDReYfxeAmMGRsyP+5h/IO3ERe0J2kJYnN/ppIWkrnLWak7YHswl9JVA5N5Fv37NeQTk= 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=bMn+Ayea; 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=1716819317; 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=1jgAtxlgpKD5tttWASyjS08Kd902IxQGps+U4uBLOWU=; b=bMn+AyeaD5L8WymgmUKnAleoiUSrswxSd+eJWZsVUGjGaATjYs5UyDi9x4towPopVS9cB6 AphePwtK0+5hAqbPcS8H4OGdmXoHFQG9o0G+hrMWqbLdo9fk0bFVjPct4an0rjDiSDd8TE WDh9EbWztLr+Hy+A62Y5BykVUvihAlc= 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-602-PvG6X_TONr6hv4V8Z_f-EA-1; Mon, 27 May 2024 10:15:11 -0400 X-MC-Unique: PvG6X_TONr6hv4V8Z_f-EA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 641568025FC; Mon, 27 May 2024 14:15:11 +0000 (UTC) Received: from t490s.redhat.com (unknown [10.39.192.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89ADF1C00A8E; Mon, 27 May 2024 14:15:09 +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 v1 5/6] mm/filemap: reinitialize folio->_mapcount directly Date: Mon, 27 May 2024 16:14:53 +0200 Message-ID: <20240527141454.113132-6-david@redhat.com> In-Reply-To: <20240527141454.113132-1-david@redhat.com> References: <20240527141454.113132-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.7 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.1