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: 198927 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp899883dyd; Fri, 9 Feb 2024 06:44:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBJr83my26V6kY9C5YcD8jJeJ985asygO1T9qaD0PHSu/Pr8KK7YiebV2+gKSAuft1wo0H X-Received: by 2002:a05:6a21:3489:b0:19e:a1b3:6e27 with SMTP id yo9-20020a056a21348900b0019ea1b36e27mr2318271pzb.18.1707489851887; Fri, 09 Feb 2024 06:44:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707489851; cv=pass; d=google.com; s=arc-20160816; b=W28RIjRnlXDW9JABZV2lSc/BhtbdUM1wkGda6gTZBKHfl8pWDknFHmrON0YHLMSLx7 Hf7glKwXQqQZNH9vv8BAts24q5hcF6KCnGGBRWsOyRPyWwg2/cW6hHd7ax52WeqwS0W1 OOw/W1gwFggYkl93qtZc47ay0pdMv2G332fG6HbIL/W1wMxdsrnyedjYLXekWNNWPj0O c6+pLs9GRtE4JdzyqGyTFFTgIFcV5Xq9QxEdlzah+YCCXX7LRE5mslzITbjZtsRTvT9d y3JZSHuQq8t33OA4HGhi3rCtkDpPi3Ck4fTLHFirN0/3rauhMkLvwO2sZzXImm10cz4B Tm4g== 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=yRtCD31ljSkhYR7IR3HvT1OUskOVzdxMy9xOeKHcrsU=; b=ki7LH0iwkxtmkVY2dW8O1wsMkdbEzgsRMzMQVzW8PTGWpnXsWYNrsH8zOLn28nNO+n o9VJ45QnVGDWWR4v+TVEWFOfyEMET4HD1afAiIBwDBFBM4MA1GY5VIXA+3QYW/nTqt+z VA7NHU32YyWCwUQ20eV5Fd9KIY4jYCkzO+NdAq+M1BeVs6ugl0jXpgtkyiCfaJWk8oQO wtLqlAkLDrfuO1aVxbhYmGnOWSUiB97tFGtwogcJ7PwHHUb1WXyjJ1kPue5I3KNnlycj lHg9kIWkaEU0E4WFiQdRHzprNxyxYTJ5bvTvbnBb5oD6wlf1yVmbX2sEE4KXxiTVqkKL xXvQ==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59456-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com X-Forwarded-Encrypted: i=2; AJvYcCW50Ig52fAFThGkHOKl071JXs79XZtzXGqP6BWi36iZHNfPCjWrKqvvyXSRXITPa+KUaA/iaVzR1fl7lD1vzDZVcjGg3w== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bn7-20020a056a02030700b005dbdc98c15csi1936875pgb.709.2024.02.09.06.44.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:44:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59456-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59456-ouuuleilei=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 C5276B27021 for ; Fri, 9 Feb 2024 14:32:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F95674E25; Fri, 9 Feb 2024 14:29:17 +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 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/RH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UnNySxLLdK3S9DLOHP0NUvBRdaK /gs7WBoY77J0MXJySAiYSBzZeh3I5uIQEljKKLHuwhImiISMxMYvV1khbGGJP9e62CCKPjJK /GmcxgrhnGaUOP9jDTOEs4JRYu2qmcwgLWwCmhL7Tm5iB0mICDxllJj++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> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790432878870283788 X-GMAIL-MSGID: 1790432878870283788 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);