Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp203355lqo; Wed, 15 May 2024 11:43:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6avYJ1nlWCIbhp7koSw38j9VTBuTvzfyDCar/FLzZYb+9SdQfg7soHMYfZwpz3a2iX6pjsKPAZRiZ8WKiWw+Jc60XSSxKY4+vreHi8Q== X-Google-Smtp-Source: AGHT+IFaCLT12AtK6lh7k+Qhgc3q+Nnl5PTzmwQbWCUXUIW53KGmoFQBqIFtyiCNX0SDJqu802gg X-Received: by 2002:a05:6870:61d6:b0:229:fd96:1e6f with SMTP id 586e51a60fabf-24172bb1a3cmr20507842fac.24.1715798602007; Wed, 15 May 2024 11:43:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715798601; cv=pass; d=google.com; s=arc-20160816; b=FrGnbwV0EaJXg4HI3QogsuGRXoyb5yAl04HzzsKbfe/Ltn+XG6f2TSspA0gbELcUqG 0cq64nxKEw3KHRzGwoXHckneSelTW+OoBCfwF/qv8lBE9J3av2PBWQoohC0m1rHQDlrD fmj/+fFoG/A/7YbuKCPTWmoM3Zkvl32kQzKnrJOdVIgaJP50jZQqguFQPosE4AlvQ0/U MQUwzMrC4GywRpe2O65KPa4Ipbo4EJAOaueraYYekEKs3ca2aSYElQ98YaChbLUkAf6w 7UO6gTXubwj1zF1fFAvueAi9pnEL6vfrQ8TcqIICYwanougmFJ5oz6x86tTsf+4+HdP8 z1wA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from; bh=e+x9YbbXZGKes3m+Na4YkHDoAmHUGifUPCswllvzoGM=; fh=Ags+KrVATVjpsGwhW3PCwTgGRvWPmaHEzOG0ScrEhaQ=; b=cXObXRsisDc2fCOJRSzu2LwX9BEUuw3P42+QSmkzkTzEFY/L5J0LFqJHlFzbkn5D0K xVZdSgOaEnIfrg4ilcEPT/AL5fxoHvifDRAYpMRkJbd9a67IhhgTGz2s0Pl/egQbrJS2 nQafTTPbLpiBdgCvxFBG9FkB2MCHXXPLo25mFomp/OQRtPbfusF95Gt/WgsG6BfRM3MA 32ih/LRlHap5+3kwe+m35tvl1GDT8nn4qZrh8l3ncsjXidWGGxqCgLSpj7V6Y51blvMH BdVSk66v2gnTcMlxDH4XTD+xLOucrvlVyqNWYWTrjrVjczB6Pp+62OHVlpjOU8G3Hzp9 yohw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-180273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df54a11absi164042481cf.27.2024.05.15.11.43.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 11:43:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-180273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AF8C01C21E08 for ; Wed, 15 May 2024 18:43:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B48D159209; Wed, 15 May 2024 18:43:13 +0000 (UTC) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 782A35B1F8; Wed, 15 May 2024 18:43:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715798593; cv=none; b=cKOVRn/nbp3h13MNRUCzph7bykSiNa3GG9+Xt483YPMuGzS+RzjEj1ulXoH9esk4BDhpQK/NYKwV/y0ZHkpaXGH05RJuNU1hs9Sd//7WdHHJtxEkIzVjXUTIyURIp7+aiBAljJ4lFsUZ/GB/TNIKdeKla5tiIWWvY1mROIKMz7w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715798593; c=relaxed/simple; bh=ZME+MN7RLbjJQdXafmg8X4d3sQojCV/y8dHf1/Jomz0=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=Rc8JQlJiC/KEeGk1THWipqr1NcJXZAyuCLbMF7At6YipHStA3diJMte+QhU0MXnOtrrv+jDLmGlfJMZZVzUNZVVVHe66gqPfayZhrlGYkveVfZ6RArlIrHL9B1VaRdrDB1d2Er0KpQ+l0vSsebbZaeOmBF606pk44/wzf77Rebw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-56e48d0a632so3054410a12.2; Wed, 15 May 2024 11:43:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715798590; x=1716403390; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e+x9YbbXZGKes3m+Na4YkHDoAmHUGifUPCswllvzoGM=; b=BzcW3fIu+A41luIWpoUuTnA6DjoBK5WmIFHgNyb5n6fgTMV8/aNQD5ONMEL6w/KlnW U/47Whj6DRHFKId5Iwp7mE6GQTRGhYViE31atlneMowoAfMp6GCCmg/906IqDs8rk+6r Mgd2IAwLYWT0LxPX1MRLV/U4vaSOb6fhOMyGQ313yXRRySg0HWO8k0SS5XmVMwJXrkGc jF1Dra0ysrep8Mg9IUBc+N2ns0kacQ35k3DvvKM805DR1qVGCx5y/PYGfB/5S4Jqe8Ms jpb5HcLGsoIialNHzcuocrbbWOCJ9yDUkhaChrgAk9U34kj8YJpVKzAIW5u8RfCPCNXn KmVQ== X-Forwarded-Encrypted: i=1; AJvYcCVmlPfkPuXU1facCT741dNS0tz6ZbVdn4y1PpheUzCXbhDsAPzLvL0+jJGVgLOSbN8bzcVQ2MugWmgcwbQvutA+MuXojwEe0M80goGa2sylcUEBPWbN0ATMItXn7c0MHuvPpzGrZjvMN9Q= X-Gm-Message-State: AOJu0Yz5zddHrEeViVgesWq6RzlKQsMHNk78tND+/rxry8AclG1tM9mV P2N7fAE7LEIWYu94KP0o9/5AP74sih0PT3S9pC4gSXR1aiE9OpYS X-Received: by 2002:a50:aa94:0:b0:56b:cecb:a4c8 with SMTP id 4fb4d7f45d1cf-5734d70603cmr17407606a12.39.1715798589490; Wed, 15 May 2024 11:43:09 -0700 (PDT) Received: from [127.0.0.1] (p200300f6f718be00fa633ffffe02074c.dip0.t-ipconnect.de. [2003:f6:f718:be00:fa63:3fff:fe02:74c]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-574f4a6280csm1724340a12.52.2024.05.15.11.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 11:43:09 -0700 (PDT) From: Johannes Thumshirn Subject: [PATCH v2 0/2] btrfs: zoned: always set aside a zone for relocation Date: Wed, 15 May 2024 20:43:05 +0200 Message-Id: <20240515-zoned-gc-v2-0-20c7cb9763cd@kernel.org> 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="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIADkCRWYC/23MQQ7CIBCF4as0sxYDSCW48h6mi0qndKIBMxiiN txd7Nrl//LyrZCRCTOcuhUYC2VKsYXedeCXMQYUNLUGLbWRvTLikyJOInihPVp3ML3Dq4V2fzD O9Nqoy9B6ofxM/N7kon7rH6QoIYWSblbj0Vtj7PmGHPG+TxxgqLV+ARLXKUGhAAAA To: Chris Mason , Josef Bacik , David Sterba Cc: Hans Holmberg , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Naohiro Aota , Johannes Thumshirn X-Mailer: b4 0.12.4 For zoned filesytsems we heavily rely on relocation for garbage collecting as we cannot do any in-place updates of disk blocks. But there can be situations where we're running out of space for doing the relocation. To solve this, always have a zone reserved for relocation. This is a subset of another approach to this problem I've submitted in https://lore.kernel.org/r/20240328-hans-v1-0-4cd558959407@kernel.org --- Changes in v2: - Incorporate Naohiro's review - Link to v1: https://lore.kernel.org/r/20240514-zoned-gc-v1-0-109f1a6c7447@kernel.org --- Johannes Thumshirn (2): btrfs: zoned: reserve relocation zone on mount btrfs: reserve new relocation zone after successful relocation fs/btrfs/disk-io.c | 2 ++ fs/btrfs/relocation.c | 7 ++++++ fs/btrfs/zoned.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ fs/btrfs/zoned.h | 3 +++ 4 files changed, 72 insertions(+) --- base-commit: d52875a6df98dc77933853e8427bd77f4598a9a7 change-id: 20240514-zoned-gc-2ce793459eb7 Best regards, -- Johannes Thumshirn