From patchwork Fri Feb 9 14:29:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 13551389 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 7575E69956 for ; Fri, 9 Feb 2024 14:29:06 +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=1707488948; cv=none; b=Sahsns+jhlfCkkncVmL4wuP8jWLH0h65Zc15qXS26ow9KZ/XrErT1nbnjJE1oW9qcRcF045HW0DLGToWQEs665enk+SsjlydQDvcgKXn9aJ3JDO1dMu0h0++DCqg+1v+M+vtL2UnhTw3x5poIzv3th86mJfHP3SE6OisLIq8Rk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488948; c=relaxed/simple; bh=Dswm6KHnt6fctGMQEhkJJsY2zjJGUEaprm9g9WiZFfQ=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version: References; b=UDKVWjhsCQTHUvbg8cEUDI9upu9w0w3+pIvDqg91F/MxIYifiaEfB37sE1WFlEQiutb+5rWcn31jqFRusQ9DrOzmQcDldl/PBX3au1VsHycAs6T/y8RH20JrGV8H/yFc+c+CYMQYTFyvzN8amC/BuJg24jlvbxnQIJI3yA3HtHM= 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=n2KL3eDA; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="n2KL3eDA" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240209142904euoutp02ce564f886d3d0c1bb9b090ca4e273e79~yOCX3KOq82377223772euoutp02Y for ; Fri, 9 Feb 2024 14:29:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240209142904euoutp02ce564f886d3d0c1bb9b090ca4e273e79~yOCX3KOq82377223772euoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1707488944; bh=Dswm6KHnt6fctGMQEhkJJsY2zjJGUEaprm9g9WiZFfQ=; h=From:To:CC:Subject:Date:References:From; b=n2KL3eDASHuDHAmLDNeV3h0bS6bxQ2xkSCMjp+bLEfxXqBf+eUhWG/ATcjg7wwv4D 5//xY4jRI5JMj9VS/cRLzvuKyP7zfmEHeQUcKVHomYniFi612c4nKMEI5meIt53taN D5ndrjjkSlIxTuCKKH3e866X0VFtGah9LIduUfRs= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240209142903eucas1p2ea029c7e25afcab2b3116ee58615490f~yOCXVzbKe2329623296eucas1p2U; Fri, 9 Feb 2024 14:29:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id E7.2E.09552.FA636C56; Fri, 9 Feb 2024 14:29:03 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240209142903eucas1p1f211ca6fc40a788e833de062e2772c41~yOCW6KAeo3259232592eucas1p1B; Fri, 9 Feb 2024 14:29:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240209142903eusmtrp17c0f58b9cd349b795e4af0519634af71~yOCW5hFSC0528405284eusmtrp1w; Fri, 9 Feb 2024 14:29:03 +0000 (GMT) X-AuditID: cbfec7f5-853ff70000002550-86-65c636af76a3 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 8E.A3.10702.FA636C56; Fri, 9 Feb 2024 14:29:03 +0000 (GMT) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240209142903eusmtip1f20a48f3b94b23fb7387f39f331b4b72~yOCWwn82c2720027200eusmtip1u; Fri, 9 Feb 2024 14:29:03 +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:02 +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:02 +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 0/9] shmem: fix llseek in hugepages Thread-Topic: [RFC PATCH 0/9] shmem: fix llseek in hugepages Thread-Index: AQHaW2RT7xV/K52STUGwCHRBbQ9MBQ== Date: Fri, 9 Feb 2024 14:29:01 +0000 Message-ID: <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-ID: Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOKsWRmVeSWpSXmKPExsWy7djP87rrzY6lGvTNNLSYs34Nm8Xrw58Y Lc72/WazOD1hEZPF0099LBazpzczWezZe5LF4vKuOWwW99b8Z7W4MeEpo8X5v8dZLX7/mMPm wOOxc9Zddo8Fm0o9Nq/Q8ti0qpPNY9OnSeweJ2b8ZvE4s+AIu8fnTXIem568ZQrgjOKySUnN ySxLLdK3S+DKmDTxBXtBh3jFvxnxDYx7xLoYOTkkBEwkls/9zNLFyMUhJLCCUeLq7oXMEM4X RomtF/9DZT4zSpyb858dpmVpx1JGiMRyRonOhs1McFWvLy2BypxmlLg//wQzwuS9f5hA+tkE NCX2ndzEDpIQEXjOKNG6+yOYwyxwm1liTvssoH4ODmEBc4nFU5JAGkQEbCQ2NTQzQdh6Elfb 1jOC2CwCKhKHDxwCK+cVsJKYMTkbJMwoICvxaOUvsFuZBcQlbj2ZzwRxt6DEotl7mCFsMYl/ ux6yQdg6EmevP2GEsA0kti7dxwJhK0p0HLvJBjKeGejm9bv0IUZaSsx+P4sNwlaUmNL9EGwV L9D4kzOfgMNLQuAfp8ST1Uuh4eUi8X3OF6i9whKvjm+BistInJ7cwzKBUXsWklNnIaybhWTd LCTrZiFZt4CRdRWjeGppcW56arFxXmq5XnFibnFpXrpecn7uJkZg2jv97/jXHYwrXn3UO8TI xMF4iFGCg1lJhDdkyZFUId6UxMqq1KL8+KLSnNTiQ4zSHCxK4ryqKfKpQgLpiSWp2ampBalF MFkmDk6pBibj9CW9N7WPdSWxXd6u2hCwYfeMC8/ULqSeqeH1tFNdkFE8TV2DL1R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VhLhDVly JFWINyWxsiq1KD++qDQntfgQoykwgCYyS4km5wNTY15JvKGZgamhiZmlgamlmbGSOK9nQUei kEB6YklqdmpqQWoRTB8TB6dUAxMb3zzDTbHmLzeznFxxT3ONdmmKt+2pW6rq27izFJ2PbpFa 65+Xv/7pCvu1bzz3x0jLrpkdK7Fkd+pVA/GpOzt79nKYfz6vX1PGvN9C7q+LcEFZZE3+Fcur V182fJt8pCbXZ6P2sQ8WFS9eNlS+0nvV6zd915U9b+8xCv257rbh0e+ngf8C2qzO8GwqZ639 4/lv4z/tCedPMP7+feaKti2bZsuFHaw2f2YsOL6si+3vnt8rPcTYnfje7djJa/jWwe/1DoUI s7nHNyXtmDPl+pHHv7dulWjmkytfFXbl3J87VW7KM46rfI/z5c+L9ZsecNTRq7/+W2zrxaVV 86tC5pxJyqw5pXGrvWDONBdm/dOflViKMxINtZiLihMBVjP0VtUDAAA= X-CMS-MailID: 20240209142903eucas1p1f211ca6fc40a788e833de062e2772c41 X-Msg-Generator: CA X-RootMTR: 20240209142903eucas1p1f211ca6fc40a788e833de062e2772c41 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240209142903eucas1p1f211ca6fc40a788e833de062e2772c41 References: Hi, The following series fixes the generic/285 and generic/436 fstests for huge pages (huge=always). These are tests for llseek (SEEK_HOLE and SEEK_DATA). The implementation to fix above tests is based on iomap per-block tracking for uptodate and dirty states but applied to shmem uptodate flag. The motivation is to avoid any regressions in tmpfs once it gets support for large folios. Testing with kdevops Testing has been performed using fstests with kdevops for the v6.8-rc2 tag. There are currently different profiles supported [1] and for each of these, a baseline of 20 loops has been performed with the following failures for hugepages profiles: generic/080, generic/126, generic/193, generic/245, generic/285, generic/436, generic/551, generic/619 and generic/732. If anyone interested, please find all of the failures in the expunges directory: https://github.com/linux-kdevops/kdevops/tree/master/workflows/fstests/expunges/6.8.0-rc2/tmpfs/unassigned [1] tmpfs profiles supported in kdevops: default, tmpfs_noswap_huge_never, tmpfs_noswap_huge_always, tmpfs_noswap_huge_within_size, tmpfs_noswap_huge_advise, tmpfs_huge_always, tmpfs_huge_within_size and tmpfs_huge_advise. More information: https://github.com/linux-kdevops/kdevops/tree/master/workflows/fstests/expunges/6.8.0-rc2/tmpfs/unassigned All the patches has been tested on top of v6.8-rc2 and rebased onto latest next tag available (next-20240209). Daniel Daniel Gomez (8): shmem: add per-block uptodate tracking for hugepages shmem: move folio zero operation to write_begin() shmem: exit shmem_get_folio_gfp() if block is uptodate shmem: clear_highpage() if block is not uptodate shmem: set folio uptodate when reclaim shmem: check if a block is uptodate before splice into pipe shmem: clear uptodate blocks after PUNCH_HOLE shmem: enable per-block uptodate Pankaj Raghav (1): splice: don't check for uptodate if partially uptodate is impl fs/splice.c | 17 ++- mm/shmem.c | 340 ++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 332 insertions(+), 25 deletions(-)