From patchwork Fri Feb 9 14:29:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 13551420 Return-Path: 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 88554C48297 for ; Fri, 9 Feb 2024 14:29:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84FA16B0093; Fri, 9 Feb 2024 09:29:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 71DD86B009A; Fri, 9 Feb 2024 09:29:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5911B6B0098; Fri, 9 Feb 2024 09:29:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1B99E6B009A for ; Fri, 9 Feb 2024 09:29:13 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E71F3804E4 for ; Fri, 9 Feb 2024 14:29:12 +0000 (UTC) X-FDA: 81772497744.20.41FC0A7 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by imf26.hostedemail.com (Postfix) with ESMTP id EC0AD140016 for ; Fri, 9 Feb 2024 14:29:09 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=mJJtc+wH; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf26.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 as permitted sender) smtp.mailfrom=da.gomez@samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707488950; a=rsa-sha256; cv=none; b=xdKhstvuRsgMJiF39FjeoPymCj26QO+kWAyLU86grZJ2Jf4zIZfc0MxNLFOOjLGDkxhJyR H90aM56okzyzAaUcvA/kdmeWPsQAGGtj7Vq1+FU1zJ4PnbgU8+Zx00klXqZbDZV36PbzvQ ZsP46OnYgqz+xR/ZtjVGoZul0G3W/M0= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=mJJtc+wH; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf26.hostedemail.com: domain of da.gomez@samsung.com designates 210.118.77.12 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=1707488950; 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=in2JJaC6z0hyyXkhiWr41goVesPZul0LbQ6MoMc6gD8=; b=q1mcjfqVimkFDzok2vwaqzoCtFgsEGHQdXPHWFTplu7nVt59KKT7aA6aWqjMnzrAMzrBXu D4uIwJ5U2YD9SULs4Gp292k1V7FjM0ogoednrqnoYeXhLGL4IPpi0oUyIXxBmuE+F/vTU0 4LMl24bAbVye5UGcqrmksJg/b6TM948= Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240209142908euoutp024e84987c5b3932b8e48ab892bc2cc741~yOCbvaunr2144921449euoutp02a for ; Fri, 9 Feb 2024 14:29:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240209142908euoutp024e84987c5b3932b8e48ab892bc2cc741~yOCbvaunr2144921449euoutp02a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1707488948; bh=in2JJaC6z0hyyXkhiWr41goVesPZul0LbQ6MoMc6gD8=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=mJJtc+wHdVtbKLh9QIe7WtgIgcGvC/B7E1+ZDWt2UxA33cabY3UIi4T3tWqSUlyvs yEGnYQKz1wxb/PjnFfzkToMEELRWBnnxFDineTR5mPq9vNfWPgZ4lZfJh6/EYSyx/P ybgJyEjcl+8w1l9CZXdElNkQD12UfNGefzPFdUQI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240209142908eucas1p1973ff851315c007e944feacc1f5a865e~yOCbhG5KR0281802818eucas1p1u; Fri, 9 Feb 2024 14:29:08 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id E7.0E.09539.4B636C56; Fri, 9 Feb 2024 14:29:08 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240209142907eucas1p12155b2fb002df5e0cd617fa74de757b7~yOCbH0wck0925409254eucas1p1e; Fri, 9 Feb 2024 14:29:07 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240209142907eusmtrp227ac3a1f0f02114b44aba3f8379080b8~yOCbG3YFC2110121101eusmtrp2l; Fri, 9 Feb 2024 14:29:07 +0000 (GMT) X-AuditID: cbfec7f2-52bff70000002543-20-65c636b4eed0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8C.6F.09146.3B636C56; Fri, 9 Feb 2024 14:29:07 +0000 (GMT) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240209142907eusmtip12fe86939f9724620bf04f483aa2a19ca~yOCa96s592720027200eusmtip11; Fri, 9 Feb 2024 14:29:07 +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:07 +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:07 +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 9/9] shmem: enable per-block uptodate Thread-Topic: [RFC PATCH 9/9] shmem: enable per-block uptodate Thread-Index: AQHaW2RVXX84xcoe2UmZR8TV2QDYag== Date: Fri, 9 Feb 2024 14:29:04 +0000 Message-ID: <20240209142901.126894-10-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] MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAKsWRmVeSWpSXmKPExsWy7djP87pbzI6lGhxoE7SYs34Nm8Xrw58Y Lc72/WazOD1hEZPF0099LBazpzczWezZe5LF4vKuOWwW99b8Z7W4MeEpo8X5v8dZLX7/mMPm wOOxc9Zddo8Fm0o9Nq/Q8ti0qpPNY9OnSeweJ2b8ZvE4s+AIu8fnTXIem568ZQrgjOKySUnN ySxLLdK3S+DKOHP0NUvBRdaK/gs7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i4qTgQAc+RC9t4DAAA= X-CMS-MailID: 20240209142907eucas1p12155b2fb002df5e0cd617fa74de757b7 X-Msg-Generator: CA X-RootMTR: 20240209142907eucas1p12155b2fb002df5e0cd617fa74de757b7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240209142907eucas1p12155b2fb002df5e0cd617fa74de757b7 References: <20240209142901.126894-1-da.gomez@samsung.com> X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: EC0AD140016 X-Stat-Signature: 11kcghhpnj5r7sd65m1j3yqtjj4goi8s X-HE-Tag: 1707488949-410988 X-HE-Meta: U2FsdGVkX18cHnilNZL/GV0+hnRLjheCuPb3QMlEPWC8e5IbvNmucXF64FpZNmMdR7EdG9WNkf6aMSpsuchvbm25Ruiaq430edlpBMQNq17r2hUxpblT9G/9OXBWIbC41rtLz++/IZ/5LZDZo9CdhF4h8ZPn46Lz81g5rHB/l2opakkbURT1fUmg/O0E8r2/CWkl2AKqhuyp3tJT2Ln5v35wxrSO4RogbTkxF8Abfp6pt3NNUVNOfh5n7RrrLY7xi+wNFXBlgH6k/12KcWyowhR06mIrp18NMRgMBWh/GvxAwtXWpJuIRxk7JJ2fWBstakrxr0eUvZaG1hJbJDl1wAoi9N2ZJEIt2fg9sTVeAsR3TwulJYuHwTKxXgBDflnArmei4GH0EtP3XeIdZAF0rcBckHYM779D5E/2vzrNcRcBrOK12kanFtXkCfC8o1SueroChCjRioo3sK2dXZYXdnMIlLQkY7t0zrhgYwLXjV0ypuZfvFSEP/opO0hURvYQewPY5pHHBt9lH9kZIKSoi3thubvlerryb7X9n2zrN8n2IeLjZk+kGH8A8NP6Uuy+VwhzyE5dvCLdWnVz02XNpA51hg+7GmuoEh1eEC+oLleIE0T7uiycZSPZy4FdfNwipjMH9V5ICZf4qVzxrupM0aNy1csyseKnnK6P2/xnI5UtrD+sxQo4i08T1UWIpD2Z5ytANvgHgWRcFXxR1DviUKr2Zq4uPz0uF3DntYdrw7SDqmc09ljkivGuX32W8+RS2Li7OvwBanXYLkwrCWqxQ4XeNYiOUTauMYvlL8KyfVM3W+h7SqlO/RiyVv+vafVTE1mHzHdHPIAPOnyOTAgv5N8mz8GSiS/wKwb1YYonmxy3D2Y2jTGzBHdVYW0Y8k/7LIuRGz0FNyJxP9JAp1EStJj2diEz+bQ+W5UbMRzqE3xqvBqtULcg2myTLbfHDd+zWpUmklHAiUAlg6Bfy5j a81fUK9b H/n/qEU8V44DReRIu5bPBaVrnA9n81Wsi0toQUBFNX4mfdar6U38FWxtYam+B0MYJmqrU5wfDxvhGdtyFklXog8B5Rdz13xFZIBfCtTVuuhISzt8weWfJvqEBNNzO8lnJHNZ/Vr9brkQ4Kxl+lW6xVn7KJy5lmSOh4hYq 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: List-Subscribe: List-Unsubscribe: In the write_end() function, mark only the blocks that are being written as uptodate. Signed-off-by: Daniel Gomez --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 2157a87b2e4b..8ff2d190a9e4 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2964,7 +2964,7 @@ shmem_write_end(struct file *file, struct address_space *mapping, if (pos + copied > inode->i_size) i_size_write(inode, pos + copied); - shmem_set_range_uptodate(folio, 0, folio_size(folio)); + shmem_set_range_uptodate(folio, offset_in_folio(folio, pos), len); folio_mark_dirty(folio); folio_unlock(folio); folio_put(folio);