Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp963771rdb; Fri, 9 Feb 2024 06:33:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpKqFDAxG5m+9E59u9L1vkX2NhIkxDlJwfe13yG7xY/dlMB+owp2UdHFfAL9Nonst2TN/6 X-Received: by 2002:a05:6870:2192:b0:219:b4b1:6d8c with SMTP id l18-20020a056870219200b00219b4b16d8cmr1732743oae.39.1707489100575; Fri, 09 Feb 2024 06:31:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707489100; cv=pass; d=google.com; s=arc-20160816; b=kNjWPAvdzg8FWhmWp5NK0hFRTf12xrcCEdf+Us9lZZZIn9Gy+EDlGQ6EHpHXEAX3R3 PUbe3bLhVgZHrWBF4x/fJgrqCQ5VmmBr8Zuc+MTh9A8ZUAtr+NVdVB+IOUWe6ugvvbWM i+E9/lIQY38b2AksgngPaF6+8nCFyrTXZzVV0n9rgDO9lnkk8Sc5+Hlnl3AlC/El8624 FJPq8pLU9MoYqqSQ51pwWmDkBDLH0ud/qOIC4/ZZLYrQKr7oAqfQOLPbvr/ydePi8eOQ 2b5oWlMUdf5T0bNCGrK/30Qr5Q42xpUqByJaFCFJWdVxbiIMgtX+AAH4PRkl/FDS0IL8 m5ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:content-transfer-encoding:content-language :accept-language:in-reply-to:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-filter; bh=oOOPXQ1C4QLRnGizBlTW9/7mF80l1aSAxMsYloK3g+M=; fh=QY+YvhjjO3Qo4ISixFgiaCRiW02r6abuc4k3+QuCSUQ=; b=LfToDsA9tK0rypGOO0D1+CohNVxLqVJwzn4zOC+2LX6VHAnKcFtiY9mChvWBPVxTbo DJ5dMMJ9GrvRICoY/60HqmBGwvYX6Xb4KwtXuo7zrD90GMp8ka8JHfoRLvCWgryLIdrb BlYOF+Jp6aWRijx7/KjPkuZfW7Bm/M/FuZkL/S8mNzqCPZudWoK4zHwPGR5YUUiDmhrx 4Qz1Omuo4cFf4q9H7C6+PmxVJ3YQdnXLmgHV05/YjuSAsxOo/fAK5uHK/YQpEB5nk8Jq KuXeJ4YLD/+M/dOCLOV0m81ACVfleZmokZ3GV5jr8nCElJZpyfz36ATQUQASIUwbvT7Z CTLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VXwvMZgq; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-59458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59458-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com X-Forwarded-Encrypted: i=2; AJvYcCVj9kNcAo8NcIvZXJCo0udQYaBTYO5aJf1U29AHIW9AIietztFybe6/4VaX9ZLonfExB8+EwfHA4yvjP492CHniJBvgdpL+OdORC61XGA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x11-20020a05622a000b00b0042c4fe3183esi2013309qtw.316.2024.02.09.06.31.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:31:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VXwvMZgq; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-59458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59458-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 45DC01C21221 for ; Fri, 9 Feb 2024 14:31:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1780471B5A; Fri, 9 Feb 2024 14:29:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="VXwvMZgq" Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (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 75C5C69D33 for ; Fri, 9 Feb 2024 14:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488953; cv=none; b=a2yDQ6TLQofbV4LnR/vjIkF9iDrBDXj1+cIVt0JmsSlCT3wrOhicxAej4SQ1+hisChv50U6Zf9DA1R49SvHHQwUMwhRunXUnptrFqiAe2L6CwLLNrV2RHFxJ3P7dK/Y7MhJ5NW2nTDvmzriDvRQ/5aLtSk/t8PTucWoiI6CMgzA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488953; c=relaxed/simple; bh=DCzY/JGjb8mhsUf+XcmDhjOxoBtl8L/RsfsIsrJ7IU0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:Content-Type: MIME-Version:References; b=rMXGUgLzFkxsr3flvvBKHGJI0XrTGhlhm7W0FIj5tFO5MuBtvWcP1CvjXqjUHVjyEsjXY2+OYJe/pmpMZWsGrvgC/AMZnPR8malk9pNkh9zbarXOx3hbHQEV1GGd0Yxf3hPJLGf0bXDFY4eJLq7DbuC0zpg9tTxdY7GL99L6l1E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=VXwvMZgq; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240209142907euoutp0177e3c18c562f6293cf5c045bce70a3e5~yOCamzUoV2559825598euoutp01U for ; Fri, 9 Feb 2024 14:29:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240209142907euoutp0177e3c18c562f6293cf5c045bce70a3e5~yOCamzUoV2559825598euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1707488947; bh=oOOPXQ1C4QLRnGizBlTW9/7mF80l1aSAxMsYloK3g+M=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=VXwvMZgqJhlzJrEbIdatR1upBBp2x0B0+/RtlptwGIxcD8Harg5N3Nq6kHxKB/GM3 VIz96cDx5AmzDsB+lRObwNrhSQb7C9zQCrxGXbhD7YEE1CqhR61cKdNQBj19jlo5au mgLa/TVfh9EinFtfloyomR5OIR+3qwQRH59aVKL8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240209142907eucas1p2072a6f2e9410ced2ddb2e9a8c7628edf~yOCaQzec22618526185eucas1p2C; Fri, 9 Feb 2024 14:29:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id FD.F5.09814.2B636C56; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240209142906eucas1p2c31598bf448077f04eef66319ae2f3a1~yOCZzbmxq0060200602eucas1p2_; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240209142906eusmtrp1552e5b8ad10b0382bfcbdd74d7755208~yOCZyxTrv0528405284eusmtrp19; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) X-AuditID: cbfec7f4-711ff70000002656-42-65c636b241f9 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B2.B3.10702.2B636C56; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240209142906eusmtip11fa07a35bc26d35a2936315444ab40e3~yOCZorTLt0114301143eusmtip1L; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 9 Feb 2024 14:29:05 +0000 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Fri, 9 Feb 2024 14:29:05 +0000 From: Daniel Gomez To: "viro@zeniv.linux.org.uk" , "brauner@kernel.org" , "jack@suse.cz" , "hughd@google.com" , "akpm@linux-foundation.org" CC: "dagmcr@gmail.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "willy@infradead.org" , "hch@infradead.org" , "mcgrof@kernel.org" , Pankaj Raghav , "gost.dev@samsung.com" , Daniel Gomez Subject: [RFC PATCH 6/9] shmem: set folio uptodate when reclaim Thread-Topic: [RFC PATCH 6/9] shmem: set folio uptodate when reclaim Thread-Index: AQHaW2RUZLM8QyQXnk2QIeewqLmB5Q== Date: Fri, 9 Feb 2024 14:29:03 +0000 Message-ID: <20240209142901.126894-7-da.gomez@samsung.com> In-Reply-To: <20240209142901.126894-1-da.gomez@samsung.com> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHKsWRmVeSWpSXmKPExsWy7djP87qbzI6lGixYZ2kxZ/0aNovXhz8x Wpzt+81mcXrCIiaLp5/6WCxmT29mstiz9ySLxeVdc9gs7q35z2pxY8JTRovzf4+zWvz+MYfN gcdj56y77B4LNpV6bF6h5bFpVSebx6ZPk9g9Tsz4zeJxZsERdo/Pm+Q8Nj15yxTAGcVlk5Ka k1mWWqRvl8CV8WDpN5aCGWwVu7vvMzUw9rN2MXJySAiYSEy68Zu9i5GLQ0hgBaNE2/RfzBDO F0aJ9o2vWCCcz4wSW96/YYRp2fjnKxtEYjlQ1Y5tjHBVR47dARssJHCaUeLgngC4wefWNYK1 swloSuw7uQlso4jAc0aJ1t0fwRxmgZvMEteunmcDqRI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V u7vvMzUw9rN2MXJySAiYSGz885Wti5GLQ0hgKaNE+5IHbBAJGYmNX65CFQlL/LnWBVX0kVGi 4cEpVgjnNKNE74lnjBDOCkaJM+9/g7WwCWhK7Du5iR0kISLwlFFi+u9DLCAJZoGbzBJf3oiB 2MIC9hL7Hv0BaxARcJG49W0SC4StJ3F14QewOIuAisS8KSuB4hwcvAJWErMW8YKEhYDMadtP g53KKWAtMe/RejCbUUBW4tHKX+wQq8Qlbj2ZzwTxgoDEkj3nmSFsUYmXj/9BvaYjcfb6E0YI 20Bi69J9LBC2okTHsZtsEHP0JG5MnQJla0ssW/gabA6vgKDEyZlPWCYwSs9Csm4WkpZZSFpm IWlZwMiyilEktbQ4Nz232EivODG3uDQvXS85P3cTIzBNbTv2c8sOxpWvPuodYmTiYDzEKMHB rCTCG7LkSKoQb0piZVVqUX58UWlOavEhRlNgEE1klhJNzgcmyrySeEMzA1NDEzNLA1NLM2Ml cV7Pgo5EIYH0xJLU7NTUgtQimD4mDk6pBqZ5ho5S/3nX7Nx7V/NZhbc57+qVRxvS5P85r512 JmzDIan0bfFn9l6f9Dh4rvOr5TXP3qewsBx6yPfj3K58dXvNq6/uBf7f8jrIt27Kozenvwdv +2S+0ObVt7s/bU4K7zGbplkzg4F7y0fZK3/KJiguzb166Ns8A5PamyvT9Y55GkYH7pjoyTgz Y/GcOcW8S47oLdYO+3Oh6Z+Jyt6WOadSyiX6d3QqP96cO51dV1XvvGTkvAfRObvf7Xyieum1 SGzs7fRg/yJ5tj+Mybyp2R1WtzOvWQt1H9jHY/m85+H/H8nK+f4st9eyr28/LRe2Sp1nj56q 3ddt4rY2EWHvv9jkCJ82+r3jkNkJ36JlJ9cnKLEUZyQaajEXFScCADcGFbrcAwAA X-CMS-MailID: 20240209142906eucas1p2c31598bf448077f04eef66319ae2f3a1 X-Msg-Generator: CA X-RootMTR: 20240209142906eucas1p2c31598bf448077f04eef66319ae2f3a1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240209142906eucas1p2c31598bf448077f04eef66319ae2f3a1 References: <20240209142901.126894-1-da.gomez@samsung.com> When reclaiming some space by splitting a large folio through shmem_unused_huge_shrink(), a large folio is split regardless of its uptodate status. Mark all the blocks as uptodate in the reclaim path so split_folio() can release the folio private struct (shmem_folio_state). Signed-off-by: Daniel Gomez --- mm/shmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/shmem.c b/mm/shmem.c index b6f9a60b179b..9fa86cb82da9 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -836,6 +836,7 @@ static unsigned long shmem_unused_huge_shrink(struct sh= mem_sb_info *sbinfo, goto move_back; } =20 + shmem_set_range_uptodate(folio, 0, folio_size(folio)); ret =3D split_folio(folio); folio_unlock(folio); folio_put(folio); --=20 2.43.0