Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp720762lqs; Fri, 14 Jun 2024 03:59:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJYsuVJmNktl7yIDQ/2lb6HPOrqlJQNu2j0cSQdvndZB31vPKxxWELeaxdk5OpOQhFIsEOikjMrFvynzt3IckdYO7o+DlcGd+m5PQryw== X-Google-Smtp-Source: AGHT+IF/9ZopmvBGxQNLnjoYt+JP8yqqEtEfs8lq7+QgEfoUTuz7Jk9IX14hqIgXZxvCTJ7p3V9T X-Received: by 2002:a05:6871:8a6:b0:254:90a0:be09 with SMTP id 586e51a60fabf-25842ba3f9dmr2326013fac.42.1718362771284; Fri, 14 Jun 2024 03:59:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718362771; cv=pass; d=google.com; s=arc-20160816; b=iAuFYObI9OEj3/moWIASH3s7pi/n2imIN/PABgwfgslyfKOaObqC2zoFtqpdrEk2Ws OZHGty+F+DBlEUqxP+uIso8ul5oGQKHp5Kp6reUGJEOCrsifuMvOZxWUNLCnisSHZbnF LSUzK/8IMik5PXUrHcb4Ijmc51vn+jXCCxc41vyYjtsNoaJrrZMA6FoFeSB8/CYZ+wqb JmqucAKLsdk+jigx01MNPU89yx5mAOvVdEJZlsXPI3OEz6IIyMNkOITrbdwsai0BleM2 EkEar7+LCQsdxdQCa1SxZCdBX9SdMW3VoSR4YtUXADLwWIn+gufBVbJx1z8Ul5c5KmtQ 9nyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=5SNP4imkB97oiPLlbVvACXP9BTvzyjvW1dmm0W8uf4Y=; fh=P0iqb8nWt3LG5d71f7oTg2nvp+hp9ZVVIWQyZBNms5c=; b=pUTHcnCZOuFV0s1auo/4HSilQdKGA49WsCj2W2oUbAc1f09JOV9PGn30+72CIR/N3K 4b1lZ9dEPxe9+WrEEiWBgE30+QYGBBBsqSrrSRklcICdX/88BKKdyGG5qYEajqLOVMxD pga7U1oZE8rxLKOQHqBowYXKgEEB0WBJLHGq+5GYll4JA5ZjlBf4BNiQ3YTPU6nYY4Xc rXMW0K9L8B3Fu7mo08a0zE1AwucIGIMXFoHjfwGfLVJ49myW3UjgQEakiRKp9tjasq8B lqstULlYx2X85xMaRQJYdzwSWwDMTKf8/8s6WKk6zHAF6TTFatgB0orl4mEz94rre7ty XZ7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=qfcSAHMO; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com dmarc=pass fromdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-214817-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-705cf8be24bsi1730791b3a.360.2024.06.14.03.59.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 03:59:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214817-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=qfcSAHMO; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com dmarc=pass fromdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-214817-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 00E8128841E for ; Fri, 14 Jun 2024 10:50:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7732019580B; Fri, 14 Jun 2024 10:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="qfcSAHMO" Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) (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 6B89F1946BB; Fri, 14 Jun 2024 10:50:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718362239; cv=none; b=tVfhruHm4rpOHVJ5hccmmDU5aEFAWngNGW4j5uo4YRpVKnM+MC9hGLREBqUrIZiLhkmmk3fSsg0M9Hn04QqF8IAb7cq7D0v2/l+LzWC6qv5WMQ19JGsv4H1G08g5WKF68xHDLA4bdg1hanlgJQQnRvD2jonpGf0M6+bcBV0oGPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718362239; c=relaxed/simple; bh=E/lew3JDwMC8d+k4FDJJ8pPGPzx0HirBmRoLmBy/h90=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=qu9B5OMUGShSQwm1KXPuL3LZP8sMEwXRnDEbkomUF9awhqyr4DrIlLPUWnPKPnXlfjiqEaNu7sG3YCn+xcKQqrI6NDlNMWUHJIVwLAKDH5x+63WaEt/Rl7r5iAkXlhxurXpLvwR37vpsk9BsGf7TGfgRZRZvOiBzJv5uO36kDPY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=qfcSAHMO; arc=none smtp.client-ip=80.241.56.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4W0wzY5326z9t8m; Fri, 14 Jun 2024 12:50:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1718362233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5SNP4imkB97oiPLlbVvACXP9BTvzyjvW1dmm0W8uf4Y=; b=qfcSAHMOMt8sN0CNXFBRxYL1MUoeAxhbZBTgVRkQ8NvbxT69huezeFyyXndhsJVSv7dnB6 bi8+Ow/3/alukftvtTMCYAEWObioIZ1emyCvJLHQly0cxwRKduA9NX1KIIVfhlQ+/ov+5b zc9ND6XvTjWOMHWIh8FzV9L3zq5cygxzd2krYblDl7IQYudL8P2rQx3Eypet5aaeo+O/RQ 1qAhvcoLODhLcIM/R9zKQNEXKOL1TruFMrBqJiWFNCbyATJOpl3jwlrfQDYcdWjjY1wvcJ 3tLvXO4PIcus4up1HVVyImjiJqFnUkIocKF1Fau+TaWp/o0hRS6GlZ7KClNyNQ== From: "Pankaj Raghav (Samsung)" To: Brian Foster , Kent Overstreet Cc: linux-bcachefs@vger.kernel.org, willy@infradead.org, linux-kernel@vger.kernel.org, Pankaj Raghav Subject: [PATCH 0/2] improve buffered write performance with fgf order hint Date: Fri, 14 Jun 2024 10:50:29 +0000 Message-ID: <20240614105031.57032-1-kernel@pankajraghav.com> Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4W0wzY5326z9t8m From: Pankaj Raghav Filesystems that support large folios can set the fgf order before buffered write(see XFS iomap_write_begin()) that can provide as a hint to page cache to allocate large folios, if possible. The first patch is a minor cleanup. The second patch sets fgf order before starting the buffered write. I tested the performance on Samsung SSD 990 pro on a system with 64GB RAM as follows: $ bcachefs format -f /dev/nvme0n1; $ mount -t bcachefs /dev/nvme0n1 /mnt $ fio --name=bcachefs --filename=/mnt/test --size=100G \ --ioengine=io_uring --iodepth=16 --rw=write --bs=128k I measured the BW(MB/s) across three runs on 6.10-rc3: Before patches: 2730 After patches: 3430 (1.25x boost) With -o no_data_io mount option: Before patches: 2920 After patches: 4630 (1.5x boost) I was not able to test the patches with ktest due to some issue with debian(some broken package issue). Maybe Kent can run it in his CI while I try to fix ktest locally? Pankaj Raghav (2): bcachefs: use FGP_WRITEBEGIN instead of combining individual flags bcachefs: set fgf order hint before starting a buffered write fs/bcachefs/fs-io-buffered.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) base-commit: 03d44168cbd7fc57d5de56a3730427db758fc7f6 -- 2.44.1