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: 20161 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp891656dyd; Fri, 9 Feb 2024 06:31:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW6mLNB9ZptA96Z2JlWELwlFmvCP5KQvUI3j2c+skPcgL+86AaWDcaBS5KndroW65HuAordc4hkT0NW53YZ63OHBJdsNA== X-Google-Smtp-Source: AGHT+IFoq58nG64nB1L++VLa+nY+XnreZjkJKk1f1uUmw02N1YOZMgln9i+5srqesGsneng56z0y X-Received: by 2002:a05:6358:41a1:b0:178:fce4:5f71 with SMTP id w33-20020a05635841a100b00178fce45f71mr1679219rwc.8.1707489078270; Fri, 09 Feb 2024 06:31:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707489078; cv=pass; d=google.com; s=arc-20160816; b=cUTy7YCKUq4s5p9osJyCD7WdSlmXIN/CgGKfzy7/sBWnP2HhOcpXb6Jh6nuU/ez7jm j6LgrWDSsDArL8hA42H12QtCRktb/Gr/VQdXB6qkTbWdhJzM0Hdg4XOEh9JmPXyM+jt6 wkUWI8C4TL4SKl+daxNwSO4+Hz2uee8JhIe/9CXjeHMt9bWIWX0RNhe5bHlwa0HP4F8n w/25LQwoqdauDG1I8QUi1yncZ9bKddLzTefbphE+uI4OUknQYfFRLV0Rvqq5ZhA54YhR SJ2uPe7dds+3GOPZSIVKEpNngRzWXOIgbTOLtQHgacG/wbd8NKUVfFpNDszRoPz7j0rg Jicw== 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-id :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-filter; bh=Dswm6KHnt6fctGMQEhkJJsY2zjJGUEaprm9g9WiZFfQ=; fh=TmaTINw+TNPeNzs08sZdTjvcxa5KcYvNTkiIlPg10qE=; b=F57PhfPXRfGHk83x1FaAuHtZj5OWmtfgZpXdIv5xY+7xsLsULIV7wJZ9tpkHxnDw2R mZx/WbmXIGKWrkHmCWM3LpJel8vEAMyroxxa8EwpyjgKdxfbkeEZIWwKIO1Nu20G7HD9 mZsQ53VFQ2et0P7XtrYkCeFZeamdtPNmMN/id2etmdRd4UZBSJVvwYpGwuSWCTe78MHb lSpRy606Rpb+7Lsyp/eXuFogJKR0f1L8GUBNE81tqFyeZbBSAGWex1uxgui8Pu+TvxaC 4nW9y/G50IL1kkzngMyWZoMR34zKFRjFJ7u+3CPgc8eE5U9oJf0Gwndo9xqeHQ2M5+7y c6Wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=n2KL3eDA; 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-59451-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59451-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com X-Forwarded-Encrypted: i=2; AJvYcCW2V3YsMa0ehktBq9kspyQ44G1oHIec2y9/eE0P7gb0LgL3nw1+3f76o0LmPy6PDdPxw4+V+15UnRyvGdg6Ttxt/s4PIQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ge15-20020a05621427cf00b0068ccc5108b3si1990423qvb.380.2024.02.09.06.31.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:31:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59451-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=n2KL3eDA; 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-59451-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59451-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 454C11C233D3 for ; Fri, 9 Feb 2024 14:31:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 360816D1CB; 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="n2KL3eDA" Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (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 56B5E69955 for ; Fri, 9 Feb 2024 14:29:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488949; cv=none; b=YkXWCVjAXO7NJ4DlvRiMAiRCMU7tzy5ESCRyyP65JfPgw6ZvBziFbGezcSUqviBLX3vO2OxHzkEq8fxbpzh/c2DVgD/GJ7A6QP+pE6Ek/J2wYj8uktc/7NeSv9hRCVE/31ILomjFJDJI7LnVF3j9O8kEMZlFclfESPI/k34XV3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488949; c=relaxed/simple; bh=Dswm6KHnt6fctGMQEhkJJsY2zjJGUEaprm9g9WiZFfQ=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version: References; b=AUeYaqnSSD0NDpo2VPXftzOAyWjNfN7aMbQZO3ctu/fev5jfxIyIPNiQ8Bjp0waK/cPwFdeaA9EUN3XaKutQQEgLGp3ecDWPy/31ElWSHnVJpGo6eZJTCHI5c2kqQcde6t5+EmxfxYQBouQCUbmKuihS7OjvqvRabfiT2jo+TJM= 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.11 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 eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240209142904euoutp0152b1b769b6689e5dbf844e55d94db11b~yOCX3Z8DE2559825598euoutp01N for ; Fri, 9 Feb 2024 14:29:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240209142904euoutp0152b1b769b6689e5dbf844e55d94db11b~yOCX3Z8DE2559825598euoutp01N 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-kernel@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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240209142903eucas1p1f211ca6fc40a788e833de062e2772c41 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240209142903eucas1p1f211ca6fc40a788e833de062e2772c41 References: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790432067552079323 X-GMAIL-MSGID: 1790432067552079323 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(-) --- 2.43.0