Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2936840lqo; Tue, 14 May 2024 14:13:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVfi4cToOQCWAd32GL7oAe8+ZGtUBMGvBy9T6dgyEJWn8Y86VFVRnuZazc/mq6kpz1Yh2U3okGVBETSS0M4iPyUqDkTBaUCJVXnqW5Rsw== X-Google-Smtp-Source: AGHT+IHUI/B0lAsX6BvnoeIQPOQi2K8wApXNToYX/SsCz83jScVCon3OOitNDbwY56RvvUg9jk1p X-Received: by 2002:a50:9505:0:b0:572:6698:7d25 with SMTP id 4fb4d7f45d1cf-5734d6b1f47mr10115325a12.26.1715721217823; Tue, 14 May 2024 14:13:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715721217; cv=pass; d=google.com; s=arc-20160816; b=rvP+lOlGU0ELhnnXu9gTx+IrWwD1WTcEp6D7anhKSl+zH5YKk1AIn9npReXokWgQ22 hjuBQ35R/Cvy1Hrb+kPil9Z+byyLZgSLkSUVZUDe5KNlgLeO87VtU/NBIwJKpqPpXMxx ud+3iE2pydk/ZJFAvJqu87sywVQW31fY4ulsNCEBo7ZOa4XN7bE6WTPxfBTL64j/FpX6 fjabI2bGi4XwbxFWPSbbuvnsOvJa6YGrebCalkc5AyMREEYMLzayEYJRQHosbdtl2Lve Yv0wJVA1KDleY4glmR1fOycc60eqNRBDcJwjv2CNEK/iZvXJS+6OSCFSdOugX1ebI1K0 Xq/Q== 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=FOzSOgRlo+lAzBfpBfmoCWLq0QIm4oZxY1op+56rTOY=; fh=/LQkT2nnI92y/rFaytBa15g0B07d51lV1NjQab9iU7A=; b=tWuzAF4xm7DWzA8wouD+fYMAy8ZIxiUjEXeBeuEg8OieNH81ylIsEf2pOIIZCNGqRs L1SKWIORdX4fBH+APdF6V44dE1z3Kr4JfprLBLAOJsABt2N0p820FEclrdkAqUhadXOu XyyhlMYl2G2lbm02+9ZAIYBIjHrs9xI6k/a+6gN1/E2vW2S9qWqAqkFmIP9fCEOH7Rgc hcJ/taZLDOV2HXG8Gjcp/18zIqGaCDJmhHFftp9f5KMXDZijN+dTS91hAhS9hAogsR4A hmS5eSpfO8ptKLrwR/OYD6CKcOCGhjB/y94lKlG9d1F3wFT4OeqEKNKR+/r3pCqxtArs NTgQ==; 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-179174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179174-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-5733c3793b6si6745390a12.682.2024.05.14.14.13.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 14:13:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179174-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-179174-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179174-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 726C81F229AE for ; Tue, 14 May 2024 21:13:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B687A181BAC; Tue, 14 May 2024 21:13:27 +0000 (UTC) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.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 BB8841DFD1; Tue, 14 May 2024 21:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715721207; cv=none; b=QJhJ2LlyjLng6ef+NhNGz9mI5HNAZ3CB0nrjmrvx5ygzGYuwmfeMJL1UCGh/COn7Pnd4Ej+pxUpVLMmzeXwnoAf+sRGbT4FJGa5p2wA0F/rAH4iyKK4bZGZqk10G2gjeOtVMBIoNa1kklzOiM/BDKZHtxx54VRxrRKEosyvxJ2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715721207; c=relaxed/simple; bh=SqyRgN9yJXCB1hPDQDjovWg0409sYWzhdJrmQ7geNGI=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=erPO1p5/6Hf7+QTRZdx9auVVQRtRmejUSxNb0Ll/OB4PQJnNn3XLYP7FeVytNx40ZKWP+56yS3DcADEjhutQlrjNJpg7cqacNYK9hwD5AhmySKqo8LNc4IBIskJckFcymeIzLsqGZY/0TpM0feOu7Bc/cb5I7rq/PdixqnGgPqs= 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.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-ej1-f53.google.com with SMTP id a640c23a62f3a-a5a5cb0e6b7so93175466b.1; Tue, 14 May 2024 14:13:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715721204; x=1716326004; 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=FOzSOgRlo+lAzBfpBfmoCWLq0QIm4oZxY1op+56rTOY=; b=S9vP8tbw763xkCHmSrA34CZbSMf5/DxJa+qJM13iIRZsdA36jRI7w+uF5WKjAIqk3t owmqr900t86M7iV4k4MLeN7hqkF+OIabFiBueUQ1GqFdpDAE/pZvNQrfm2naYTv3ClfB +Z+s8DEcevJ+w+tUdf50cZeEMEvQbD4tis0gJVEypay2/IC5gy5+V6hOqxVI+CvdKhVq ej/F+tj6z4KSgghWaCtVKxX3nu/Nqh5WgVNbG9Typ8ve1tboEiuZmZYKztIXKgzNJ36t dvRKVsn6Kc0cdh/zyiwSrQ4sc6c8f4motd7JxAZtZ/ARjA3txfk2ld3P72++SbUzzrvv /O4A== X-Forwarded-Encrypted: i=1; AJvYcCXc3ykT+Hp9Nxz9a5N5cs0slI2PY5UAE7UXtqJ+yAG7qMe/uzXDihiGOF28QsbrE0O4nap0GOKwWmT52o4vzZMuJGxB2wjUOmN1nyAMTf9ZrwFZ2xKOikb4L9+M33QKCjsMMpw4EYz50FY= X-Gm-Message-State: AOJu0YzD5dBXauA1FamzXrrsv7xCMzrgtA3s7psolWdGtOFoCZIESseH 7mcgJrxL7lJFI/tUQwOORVksc3CO5V41nUgrWmdXbTWA9mbhBY45 X-Received: by 2002:a17:906:6b85:b0:a59:c319:f1dc with SMTP id a640c23a62f3a-a5a2d53af75mr925110266b.4.1715721204006; Tue, 14 May 2024 14:13:24 -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 a640c23a62f3a-a5a178a9d73sm760229766b.67.2024.05.14.14.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 14:13:23 -0700 (PDT) From: Johannes Thumshirn Subject: [PATCH 0/2] btrfs: zoned: always set aside a zone for relocation Date: Tue, 14 May 2024 23:13:20 +0200 Message-Id: <20240514-zoned-gc-v1-0-109f1a6c7447@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=H4sIAPDTQ2YC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDU0MT3ar8vNQU3fRkXaPkVHNLYxNTy9QkcyWg8oKi1LTMCrBR0bG1tQA OuPu6WgAAAA== To: Chris Mason , Josef Bacik , David Sterba Cc: Hans Holmberg , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, 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 --- 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 | 4 ++++ fs/btrfs/zoned.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ fs/btrfs/zoned.h | 3 +++ 4 files changed, 69 insertions(+) --- base-commit: d52875a6df98dc77933853e8427bd77f4598a9a7 change-id: 20240514-zoned-gc-2ce793459eb7 Best regards, -- Johannes Thumshirn