From patchwork Mon Feb 19 11:59:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 13562585 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 42E3C24A05 for ; Mon, 19 Feb 2024 11:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708343975; cv=none; b=BOp25XTRR2DZdDZeFgCvxwx0nHwjRTZbO8wBOjgLHaT44lEfr8GqQodwLVUoA5XRqpExqv7uKZWLMiHhzmdaLtJG7fX9LivbX6+7zd5SeaO3LfvN0FL06pEBphzHpyPEMwZKGMrL9VW4ttpWJc2A5uM/F8TElUgRgA8WaQHhAt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708343975; c=relaxed/simple; bh=ogBiHcYulcmoGslVkxksX9YU3ZQznM3V4K5Pd7l0vRU=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=U0t4f/za0Z+MYdkS/gBCOeiXUWmryxfFYEUgfnDa2OsI1VolX153laivhjzMWs9Ze3J9m3Xkm0c/eg1bHLRxn8639Dm+tDvIuZiKnViZFoprECPlRcvJ/vDuEuHBrlZ6XwWsPVVqyZ/8seymRpqdKvwpC531xOGiN9JOJHODPjk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cqJeEe0l; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cqJeEe0l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33A31C433C7 for ; Mon, 19 Feb 2024 11:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708343974; bh=ogBiHcYulcmoGslVkxksX9YU3ZQznM3V4K5Pd7l0vRU=; h=From:To:Subject:Date:From; b=cqJeEe0lFPTWdyXravQJkcQnpLU5nuD9xOdLYlvoQ1GDomiiwpe7aYY9+VvLyj6WF 3uM+//U7mDQozBGFOwAymk7KO78w0++7WH0CnDr/1N5tSXhwfOWYs3K4wipHJVRf+e o9BjFeUsy3hDO/BfFUYqEWAqttD57NDpXiyaXNEkyFDw48vJof1QBzCyJu2YfYPGHn Ilw3k1Zp2MaRLs4T2LnEvdaTcoWjMM1vO0dgPchmKo2hoNLg9+lej9W0WxHgWHw9tJ HzsrCBF5P8zS55DPcN2pL/T1mrNm4KDQrUPyRuuqotlimLc0Ff+VEyH58WTURtOw5y IKKjdKcSAPtUQ== From: fdmanana@kernel.org To: linux-btrfs@vger.kernel.org Subject: [PATCH 0/2] btrfs: some optimizations for send Date: Mon, 19 Feb 2024 11:59:29 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Filipe Manana The following are two optimizations for send, one to avoid sending unnecessary holes (writes full of zeros), which can waste a lot of space at the receiver and increase stream size for cases where sparse files are used, such as images of thin provisioned filesystems for example as recently reported by a user. The second is just a small optimization to avoid repeating a btree search. More details in the respective change logs. Filipe Manana (2): btrfs: send: don't issue unnecessary zero writes for trailing hole btrfs: send: avoid duplicated search for last extent when sending hole fs/btrfs/send.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) Reviewed-by: Sweet Tea Dorminy Reviewed-by: David Sterba Reviewed-by: Josef Bacik