Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1042816rdb; Mon, 19 Feb 2024 02:16:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUBfhoUWRQkFZRD/q+xFqKzo9VetrsuUMFU+Dd0xkcONosEe9mtEbReMrM3kpBt2ShRzjTnqQ5MvlOHYedYmo1JNYGSoLX1bHvrEF2hnQ== X-Google-Smtp-Source: AGHT+IFx3esiLOHsVOCvEPrl4JXlPkVnPBPDZLBKfiultUN0iokhKVpNxPAX66XAkj0xYhwIPTKC X-Received: by 2002:a17:906:2319:b0:a3e:ce5a:bba5 with SMTP id l25-20020a170906231900b00a3ece5abba5mr402191eja.60.1708337809090; Mon, 19 Feb 2024 02:16:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708337809; cv=pass; d=google.com; s=arc-20160816; b=tuFDnEv7WXzchyEt0d/O0rEPSdXURZbH/saPRe/OMkbyVSMCtvqsWmYvdm29bBSc3y GrxGf0FTG0XOmzOFWgIIv8ZrpinBP/otjfuHL2RdyLDs3Rjy3iAVNKTWxCZtImE6Dhkp 3OYYdJ2vq2YVaJWyFnh2iZmEu+2rFxyb14vOfgn3HeqkG/Rm/NjS/J/V3JmUN8barwb0 RySd1SBQjPvJtxN+9nbnogvVBhXZyFkF14dRlbpw+2oyrMJVImEGgwWncQM4KnP0M/5n WFuVV5qUnMivYjDRms28jmZFQyYBGpGAIfwnUCg3RyFzH1lyXJ7tZJX1xY6lkm/KDvzo Oz/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=nGxwSEo7jdD6QsMjGOSy8a5TjT863H0VEZLOli0MF44=; fh=XJqQ4BUQVgmnlLPmqy+IctFMQygx1eCWb4jaSVsfftY=; b=D3+RGDXqDXsqNNslREVM/11fw4bYWF/pmyEDTDRJolxw+GHFNIaeMrreScw9B99+wf 5OrisfIV+x39/Gt0BuSzOJHRx7cMotsSuw5IXgUDHxcAz+R6k3duNhTsMtiS7fStCPHh 26HeJmKKF2jDejZgjr1i8Fe55QWSan4Xq2DPIMX+IP5CkiQHa75AuNOJnl9L9PoaJldB LHdXatAXZ4eZOrBbgl0YiueL7H0GY00lAszQJNNjbT3BIPEKok9WW9SnIiqruqnC0Y9k WUMyCT995LWtp4S7pV7SWyCqgO3CC4xx/GKCdV2bKO2kHXe7cuztkPwkWSeAzkPNn/L6 5www==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=lEAKcObJ; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-71109-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ho35-20020a1709070ea300b00a3e7507bfe1si1130529ejc.156.2024.02.19.02.16.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 02:16:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71109-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=lEAKcObJ; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-71109-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 77F861F21032 for ; Mon, 19 Feb 2024 10:16:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51D3825618; Mon, 19 Feb 2024 10:16:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="lEAKcObJ" Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8AD925616 for ; Mon, 19 Feb 2024 10:16:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337772; cv=none; b=rPwE7dSxlPxuzCqEYWs5CAAUlUnPKnFDuvOfG+rF4EMWMnyBayAoSEMVQeCuqo+F9jfnsu65ryDPulugABUJFqeZQfh3cvb+r7AXIR7Wwo6FmP0IDyxmUxClpMKTLtZsj3LAtxEzd3EcXo/S2Ow98ogiPTRUcy2vVW5lrldIDQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337772; c=relaxed/simple; bh=LfGonh/vxzEvh4ssbdF8peYR0PFMnQMns4BKb2UYKGY=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=E4658Xzeymm4YEg9J5o7LzwXUkX6n6kGOdvq9aPl4HnGOoIulnEmUTKgAAk3St1CNU6zRsgwUdyaan8e1HV+UiWz/mqGWlqp4+T3tspnM7lgA3oT0Ww7hbJn7wzwkJQjI/JyAHibKMxEycJJNe8Bwa+wWIvh/VXyx23cXAqTwp0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=lEAKcObJ; arc=none smtp.client-ip=209.85.128.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-6084c93f80eso2116887b3.3 for ; Mon, 19 Feb 2024 02:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708337770; x=1708942570; darn=vger.kernel.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=nGxwSEo7jdD6QsMjGOSy8a5TjT863H0VEZLOli0MF44=; b=lEAKcObJaq5f79BNkmV7VmD9rpFJ5JMWtHsQAAiJgo86tPKsCHchOZw79mB20sMKHF dMJVjUN2T3LSJSpNjSf6ejgR3vRovNuhNftSzKx0lvCCJwmko99Gq2ACZvrUqPWa9Rzl kj5kCUAJ8Hf+DRo33zHV5imrHHoheBohjbyugZCvZdPI9xR4Cu9SDabcPwNo3E8LSVP5 7nk1DjbdhKPnKq2m4cxc6ohzaZ08vzjXYavHSp6y/hNdJnabPxxSWTghdIQFOz9w4ao5 kNpcM40ZbJVzpZbLi9OkCMtLqs5P0LXt8lNemjt0KZ4sqmng5bf3ecff5yIT5319j0YU izXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708337770; x=1708942570; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nGxwSEo7jdD6QsMjGOSy8a5TjT863H0VEZLOli0MF44=; b=ND+ftirETCj13E4URqg2z9LFJsNWNKtMADKnjsukrUhzldMYumzvgWp8elfAWisBJ1 bBBoI4PzEXwk0lYHHBCiXQUFPk+3vKrAA5VDf9hu9whuKOd+AWUwgTblsLq9Z6PDiSQ9 K0TAf5P8mfElno9nu+eMr091Qs1h2uByT1eLNUT3vDiMoHhxMBZV/7Ylw6DlzjyTE7Wv vrclmBtsQTY96AiK9QjUUaHX2QVuS0bQuV9bT7UZ2v/7P/hCGlnsD9m32iogVpjPVk0H u73c0KYcIeSv4L769cFt1nN0w0D8W8detn4YbAUYcb/VoDRA9bSyZK3Dje4glPleVTh5 GcOg== X-Forwarded-Encrypted: i=1; AJvYcCWKn6+5jT9Qxmhsz/VOBJWaT1ladLoGLJjx99qvWR1FIt3IQHmJvrmMHJbJTBhJ+7B9ZSP2nr5fnSXI4S2IxN+Xzw89B7wPd1p1hcwT X-Gm-Message-State: AOJu0YxPbo768UZadMTUoQ9XvDwviv2/YH2tPGllGf7p7fhyKtenlZub yex3P00UBCo7ZBDFLPx9Tc8Lcqz3PYD9N1smXgO9otQIuhVuzKpeveG0SFLV1w== X-Received: by 2002:a81:431f:0:b0:608:e2f:e3d2 with SMTP id q31-20020a81431f000000b006080e2fe3d2mr4916030ywa.22.1708337769682; Mon, 19 Feb 2024 02:16:09 -0800 (PST) Received: from darker.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id dt15-20020a05690c250f00b00607f86fa184sm1476113ywb.99.2024.02.19.02.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 02:16:08 -0800 (PST) Date: Mon, 19 Feb 2024 02:15:47 -0800 (PST) From: Hugh Dickins To: Daniel Gomez cc: "viro@zeniv.linux.org.uk" , "brauner@kernel.org" , "jack@suse.cz" , "hughd@google.com" , "akpm@linux-foundation.org" , "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" Subject: Re: [RFC PATCH 0/9] shmem: fix llseek in hugepages In-Reply-To: <25i3n46nanffixvzdby6jwxgboi64qnleixz33dposwuwmzj7p@6yvgyakozars> Message-ID: References: <20240209142901.126894-1-da.gomez@samsung.com> <25i3n46nanffixvzdby6jwxgboi64qnleixz33dposwuwmzj7p@6yvgyakozars> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Wed, 14 Feb 2024, Daniel Gomez wrote: > On Fri, Feb 09, 2024 at 02:29:01PM +0000, Daniel Gomez wrote: > > 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. > > Hi Hugh, Andrew, > > Could you kindly provide feedback on these patches/fixes? I'd appreciate your > input on whether we're headed in the right direction, or maybe not. I am sorry, Daniel, but I see this series as misdirected effort. We do not want to add overhead to tmpfs and the kernel, just to pass two tests which were (very reasonably) written for fixed block size, before the huge page possibility ever came in. If one opts for transparent huge pages in the filesystem, then of course the dividing line between hole and data becomes more elastic than before. It would be a serious bug if lseek ever reported an area of non-0 data as in a hole; but I don't think that is what generic/285 or generic/436 find. Beyond that, "man 2 lseek" is very forgiving of filesystem implementation. I'll send you my stack of xfstests patches (which, as usual, I cannot afford the time now to re-review and post): there are several tweaks to seek_sanity_test in there for tmpfs huge pages, along with other fixes for tmpfs (and some fixes to suit an old 32-bit build environment). With those tweaks, generic/285 and generic/436 and others (but not all) have been passing on huge tmpfs for several years. If you see something you'd like to add your name to in that stack, or can improve upon, please go ahead and post to the fstests list (Cc me). Thanks, Hugh > > Thanks, > Daniel > > > > > 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