Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp131181lqc; Thu, 29 Feb 2024 12:23:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWNvJ1z9bUPAyF9n18bfYMkAHnh48Mu9mRzEpBkMtJtQh4pqe6MNAM29bUHiK6OuQmlmuQHEtbL2lOsjb+1OijKNf7P/LjQlEqCkdOTIw== X-Google-Smtp-Source: AGHT+IHdby2Qp1sTkS3S3NVRjYV5eW3HH48wOxXW3na5P5O0j89Pjq8kWWopoMTZJKxuXmCwkLYI X-Received: by 2002:a05:6a20:2d08:b0:1a1:e41:979b with SMTP id g8-20020a056a202d0800b001a10e41979bmr4792511pzl.41.1709238192875; Thu, 29 Feb 2024 12:23:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709238192; cv=pass; d=google.com; s=arc-20160816; b=YMgzw+XfRUmNhQLdx6dKqFq/xU3bcJKV2vWDhlp5xEY5nFvQvPDIkOGREVMzHUT57a xp4tmyfSpwXSS8K8kmqumc6eB0TlM0W82FYUUYWrIgMHrEjawW/HPgidWwMQg1Zt6Gsd 0KHjhuemR28ECMIv5V7RKKilEcE2Iew4vU/N3MydaCByKgRpD+PKDSQCaQeMXbplXYFF iet/TRquosPzqls17NOKrHXEoFBAJh94I0cyj2ANJHEPxTC4yjvXQvUnfsFD7NO6JU2p E3glJnqIVq0kXkI1ShF5iRSSu1po8JV6oui6JTTa1+RCUsk0QT8ojBHecn6ZwINr+Sp7 Z3sw== 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 :message-id:date:references:in-reply-to:subject:cc:to:from; bh=FpvOYALhGErVTHbGuH3ZI7qMxA1qeu3I2TdidZrsEbU=; fh=S/47B6llb+CSbGugqrwzEXKqtGBlASbnxTa34yTrrNE=; b=LGNnafqPFlp+sFK3sLWxoEZRCfKvihuO8y8SOvdim0cXzSKx4zckcjM3Yu80PBPPLm 6hOUEEJOFZk7qgEYUql6oewQXmsmZtsarYNksg2fpIAyEFf3DQ8Tfv51Kg8pwZenYISL W8aRlvSCJIVdmKiPtaQLNrnMlI0riQirAJhlHN7d1t0Ln0o3vnFq3m0hZ96DOc82AoB5 WUyV5enX/7gko75rBH7IlVZOxjWgfyRRLB02VlC7g9l5Y6CxRu5hR2/j240H2uHxW+eN 2vUKfCRbA8YDVuHaobpfrQayFYJbVP886qw74tiY53QJfBBLnSpZzkH7FQckARDQbhre 0QPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=thesusis.net); spf=pass (google.com: domain of linux-ext4+bounces-1441-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1441-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f13-20020a63554d000000b005e438e99d4esi1998512pgm.144.2024.02.29.12.23.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 12:23:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1441-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; arc=pass (i=1 spf=pass spfdomain=thesusis.net); spf=pass (google.com: domain of linux-ext4+bounces-1441-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1441-linux.lists.archive=gmail.com@vger.kernel.org" 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 D1DB6B243C6 for ; Thu, 29 Feb 2024 20:20:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A987D142901; Thu, 29 Feb 2024 20:19:58 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from vps.thesusis.net (vps.thesusis.net [34.202.238.73]) (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 C07501428FF for ; Thu, 29 Feb 2024 20:19:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=34.202.238.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709237998; cv=none; b=ksfNdpo8f3bGK3zYJrzg25AHGlR731v8SkSeQyqw7OS7NegZ6fkrUTw0DFVZz/Yr8wncoicHrZM1dqDalnudGPiMFOfPTmLRbfDhCHr4c6axz0h5dtlIxEnuqWHkn7mzGh3ViJcoYjaBw2TNhIsg4jlb/EVVZBsxtzp+KH2naTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709237998; c=relaxed/simple; bh=Ux9QLQigRWms1+9i0AkO8FM8qxG7ISIsp6Gke5erutk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=b8Ds40VV23G6vi9JLtitCcV+NIijX+WvFv0FdhxBW8DV2zgzN9QlAe6ihEz26KuIrx5bISpnERn2n2KdeZqHhVlcsOukVOX4GKf2ucC2VvdPnTBJQV2pwTdExT1e70seriMB70mHw9jLcvWzuTi6iJOOnVVcJ1Mk3Pwm8X/bcjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=thesusis.net; spf=pass smtp.mailfrom=thesusis.net; arc=none smtp.client-ip=34.202.238.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=thesusis.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thesusis.net Received: by vps.thesusis.net (Postfix, from userid 1000) id A00482792E; Thu, 29 Feb 2024 15:19:50 -0500 (EST) From: Phillip Susi To: Theodore Ts'o Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH] [RFC] Fix jbd2 to stop waking up sleeping disks on sync In-Reply-To: <20240229145858.GE272762@mit.edu> References: <20240227212546.110340-1-phill@thesusis.net> <20240229080759.GB57093@macsyma.local> <87edcv1h94.fsf@vps.thesusis.net> <20240229145858.GE272762@mit.edu> Date: Thu, 29 Feb 2024 15:19:50 -0500 Message-ID: <877cin58gp.fsf@vps.thesusis.net> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Theodore Ts'o" writes: > Because no metadata changed, jbd2 will not even *start* a (jbd2) > transaction as a result of that write (overwrite) to an already > allocated data block.. Since it didn't start a jbd2 transaction for > this file system operation, there's no reason to force a jbd2 > transaction to close. > > (Note: this could because there *is* no currently existing open > transaction, or there might be a currently open transaction, but it's > not relevent to the activity associated with the file descriptor being > fsync'ed.) > > This is a critical performance optimization, because for many database > workloads, which are overwriting existing blocks and using > fdatasync(2), there is no reason to force a jbd2 transaction commit > for every single fdatasync(2) issued by the database. However, we > still need to send a cache flush operation so that the data block is > safely persistend onto stable storage. So maybe what ext4's sync_fs needs to know is whether ANY writes have been done since the last transaction committed? Is there a way to know that? As long as NOTHING has been written since the last commit, then there is no need to issue a flush.