From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 3C003282F1A for ; Tue, 16 Jun 2026 03:16:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781579769; cv=none; b=jRwKiwMs+2iF7MfBw5gc6I2TjxrgWfYbQAmWEC7cQjfVQxvF5M2NM1+bjkrlIpOQMYcaS+SvWbvsGAYtp3nR3vm32rbE4SX4ABl9TEbKuFNh6D3Ikdd9EeFnemS4MO5EYCtJaJX6FLI5UVgbNZfqmFyZxg7KDSNzMbddoRNTI7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781579769; c=relaxed/simple; bh=Nu7POl7uKRRcdMVBb2PmYuMENfVTSOAGHZOD7RHsiGM=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=f5CQDQRMKqqBSK6Cvlf5mclIrPmIxPXVHGnX77S/SzPZ1QK9IS5eHeyRNfB6g18hdGY5RPFpa/+JkEWTtf7gBkbHZobRGtTEfHYipzrI9tmbiXwBvJvTcjI4K4ylcuURsJcMgpJMoUar8H5QsvoeAwdXctG6nFDHcElj8N4CEWE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OKLThBm/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OKLThBm/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 045111F000E9; Tue, 16 Jun 2026 03:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781579767; bh=7qcGy97RJthIKYNTKcmD6a7zj/H4lLk55pYE5C8ndeU=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=OKLThBm/0yGIg3ovDVMnd3wSvUHacHkZj0QZz4hAu43R3lLtYPAAM0eLjXvgXIYGt 82cDUvTLaKj/d8eMAX800aFJ3jcITs8VP5Y9sltdiL4kHMjbGvJP/teweReW1NG3eE BF4puJN2tSkvip2/PSBUYuYITE+p8vGOoBl1nXvTxttrAVkc1XcxecwiAqarOgu/WN dhjD+5W1Gpgx7t3OyB7FJbYoV5ARbGusOY3b48kX97WzwSBGVuvEMa7srnRt0dLi7z MGK8sGGA8P2oJUmjjtmVk9U1LGeyETQyVtfpIhPGMvLCAd2784Oyp/0/kH0EwHAKDW cxE+vFYlSqa4w== Message-ID: Date: Tue, 16 Jun 2026 11:16:03 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com Subject: Re: [PATCH v2] f2fs: skip direct I/O iostat context when disabled To: Wenjie Qi , jaegeuk@kernel.org References: <20260616030655.111933-1-qiwenjie@xiaomi.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260616030655.111933-1-qiwenjie@xiaomi.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/16/26 11:06, Wenjie Qi wrote: > F2FS iostat is optional and is disabled by default. Direct I/O still > allocates and binds a bio_iostat_ctx, updates the submit timestamp, and > replaces bi_end_io for every DIO bio even when sbi->iostat_enable is > false. > > The byte accounting calls do not need an extra guard because > f2fs_update_iostat() already checks sbi->iostat_enable. Only skip the > DIO bio context setup when iostat is disabled. If iostat is enabled > through sysfs before submission, the existing context allocation and > latency accounting path is still used. > > QEMU benchmark on a 1GiB F2FS virtio-blk image, with iostat_enable=0, > 4KiB O_DIRECT I/O over a 64MiB file, 50000 iterations per run: > > baseline patched > direct_read median 65264.50 ns 55470.95 ns > direct_read recheck 65553.75 ns 55470.95 ns > direct_write median 68054.62 ns 56309.44 ns > direct_write recheck 66873.51 ns 56309.44 ns > > Signed-off-by: Wenjie Qi Reviewed-by: Chao Yu Thanks,