Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp969852rdb; Fri, 9 Feb 2024 06:43:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHznV+TMXDC6fmOP61cVWjpEkp2aX5U5QKpiVFT3PLIZldjt4CF3NeT9iZOev34MlOmm6rd X-Received: by 2002:a17:90a:de98:b0:296:ee68:9dfd with SMTP id n24-20020a17090ade9800b00296ee689dfdmr1588338pjv.5.1707489797867; Fri, 09 Feb 2024 06:43:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707489797; cv=pass; d=google.com; s=arc-20160816; b=ykMBEMPvs0TdqSy86xGkyi4ZyOvbl5TOGfAKYlACTHKBnA13C9bnJ2WUwQhAngQZZt ++yZ6DdZMEjFJBsv5IleDmWaEIRD6+JKJYcEXaIDw13lIyjrIjHW3Hzblq95/SE80Y4J BXdz9TRdp4BfPKyrrmfzpMHGmbCg5xlC8Zo04WgFEsbX4vmqZQjdcA3Jshz/j12nYQh+ u6KmANMhGGStmS+70d91utNNcs+rAflIlIZI1URv+QmvlzsNyqep7j3BjAgsVPukBPQl PmA7zEZj08yv3lTHzDqW7IoGvFShXjOeXlnNpHhm3k0KCf6ZJ4b/XvKCWfvFymnYMrzP 9u6g== 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=in2JJaC6z0hyyXkhiWr41goVesPZul0LbQ6MoMc6gD8=; fh=qcQiIG64MoHNlXSlOnw2hoDR7rWsg+zxBTdFoqC2YyQ=; b=G32ChGk56QPB04FF6t4FEi5Zav9DeDpxLwwEPsXHhNLYxqKiK6xCTUTdolGtOCSjCZ 023td8ALK93vIFX7BhN9QAwN6Vp++L5rx01S5rqYEdkaApjlVH+AuVKCs62w1vT+L/gj hNggF5OPTqWmneh7AKP8/Y+oIfzcT5XkLLm+LVBFKjHWRFVrp40MVJbAg6SHCr+7IYc3 V1zTxl0At3vlhFHMtxZkLrMTwFmVQxyER/jrVH47XINr1M543iGRH3uqUsDIjVXUGgZW g4G5Kzwv//y9UEtpWBSOjIxzw+J+GKueXnoDIMAOvN0YvyiN6zHJ+HnKDfAZGtyib5OE jnaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=mJJtc+wH; 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-59456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59456-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; AJvYcCXL8NY5sZKKEu4SV6rcPxLz9kixBKVlSAUTO+EHCvyCVORjlI9tddht6lDzKCnvGCZn4r4nwW4HdNI8nHg0zah8Vf3Mo3fJ7RACkItqiQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d21-20020a17090ab31500b0029692ce6f57si1694439pjr.89.2024.02.09.06.43.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:43:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=mJJtc+wH; 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-59456-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59456-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3594BB2554E for ; Fri, 9 Feb 2024 14:31:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D574A6EB49; 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="mJJtc+wH" Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 AFD8D69DE3 for ; Fri, 9 Feb 2024 14:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488952; cv=none; b=fSQuSAkCWECkhZCKZSl3MqpAfR6JBfnf+6Hsjk3a/zByB8uDbUzRIQ1AOo1GFfrDJR2E6ejfMoqGGsceaoofH10enzRCxq8R9eLMQoJLIYu8VhLZdXVX9gAAOxZ28TaYaoZpsOQxFyf04jV7Th5sA9KBNKmUabliBvrPg3PWVLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488952; c=relaxed/simple; bh=r6Ol6y0mnebhEygqGrvK/spAs7z687jAlcbMwM0SB6w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:Content-Type: MIME-Version:References; b=NV2hbYPl3CUHNNGUYSfg+9vB0W94LK65fgJ6hJtbhhs7RexZzqrglt6WH0AYoGBWgnz08tOY1SRh6xOUf9nKHmYNJazEO0I88y4jqYs5GURyWGFg4ZR6mnPpE7Lq1u+HFZeWa74sBIgF1EJMxcpiQ9rZQLJL35sxuddKLEmM9aI= 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=mJJtc+wH; arc=none smtp.client-ip=210.118.77.12 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 mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240209142908euoutp028d15824f02ab651422421e91b0dfd276~yOCbzqiLG2377223772euoutp02n for ; Fri, 9 Feb 2024 14:29:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240209142908euoutp028d15824f02ab651422421e91b0dfd276~yOCbzqiLG2377223772euoutp02n 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 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+NgFrrAKsWRmVeSWpSXmKPExsWy7djP87pbzI6lGhxoE7SYs34Nm8Xrw58Y Lc72/WazOD1hEZPF0099LBazpzczWezZe5LF4vKuOWwW99b8Z7W4MeEpo8X5v8dZLX7/mMPm wOOxc9Zddo8Fm0o9Nq/Q8ti0qpPNY9OnSeweJ2b8ZvE4s+AIu8fnTXIem568ZQrgjOKySUnN ySxLLdK3S+DKOHP0NUvBRdaK/gs7WBoY77J0MXJySAiYSKycN5+5i5GLQ0hgBaPEhIMvGSGc L4wSU54/Z4VwPjNKNE64zQjTcmTrdRaIxHJGiVXf37HDVfU2t7NBOKcZJd7+7mGCm7x580Jm kH42AU2JfSc3gbWICDxnlGjd/RHMYRa4zSwxp30W2BZhAUuJkzMusYLYIgJ2Eu1LzzND2HoS J/s62UFsFgEViTU7ToDV8wpYS2yf0gJWwwlkz3u0ng3EZhSQlXi08hdYPbOAuMStJ/O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TOEs4JRYu2qmcwgLWwCmhL7Tm5iB0mICDxllJj++xDYEmaB28wSc9pn MYJUCQtYSpyccQlsiYiAnUT70vPMELaexMm+TnYQm0VARWLNjhNg9bwC1hLbp7SA1QgJWElM 236aDcTmBIrPe7QezGYUkJV4tPIXWC+zgLjErSfzoR4SkFiyB2K+hICoxMvH/6Ce05E4e/0J I4RtILF16T5oyChKdBy7yQYxR0/ixtQpULa2xLKFr5kh7hGUODnzCcsERulZSNbNQtIyC0nL LCQtCxhZVjGKpJYW56bnFhvqFSfmFpfmpesl5+duYgSmqm3Hfm7ewTjv1Ue9Q4xMHIyHGCU4 mJVEeEOWHEkV4k1JrKxKLcqPLyrNSS0+xGgKDKOJzFKiyfnAZJlXEm9oZmBqaGJmaWBqaWas JM7rWdCRKCSQnliSmp2aWpBaBNPHxMEp1cA0N4J99YyKawouF9Xrm7I00zad+Ov9u/C0kpTU Rb3mbuWrzvv9XLYaT30uoJZadHyV6qwL5TOPz6zR2CEsP7Xuz638jdZP3R5kb40LeVWxqC1X aaLgrSBdk9OvGxosqtcp2RRKL/rbbW3++/qLj5feuJ9JXvyw7bneLod87ksiBn1vr5gXCa+6 /0D4r7rl1bSrflJ/b+o2yE/4UB1awRXWIR8q9En6pOqFZ4vY1004euK0xw+uqFv3N0X+r5D7 wJpTd943Y/VvF64Pdz4Hytj/KLzpcbNseTSz+06pfQVTWOTSFb+t9OmO2J+zbbPJaXHDFu3Y oHx9D57/Kxd/SZDccOR4tN8a2c23F1rwf41VYinOSDTUYi4qTgQAc+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> 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_spa= ce *mapping, if (pos + copied > inode->i_size) i_size_write(inode, pos + copied); =20 - 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); --=20 2.43.0