Message ID | 20240515055719.32577-5-da.gomez@samsung.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EB6DC25B75 for <linux-mm@archiver.kernel.org>; Wed, 15 May 2024 05:57:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E8AA6B010D; Wed, 15 May 2024 01:57:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 972078D004F; Wed, 15 May 2024 01:57:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C3A76B0113; Wed, 15 May 2024 01:57:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5DF806B010F for <linux-mm@kvack.org>; Wed, 15 May 2024 01:57:34 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 119E2121454 for <linux-mm@kvack.org>; Wed, 15 May 2024 05:57:34 +0000 (UTC) X-FDA: 82119573228.08.810AD58 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by imf13.hostedemail.com (Postfix) with ESMTP id 295C92000B for <linux-mm@kvack.org>; Wed, 15 May 2024 05:57:30 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=iF9QYRA2; spf=pass (imf13.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715752651; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TvwQ3/t0rLMlRSFpe0qm/SVRP0obWxz9NLqJPflU2UQ=; b=evS5+5nl0zLuFQEm7Jh3ILEmcWnPiHVg+ZUS/ZPSAkH+aaFkxtD9PoI02i0y93VWTz2aEF MDqCxt8wEY5k/FdpbZ0QHouXY/vMxBtGbsByN9XxpxfCIMLH08Cqoh1bAX+w23H92gVeoN TucUMjVHWjMsL/Jakmroa0MVsI2VVdo= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=iF9QYRA2; spf=pass (imf13.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715752651; a=rsa-sha256; cv=none; b=ZSP65doYw9cH++9I08fTtY0hsXxKTa9D7npE5aPcbpoMUoJ/je2dwJXRg22c1KVJ4Kjltc DOeqK13v5cHXQTPqqGcueCX161CYXLXZd3X/1LZufqTZjge3cu2TU72wmr+yjiU6btbxcF sVPXSkKTpj9gajjt0xL/A5+d8lHGN5U= Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240515055729euoutp02690184600c0b2a7baeaa1e92f2735bcf~Pk-HQwITs1334813348euoutp02a for <linux-mm@kvack.org>; Wed, 15 May 2024 05:57:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240515055729euoutp02690184600c0b2a7baeaa1e92f2735bcf~Pk-HQwITs1334813348euoutp02a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1715752649; bh=TvwQ3/t0rLMlRSFpe0qm/SVRP0obWxz9NLqJPflU2UQ=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=iF9QYRA2fhupfZkTnrimDqeRi6wjYm0sMeOp0s5h8j692FXl0E3QjwQRodtCpRm64 +G8KcwQ2IAF7D+h2qGkK9eThiOsfeUH3RG8J/ThTzFnEU12i5NpznNNkBZPG70EGIv EaQFp+sLI3WpGCwP9whM6ce+M1zVolcg4HrOvNR4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240515055729eucas1p25a1ae40ac6143a6c66beda0dcd46d6ac~Pk-GwWyTN0594605946eucas1p2R; Wed, 15 May 2024 05:57:29 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 99.BC.09624.8CE44466; Wed, 15 May 2024 06:57:28 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240515055728eucas1p181e0ed81b2663eb0eee6d6134c1c1956~Pk-Fxtmp_2567425674eucas1p1T; Wed, 15 May 2024 05:57:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240515055728eusmtrp126de191b60d8f61e2ba129b4a88ba285~Pk-FxIF7h0390703907eusmtrp11; Wed, 15 May 2024 05:57:28 +0000 (GMT) X-AuditID: cbfec7f2-c11ff70000002598-51-66444ec865cb Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 18.F1.09010.8CE44466; Wed, 15 May 2024 06:57:28 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240515055728eusmtip1e41b862dcb859f62ee1fd12a0cd79248~Pk-Fir1hx0512305123eusmtip1t; Wed, 15 May 2024 05:57:28 +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; Wed, 15 May 2024 06:57:27 +0100 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Wed, 15 May 2024 06:57:27 +0100 From: Daniel Gomez <da.gomez@samsung.com> To: "hughd@google.com" <hughd@google.com>, "akpm@linux-foundation.org" <akpm@linux-foundation.org>, "willy@infradead.org" <willy@infradead.org>, "jack@suse.cz" <jack@suse.cz>, "mcgrof@kernel.org" <mcgrof@kernel.org> CC: "linux-mm@kvack.org" <linux-mm@kvack.org>, "linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>, "djwong@kernel.org" <djwong@kernel.org>, "Pankaj Raghav" <p.raghav@samsung.com>, "dagmcr@gmail.com" <dagmcr@gmail.com>, "yosryahmed@google.com" <yosryahmed@google.com>, "baolin.wang@linux.alibaba.com" <baolin.wang@linux.alibaba.com>, "ritesh.list@gmail.com" <ritesh.list@gmail.com>, "lsf-pc@lists.linux-foundation.org" <lsf-pc@lists.linux-foundation.org>, "david@redhat.com" <david@redhat.com>, "chandan.babu@oracle.com" <chandan.babu@oracle.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "brauner@kernel.org" <brauner@kernel.org>, Daniel Gomez <da.gomez@samsung.com> Subject: [PATCH 04/12] shmem: exit shmem_get_folio_gfp() if block is uptodate Thread-Topic: [PATCH 04/12] shmem: exit shmem_get_folio_gfp() if block is uptodate Thread-Index: AQHapozD1A5s10K0O0aGF++xWBxX9g== Date: Wed, 15 May 2024 05:57:27 +0000 Message-ID: <20240515055719.32577-5-da.gomez@samsung.com> In-Reply-To: <20240515055719.32577-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 x-originating-ip: [106.210.248.161] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAKsWRmVeSWpSXmKPExsWy7djPc7on/FzSDB58t7SYs34Nm8X/vccY LV4f/sRocemonMXZvt9sFl/X/2K2uPyEz+Lppz4Wi9nTm5ksLu+aw2Zxb81/Votdf3awW+x7 vZfZ4saEp4wWB091sFv8/gGU3b4r0kHQY+esu+weCzaVemxeoeWxaVUnm8emT5PYPU7M+M3i sfOhpcfkG8sZPT4+vcXi8X7fVTaPMwuOsHt83iQXwBPFZZOSmpNZllqkb5fAlbHi+hXmgm1c FXuuLGRvYNzL0cXIySEhYCLx+2YjWxcjF4eQwApGiffT7rJDOF8YJX7vnMcM4XxmlJh3uYsJ puVQ43tWiMRyRonW3j4muKo3D3ZAOWeAMv8fsIK0CAmsZJT480wUxGYT0JTYd3IT2BIRgduM Ek9PnQFzmAVOskr82byTpYuRg0NYwF/i3XoREFNEIETibo8xSK+IgJ7EjM8N7CBhFgFVibc7 E0DCvAKWEtNXvGIHsTkFrCTuzv/KBmIzCshKPFr5CyzOLCAucevJfKgPBCUWzd7DDGGLSfzb 9ZANwtaROHv9CSOEbSCxdek+FghbWWL9uzYmiDl6EjemTmGDsLUlli18zQxxg6DEyZlPWEA+ kRDYyyXRtmADVLOLxIln36AWCEu8Or6FHcKWkTg9uYdlAqP2LCT3zUKyYxaSHbOQ7FjAyLKK UTy1tDg3PbXYMC+1XK84Mbe4NC9dLzk/dxMjMFGe/nf80w7Gua8+6h1iZOJgPMQowcGsJMIr kuacJsSbklhZlVqUH19UmpNafIhRmoNFSZxXNUU+VUggPbEkNTs1tSC1CCbLxMEp1cCkxWLA VvskyftBMm+Tq3FYW2MmW2izwjs/hda5CaU7xd/yLYo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FibnFpXrpecn7uJkZgutt27OeWHYwrX33UO8TIxMF4iFGCg1lJhFckzTlNiDclsbIq tSg/vqg0J7X4EKMpMIgmMkuJJucDE25eSbyhmYGpoYmZpYGppZmxkjivZ0FHopBAemJJanZq akFqEUwfEwenVAPTikBz2+mSLnf+JpU2bIt7NfuxpcPCF8zP63gTuuSk17e6fN17Pn12kavR DzXxTzLdAnIOdnw/fsVLCZ55uXLj5j3MzLNFLSQ8rtqI/zWceEWsw3Byb7Gb3yTngqeTJp+d UDizXmX+h9Y4m7gXRw4LGJcuaxPP9wmqOTw3iuGTXv/NiuMLsnbbSq1bl9Mp/2nCz3JZ231e f8pvit7XeVqX9/PSF6HtEZGqQk812G9EnWI9JuXuLGnU7CIoK6/2I2jW1+0PFX/KnSy+5ml+ fppV8HmTzIKln301JypvsPV8JqHF427yx8z3uUJ2X8zsRY61gfOU+9viwrNv3e5Qs7grkPz7 dUlu7i62OY++31ZiKc5INNRiLipOBADETHQjAAQAAA== X-CMS-MailID: 20240515055728eucas1p181e0ed81b2663eb0eee6d6134c1c1956 X-Msg-Generator: CA X-RootMTR: 20240515055728eucas1p181e0ed81b2663eb0eee6d6134c1c1956 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240515055728eucas1p181e0ed81b2663eb0eee6d6134c1c1956 References: <20240515055719.32577-1-da.gomez@samsung.com> <CGME20240515055728eucas1p181e0ed81b2663eb0eee6d6134c1c1956@eucas1p1.samsung.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 295C92000B X-Stat-Signature: ws8xuyxxsb45bk94grrkc8171tc46ifp X-Rspam-User: X-HE-Tag: 1715752650-710889 X-HE-Meta: U2FsdGVkX1+hrXAY+RKD3Sh4gXlOf1EDGdJRcalyxWH9FEd/x2cbA1mmp7bi3dHpdzrc1ySk/BzMZ7uMThVL9MIL/AdZtyKpNy7/3TwJp1XPhHqLgC64fNqxlESJ7xLa2ZwycFyGu3TLCu9gIScBmj4We3Hwoa90oSK9NSt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QABwhh48H72ytctNet+gK7OFB9wQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
shmem/tmpfs: add large folios support
|
expand
|
diff --git a/mm/shmem.c b/mm/shmem.c index 86ad539b6a0f..69f3b98fdf7c 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -256,6 +256,16 @@ static inline bool shmem_is_any_uptodate(struct folio *folio) return folio_test_uptodate(folio); } +static inline bool shmem_is_block_uptodate(struct folio *folio, + unsigned int block) +{ + struct shmem_folio_state *sfs = folio->private; + + if (folio_test_large(folio) && sfs) + return sfs_is_block_uptodate(sfs, block); + return folio_test_uptodate(folio); +} + static void shmem_set_range_uptodate(struct folio *folio, size_t off, size_t len) { @@ -2146,7 +2156,7 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index, } if (sgp == SGP_WRITE) folio_mark_accessed(folio); - if (folio_test_uptodate(folio)) + if (shmem_is_block_uptodate(folio, index - folio_index(folio))) goto out; /* fallocated folio */ if (sgp != SGP_READ)
When we get a folio from the page cache with filemap_get_entry() and is uptodate we exit from shmem_get_folio_gfp(). Replicate the same behaviour if the block is uptodate in the index we are operating on. Signed-off-by: Daniel Gomez <da.gomez@samsung.com> --- mm/shmem.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)