Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp667166lqb; Fri, 24 May 2024 09:29:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTAWaV9tQUFKknNAb0fQrEEf3peB4ZmTXuWb6zMzCgSzTTkWb65dZcYodV9+T6c5O9cuN3Jnadsa9pmTFtpsAcjgpCI0IhWMR+gZJ9Gw== X-Google-Smtp-Source: AGHT+IGDWRHphugyyxU0Iayyd19D5NH35sITqAuabezsuTKx/kohwdqOULUrrM3T6Aa81I+IhJf+ X-Received: by 2002:a50:9ea4:0:b0:572:9a52:6696 with SMTP id 4fb4d7f45d1cf-578519506c8mr1806234a12.12.1716568171586; Fri, 24 May 2024 09:29:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716568171; cv=pass; d=google.com; s=arc-20160816; b=C/S0CS/XoCPpijkhAfaeKgPpsODboESrz/5oQ+5UF3k2/PU+I3pdEEaXltA4VBywli 4kG0/EYGlW6fet84i83lU74/Vx/Wsy47iFIv2gOG4ZuS8d4I5g6e465riJz+qptGfy1g 2pUQmxqCwXxeG72/74v8tOSgL9p/ZZuC8eewu+Ty/t0F67gke1/rm6e7ZaUKhPjSfiI8 DL4f9JqDiB+x9swY81s4LHqnrtoqgoaehAPaf8ZdbTkcJDLyrjH9Od0cDpnkjuOgZOG3 5cV7/AVF4+Odp94E59lskWl+QGyu7Oeq24HO96V5oiDptESV7MQkL3Wx/HoqbsfKsKJ7 9unw== 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=B+YAuHdOZVCtb+ZmWIiRbLMqGayfxaS/iCjW3hjDnCw=; fh=CPXRJ/aDa63WiGCi0+EM2Gv6rJB/FrXx1LBPcSvstC8=; b=qzVDwU+ZWZ/GqUJcBDotWhByexLdKYeLrzErJygzvbyGe/S4OgGqAzFd3vinRIPoFf /0rkYI9HgzKE+h8p8s+W5mVamdLawlAfgTpi7pyxTZJOcjs846XPdYSchcl9VnsYXNok JFdu6X3JEb+eVYhcDWkz/I8bEW8eAqIHyYZ9gIorqxspKeh7Hjb56JVxcbf02R6VthlO zO7dTJa+FLgvC/RYLzbPlxfsmfpmqiQniARzKTVbJtEJpmpUtz4wSNjjaoGMcgLnfKhc 50xpnhrJsk0maCQJ+JAHmV25pEKY2VzF+75fP29Hct2bWBaDqY+T7TCmjb9dS7Kv+vSP oGXw==; 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-188926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-578524ba13csi992304a12.588.2024.05.24.09.29.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 09:29:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-188926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188926-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 54B311F219D3 for ; Fri, 24 May 2024 16:29:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1C0D12EBE4; Fri, 24 May 2024 16:29:21 +0000 (UTC) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 EA347126F06; Fri, 24 May 2024 16:29:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716568161; cv=none; b=a9Jb8MSK3h1kjqvziE7VXfBOLQSlTRNLZivOfViooyMMcAgksyX5qAraIem5t2Tl+2V0di5//a4SsJF/sHw7w7otEGhrPXtsCQB5koQnMcRKGTZQZaDIUgYTqsahsX9rC+N7Zrp6CxXVIiy8gUgW1hyjX+mJcLYGomIx9VZbBts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716568161; c=relaxed/simple; bh=gXyxBWibeXUwqcMk4+uZivGUqGgkuPH86sT5M7vg9lw=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=GIc5/0Ly1Riq2aU4NkDEaKMSekazQmzBz8Ng2cdXnGy1yWRLHBHPp+pyv7SoXuEtCUd/V/9XukR7EwNIc0o/pU3lfCVgUEKxnhpSR+EwVoMJuNHyPn4E+AMquwB3N+trMyWofGdZaXl5wLhAeB25y855oZfTykz1y1YOwQWs+N8= 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.218.45 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-ej1-f45.google.com with SMTP id a640c23a62f3a-a5a7d28555bso1343660866b.1; Fri, 24 May 2024 09:29:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716568158; x=1717172958; 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=B+YAuHdOZVCtb+ZmWIiRbLMqGayfxaS/iCjW3hjDnCw=; b=i5f9Jk952XhiTqHVTkQKT1TC/HPMbM++RiLdbTKvihcPajQxeYGAPTF1iEx7HwwuMq uiOq7qENUOuRdchdjpTFwMRvEPt/V7/EPn38RHm83AaeWfEeHRIJW2xtkXp65rnAT0pt 034Lafc8CDRpQa1kpkx8wRBhGH1DzBIk+zTa5uDS9JqpTSLHdNX70csTGWhUFonmBt4n XA7Pnw63rfWiLPUIuEpeSZ5O525sihe/+FYkfS1cN8xpVSnJNplFVJjg6vs0QMO6VSe7 lPqGJjjxPrkU4IdJzGjXC+obG7pshgMx7AXFLK5sFq1FBWYM/MRXT4mGC3In/IiGbF0g Uoeg== X-Forwarded-Encrypted: i=1; AJvYcCUdfdYk9AE7hSpZKLDnp3LwLF7xWEkj+/npyRLB8FtZRBzr/8uqjCdh/aeXa7+33ygryfCT/PBktugJVNhEnvhgoUaQOVz8m/atyMipy3gK5Ew68Ku+OiRLJxImT0LWimhCLJZm4my4Pk0= X-Gm-Message-State: AOJu0YxPtL69x02SgYa1KOGXBQzMJ0/oaCcByHesoVYBSBpzlkddCOY+ EQj2MqYv4eHBsMEa/9cwsZV31E3GgGUm/7E67EFb5Hsl1bEMj89d X-Received: by 2002:a17:906:12d8:b0:a5c:df6b:a9b5 with SMTP id a640c23a62f3a-a6265128c6dmr186503166b.59.1716568157869; Fri, 24 May 2024 09:29:17 -0700 (PDT) Received: from [127.0.0.1] (p200300f6f7253800fa633ffffe02074c.dip0.t-ipconnect.de. [2003:f6:f725:3800:fa63:3fff:fe02:74c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc8dcb2sm154137066b.173.2024.05.24.09.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 09:29:17 -0700 (PDT) From: Johannes Thumshirn Subject: [PATCH v5 0/3] btrfs: zoned: always set aside a zone for relocation Date: Fri, 24 May 2024 18:29:08 +0200 Message-Id: <20240524-zoned-gc-v5-0-872907c7cff4@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=H4sIAFTAUGYC/23NTQ7CIBAF4Ks0rMXwM5TgynsYFy1MW6JpDRiiN r27tCtMXb7JfO/NJGLwGMmpmknA5KOfxhzUoSJ2aMYeqXc5E8EEMMWBfqYRHe0tFRa1kaAMtpr k90fAzr+2qss158HH5xTeW3Pi6/VPSeKUUc5Mx5vaagB9vmEY8X6cQk/WliRKqQopshTMatsaX UvrdlIWUvBCyiy1ywwEKLD7TSilLCSsmxKd6WredA37kcuyfAGi4l0lTwEAAA== To: Chris Mason , Josef Bacik , David Sterba Cc: Hans Holmberg , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Naohiro Aota , Filipe Manana , 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 v5: - Split out one patch to skip relocation of the data relocation bg - Link to v4: https://lore.kernel.org/r/20240523-zoned-gc-v4-0-23ed9f61afa0@kernel.org Changes in v4: - Skip data_reloc_bg in delete_unused_bgs() and reclaim_bgs_work() - Link to v3: https://lore.kernel.org/r/20240521-zoned-gc-v3-0-7db9742454c7@kernel.org Changes in v3: - Rename btrfs_reserve_relocation_zone -> btrfs_reserve_relocation_bg - Bail out if we already have a relocation bg set - Link to v2: https://lore.kernel.org/r/20240515-zoned-gc-v2-0-20c7cb9763cd@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 (3): btrfs: don't try to relocate the data relocation block-group btrfs: zoned: reserve relocation block-group on mount btrfs: reserve new relocation block-group after successful relocation fs/btrfs/block-group.c | 11 ++++++++ fs/btrfs/disk-io.c | 2 ++ fs/btrfs/relocation.c | 14 +++++++++++ fs/btrfs/volumes.c | 2 ++ fs/btrfs/zoned.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ fs/btrfs/zoned.h | 3 +++ 6 files changed, 100 insertions(+) --- base-commit: 2aabf192868a0f6d9ee3e35f9b0a8d97c77a46da change-id: 20240514-zoned-gc-2ce793459eb7 Best regards, -- Johannes Thumshirn