Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp962828rdb; Fri, 9 Feb 2024 06:31:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUnUAL1BSSjeDIsC5o3KXLRalBDO1DNtkXom7uvN9MlDTlRxTVHJAhmKXhx/KYTh6FODDtnEv9yLi6p67lR1e1ory/HdRyzk/N/160Iww== X-Google-Smtp-Source: AGHT+IGv+ZmEX6Q/9ZqzssaNq9u+b2ZPUJGFEv1UZti/L2xrlsk70gn1DN4ltUAzA+HQvmhZIYf+ X-Received: by 2002:a05:6402:3226:b0:561:51b0:2f48 with SMTP id g38-20020a056402322600b0056151b02f48mr681263eda.13.1707489103312; Fri, 09 Feb 2024 06:31:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707489103; cv=pass; d=google.com; s=arc-20160816; b=wnwnRqDuOyMnUYGb53xebvzcK0Qx2P+93bs52jRHvM23DwTb3arJPMZyLbrGBP9TfL 1MFODxFjJg6il2cCv9oP5Iob3I07z2avR31CmZo5v6iIXlkX5mVriWPF3DMj70I3pDg3 SIlDSGsyRW3CcycstBEWXBU6KGMopuVZQWeOU315nExCXVV9mhu4DtToaoWfxAImLrIi aBkMEWycrLfclST2rWwU6Q1xy70U1o3OQGqrdZlcYNZIAdJTFgSOcLOiRhjqmgvAtwkG 9i59SHsaicHnSLf1iw+I+DfDz1r/1sFxzwmff6lhoHWw+LMEyx/kttMmA3aTo0eBD3LV RGzw== 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=FCbzId5tUUljaKo+tPW5dyPNAxWuqwZJmK4aFsnXX4M=; fh=A2Xvfogoi4N5wQEgWJRBKEGo0QOekYA1IJy9TYbwAcM=; b=naj7E0Vx6efMJOkp2mZefIhsJCk5o9025vuwlb37160AwpBgyxdF3/xyz5KWk9kM5P LX8/meTlr1Y2SavIrBE1sK3Mh2P4E1pm7+JqwAhC4FucO5se4ioaCjgMhnHIqG53aiNN ZPuWGTa7K+FhUMMh9Cvwx8HPhfidCR60Y9O6GZ+LlVzrDQ89nfrL0m0ITy17vqoqst69 Td5n6oVTkM90gN4csEeDLmnKJQStBNcXzm/SNsinN8s5cLRDx91WQIpy3JZdrNqtw+TL TOlSU8/DIp1dqUGQjfLwmURgXr96URSHAYU/9ytAVCDWV9U5DCXxk8SoY0OOexPX0oSL 8tFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=h1JyNx4K; 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-59455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59455-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; AJvYcCXdlZY9D8o0uJOmGy77D1g9IzLtIEria88KtSCbp5Wd+XMG4+n1EQaTHxIaTXC+7hoIm+cd5gBNBLlvmGTN/SsvZjGHtgO67xEzlrYUTA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h21-20020a50ed95000000b005611ef13903si942486edr.596.2024.02.09.06.31.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:31:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59455-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=@samsung.com header.s=mail20170921 header.b=h1JyNx4K; 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-59455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59455-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A5B8F1F2221E for ; Fri, 9 Feb 2024 14:31:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1D466EB47; Fri, 9 Feb 2024 14:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="h1JyNx4K" 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 4DA3A69D26 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=1707488952; cv=none; b=EsO0T6AzCCAus2f8WnO9Us/4za87ItGPi15+hi8dqicNVYwy6sU/5wx34DhYV6uMEEohPnEORFYIJQ5+nKhChtkwQpRecn3HLhNoSDN3CH90721r7p9XF451OESHEWdWI9GXq2BWaf0RSCeKeoD6Khh/DPF3l2UpHAqZ3cOcbWE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488952; c=relaxed/simple; bh=CPKJ6tUdoDF6Ha2IQ+4O/WOu+/5VM901pX9Tu0quqfk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:Content-Type: MIME-Version:References; b=ZGHspLpMxrSlFReQa+ygpkn+AGufDeUf1TPHnWXCPJkgEZmQ1FAxuA7JnUAFprVR3sh9HC9Y/D3BPQ+3hmgOuZwVgN5snhoyQjJqdsHzR8iDPZ73DoaWJoNNq/8feH8a7JMmznroTGij8heb8YRjlsEU9OOWlVHVrzDvp5WXx3M= 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=h1JyNx4K; 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 eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240209142906euoutp017389e53649f75be9c6da7e5fe213ad9e~yOCZ_oe3d2559825598euoutp01S for ; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240209142906euoutp017389e53649f75be9c6da7e5fe213ad9e~yOCZ_oe3d2559825598euoutp01S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1707488946; bh=FCbzId5tUUljaKo+tPW5dyPNAxWuqwZJmK4aFsnXX4M=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=h1JyNx4KMrteOAQd2xuXTYL0v8bGy8abrDejKZj6MfmF7XkTeUYjJO/0mlcML6jxY LVoThPtZVowwXE1i4ym/GrWCFWwXiJyUXv4z+NRkk11J5mp12q17wL1A1sDkfrNlA3 SQ5JHpmxkcLYKefpwei3RORrbhDJGjstMZeYyjgw= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240209142906eucas1p2e47a246a10373a76799a079725583da1~yOCZtNsY_2329623296eucas1p2e; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id FC.F5.09814.2B636C56; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240209142905eucas1p14498619591475e416a8163dbc96c90e4~yOCZTs0l-0937309373eucas1p16; Fri, 9 Feb 2024 14:29:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240209142905eusmtrp2a5418fa28a2ffb3a4fc54948ca8a399d~yOCZTFUmN2110121101eusmtrp2b; Fri, 9 Feb 2024 14:29:05 +0000 (GMT) X-AuditID: cbfec7f4-711ff70000002656-40-65c636b2e6b8 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 59.6F.09146.1B636C56; Fri, 9 Feb 2024 14:29:05 +0000 (GMT) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240209142905eusmtip2236828047c1df8be3fea7df7e76daca2~yOCZK_AE42332823328eusmtip2R; Fri, 9 Feb 2024 14:29:05 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) 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 5/9] shmem: clear_highpage() if block is not uptodate Thread-Topic: [RFC PATCH 5/9] shmem: clear_highpage() if block is not uptodate Thread-Index: AQHaW2RUm+AjPQwetUKmMMbff0NR9g== Date: Fri, 9 Feb 2024 14:29:03 +0000 Message-ID: <20240209142901.126894-6-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+NgFjrPKsWRmVeSWpSXmKPExsWy7djP87qbzI6lGnz7JWYxZ/0aNovXhz8x Wpzt+81mcXrCIiaLp5/6WCxmT29mstiz9ySLxeVdc9gs7q35z2pxY8JTRovzf4+zWvz+MYfN gcdj56y77B4LNpV6bF6h5bFpVSebx6ZPk9g9Tsz4zeJxZsERdo/Pm+Q8Nj15yxTAGcVlk5Ka k1mWWqRvl8CVsfnoYcaCrWwVn2evZ2tgXMDaxcjJISFgInGt5S9TFyMXh5DACkaJH59XM0M4 XxglXnyZwwLhfGaUuL1yLTNMy7fPr6FaljNKXPr8iQ0kAVY14TovROI0o8TNg9dZ4QafW9fI CFLFJqApse/k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naGmhZ2RiqWdobB5rZWSqpG9nk5Kak1mWWqRvl6CXsfnoYcaCrWwV n2evZ2tgXMDaxcjJISFgIvHt82umLkYuDiGBpYwSP67sYYFIyEhs/HIVqkhY4s+1LjaIoo+M Ej3z10I5pxklnjy+zw7hrGCUOPP+N1gLm4CmxL6Tm8ASIgJPGSWm/z7EAuIwC9xmlpjTPosR pEpYwFNiUdcbsA4RAT+J/3u3s0DYehI7lv0Dq2ERUJGYN2UlWJxXwEpi1cvfTCC2EJA9bftp NhCbU8BaYt6j9WA2o4CsxKOVv9hBbGYBcYlbT+YzQTwhILFkz3lmCFtU4uXjf1DP6Uicvf6E EcI2kNi6dB80ABQlOo7dZIOYoydxY+oUKFtbYtnC18wQ9whKnJz5hGUCo/QsJOtmIWmZhaRl FpKWBYwsqxhFUkuLc9Nziw31ihNzi0vz0vWS83M3MQJT1bZjPzfvYJz36qPeIUYmDsZDjBIc zEoivCFLjqQK8aYkVlalFuXHF5XmpBYfYjQFhtFEZinR5HxgsswriTc0MzA1NDGzNDC1NDNW Euf1LOhIFBJITyxJzU5NLUgtgulj4uCUamDqlV++q2Ov5rY+4XmZ6z8EnFx4pn3Gs+PLT91Z wZ7cMFFqgQ63sErWhyMsi/bPWiHE5su7aZ93p6fto1IbgaoPh6rOSC4TuT7Bjr3v7hKToyqv fvzmnXvU5oZg9/alcesN96txxYeEq+//4W8X81v15vdLX39EdQoXXjZavcs64DGTYa7njvI/ frq9vB8OR98yWiBWKpc5m/froW83QzusZu3/JDUreqv51QSF7+Xi84Pljm2493lqyJKbbPPa lhf66uzaySRnd1Rrl8SFnRofzpZ/qHAJrYroF3igEDzJpNvzQJvnRPcJroVOj9b2cFf8320z J2ORsxp/mdMZbg8LP76fGUKJnwPLH11v+SWrxFKckWioxVxUnAgAorJ4Z94DAAA= X-CMS-MailID: 20240209142905eucas1p14498619591475e416a8163dbc96c90e4 X-Msg-Generator: CA X-RootMTR: 20240209142905eucas1p14498619591475e416a8163dbc96c90e4 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240209142905eucas1p14498619591475e416a8163dbc96c90e4 References: <20240209142901.126894-1-da.gomez@samsung.com> clear_highpage() is called for all the subpages (blocks) in a large folio when the folio is not uptodate. Do clear the subpages only when they are not uptodate. Signed-off-by: Daniel Gomez --- mm/shmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 614cda767298..b6f9a60b179b 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2253,7 +2253,8 @@ static int shmem_get_folio_gfp(struct inode *inode, p= goff_t index, long i, n =3D folio_nr_pages(folio); =20 for (i =3D 0; i < n; i++) - clear_highpage(folio_page(folio, i)); + if (!shmem_is_block_uptodate(folio, i)) + clear_highpage(folio_page(folio, i)); flush_dcache_folio(folio); shmem_set_range_uptodate(folio, 0, folio_size(folio)); } --=20 2.43.0