Message ID | 20240209142901.126894-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 4E90AC48297 for <linux-mm@archiver.kernel.org>; Fri, 9 Feb 2024 14:29:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 011B56B0092; Fri, 9 Feb 2024 09:29:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E415E6B0095; Fri, 9 Feb 2024 09:29:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B2276B0098; Fri, 9 Feb 2024 09:29:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id EE47D6B008A for <linux-mm@kvack.org>; Fri, 9 Feb 2024 09:29:11 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C641BC0905 for <linux-mm@kvack.org>; Fri, 9 Feb 2024 14:29:11 +0000 (UTC) X-FDA: 81772497702.28.E52BB84 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by imf18.hostedemail.com (Postfix) with ESMTP id B7F221C001A for <linux-mm@kvack.org>; Fri, 9 Feb 2024 14:29:08 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=YapIIPGe; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf18.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=da.gomez@samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707488949; 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=yzLVEVoC51q0kiEHcn5lFzpeprpnxNh9RSZm3CgLznw=; b=bpsuTPJpyf2R1nd2HgvjFUYkSRM+Zprypufx7zracHb+VLfXbLER1TdwuRzCGjJ+gDcHj/ IH55736dnWf22dA6xkSikNq4SltpCEBcoSBW5hwl9lOta7dt/EHBn30mBrwOn7fKkMA8XC kcEPycCJZfxiMvfr2om8VkJW7c0JGec= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=YapIIPGe; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf18.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.11 as permitted sender) smtp.mailfrom=da.gomez@samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707488949; a=rsa-sha256; cv=none; b=ZIghC/UqGV2RDpBghzjBsNQYKr9BtPdcbRY5vKQMt2rdWW5HWhd0FgEqEXIyKsZqLyf+oy XU5+1sHLItlZiWm/6mYDy0n9JxsmjHZxzX0Pl90E06vxBCdtwMRNBcbFUyI56rXPvANQf3 ycBPusea5I/Dw4jU4W6GmA+KnD72JCw= Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240209142906euoutp01de0ae574b177e2aae12d742a49769856~yOCZukme72783027830euoutp01d for <linux-mm@kvack.org>; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240209142906euoutp01de0ae574b177e2aae12d742a49769856~yOCZukme72783027830euoutp01d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1707488946; bh=yzLVEVoC51q0kiEHcn5lFzpeprpnxNh9RSZm3CgLznw=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=YapIIPGeo6UtoKnrOw0E2jh3ReyHWKrHHmEiQyUInlp4KSlYxp/L/OiXftCBNIToZ NdbeJmuIhweJNqmEp5GcJEurA5vwyFzz+vWs/MgtuF8bRGPGRlAWqS0ntDKKKMMxGj 2UqNrOu58jjXE2KQXhaCvloLIoReTt24Jj5nLy78= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240209142906eucas1p2d99cf5db5353012f5c7e394c72654656~yOCZbd3hY2346823468eucas1p2b; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 6B.2E.09552.1B636C56; Fri, 9 Feb 2024 14:29:06 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240209142905eucas1p150b096fab4b8a684b416d3beb0df901b~yOCY9kYJh0934709347eucas1p1k; Fri, 9 Feb 2024 14:29:05 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240209142905eusmtrp1db904eebec0428be2c7c1271c40b4f46~yOCY86pwm0528405284eusmtrp10; Fri, 9 Feb 2024 14:29:05 +0000 (GMT) X-AuditID: cbfec7f5-853ff70000002550-97-65c636b12cf7 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 10.B3.10702.1B636C56; Fri, 9 Feb 2024 14:29:05 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240209142905eusmtip1bbccce327c924057684231d1edcf32cc~yOCYv0MCC3127531275eusmtip1c; Fri, 9 Feb 2024 14:29:05 +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:04 +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:04 +0000 From: Daniel Gomez <da.gomez@samsung.com> To: "viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>, "brauner@kernel.org" <brauner@kernel.org>, "jack@suse.cz" <jack@suse.cz>, "hughd@google.com" <hughd@google.com>, "akpm@linux-foundation.org" <akpm@linux-foundation.org> CC: "dagmcr@gmail.com" <dagmcr@gmail.com>, "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "willy@infradead.org" <willy@infradead.org>, "hch@infradead.org" <hch@infradead.org>, "mcgrof@kernel.org" <mcgrof@kernel.org>, Pankaj Raghav <p.raghav@samsung.com>, "gost.dev@samsung.com" <gost.dev@samsung.com>, Daniel Gomez <da.gomez@samsung.com> Subject: [RFC PATCH 4/9] shmem: exit shmem_get_folio_gfp() if block is uptodate Thread-Topic: [RFC PATCH 4/9] shmem: exit shmem_get_folio_gfp() if block is uptodate Thread-Index: AQHaW2RUvpPeBHpDT0yQa2xBM9HYnQ== Date: Fri, 9 Feb 2024 14:29:03 +0000 Message-ID: <20240209142901.126894-5-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 x-originating-ip: [106.110.32.67] Content-Type: text/plain; charset="iso-8859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F0qlvp3rtd6y5fKhp8d6csuUtIg7z1nKYbbxxauVyq1UGpzgvhZ07 frcw/9phERGNNuF1O7Yys606IDyjfHFzZr3rP7HrLOd3iS+av+OwR/GssGu6Oo5ymSf7T9nf C3vJxeqskzsnd997x9svn2VYlMwsuXxHJ5bPfcKZKe9/FF9x1E4tsF5pr/Sbe0JE6vzPt85v tZdgMavf8c7sfXL4+bYpAndVd3zjP7ct3PaKo8i1wlqRb1N954Xwbryoe/nNHsfTBmGGc2f/ f8m/Ze2Snca6gs5zr9dWJHmf+5wssHa59yTmzplKLMUZiYZazEXFiQDLC80l2gMAAA== X-CMS-MailID: 20240209142905eucas1p150b096fab4b8a684b416d3beb0df901b X-Msg-Generator: CA X-RootMTR: 20240209142905eucas1p150b096fab4b8a684b416d3beb0df901b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240209142905eucas1p150b096fab4b8a684b416d3beb0df901b References: <20240209142901.126894-1-da.gomez@samsung.com> <CGME20240209142905eucas1p150b096fab4b8a684b416d3beb0df901b@eucas1p1.samsung.com> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B7F221C001A X-Stat-Signature: rcrsdjgj4fmaggkgk8oa1z8dh5mwjpwm X-HE-Tag: 1707488948-144285 X-HE-Meta: U2FsdGVkX1+hOhZ7wtYU00Yr8wLwoiP3zc47LgiBNeyy4ewPfOkL329/XDvBq5IJQnA8NQ45br4AzQGQSXLDhhu7WUWHtCoTh60FivP4VR8ZpNxn9VmXSfPKCb1cb0uy6g4KJQpAGfvzKCC+egisggOI8qFGXPvbdiXf+vezmSI4X5F/w10FpsJCfw6SCqFP4Cb5kzPyfM0OVVdjjM5+gCNGKnTNcRf3qtwJ1li4JmTAFWmpKwwrb7M7OlncQkx20YJT69aSb93mqP1Dp09v/8HS6qlfXk4Yw89KqpqVyakQI7PQrm8hSEL3LHhgv6jWCHfxQUwxahA/kCRXpoaYf6B4gWZZPttrD/QLQ9Pn/eWea88kM3vSYI/dAvxWigx1dM2dA+eosmJutbieLa7lSR5DyLUkUA4FFLp29JUGUcY6PXBrfPXjYAw9dkDwiBte6YiMZWTN5psugpL3aIi+RKyqsJWws0COYBj8LHKmYJo/4hG93VsbQC9W5n5uM6hkfTN9QkFmLqgRw0xRcGkl9gHa0L8PXbBb4TyI+PGf/MjKAutCFJ9nMLgWFk1MPgHbnjERxh7EZSMg7QWuV3MjrnbiXnulIfBjmXtc0qvHkGPwmjL5Cu4gMNdtjMBCF1PTvLAcxzcswUTmX+r/PvT+IcZjakIqcSRRTNyb1ChRcCdnAtDY/gqybxOJ9ose/OQkT3QQUVTDcc0DUh9qTxGUTDvCwicdeuaGmNdnM0fD4bINA4zvwGM8y2xF8wpoopIsXFLvt9nbduaXkFzySAtgvSXweNbxbF2GEBrMaVLZhalAvIlmfDvay3NMy2JbQKwnRzUfk3kLVoAJFA2YdEMkD9RbjebQuNObD3bHmpTTvmXS7YIxGGcBH49Y2rNTTrS1ZqvOS5vsU9e8Sw4dV/3WlX2A0QOU21apGR8itRy5uSgZZlXd0StV36swgSpwKV0Lcv7GbCNxejnxRqSib7w f6MhzFuN ISeKjsvpIvVoQ1fCrAIE0K6Kdw3hp9mv9aPyXu2+G8iZ90WnoVYLMn6VQDn1mKZUuSrDorm4Y6LMXkVVR1aYrDKT1U/ZA/NrNRDgTKHrhChqJz5BDJQWU/KwlKmWKLezcgNeYaVvgjbwHYpRFCJEj9hUOOAr6ud/MORg2KveU7UQMifo8rELRkXxIx3qqHBx+WnB8Ap9ZbQT1J8vNNjf1d7rw3Q== 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 |
[RFC,1/9] splice: don't check for uptodate if partially uptodate is impl
|
expand
|
diff --git a/mm/shmem.c b/mm/shmem.c index 3bddf7a89c18..614cda767298 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) { @@ -2143,7 +2153,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(-)