public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nirjhar Roy (IBM)" <nirjhar@linux.ibm.com>
To: djwong@kernel.org, hch@infradead.org, cem@kernel.org,
	david@fromorbit.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org,
	ritesh.list@gmail.com, ojaswin@linux.ibm.com,
	nirjhar@linux.ibm.com, nirjhar.roy.lists@gmail.com,
	hsiangkao@linux.alibaba.com
Subject: [RFC v1 0/4] xfs: Add support to shrink multiple empty rtgroups
Date: Thu, 19 Feb 2026 11:33:50 +0530	[thread overview]
Message-ID: <cover.1771418537.git.nirjhar.roy.lists@gmail.com> (raw)
In-Reply-To: <20260219055737.769860-1-nirjhar@linux.ibm.com>

From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>

This work is based on a previous RFC[1] by Gao Xiang and various ideas
proposed by Dave Chinner in the RFC[1].

The patch begins with the re-introduction of some of the data
structures that were removed, some code refactoring and
finally the patch that implements the multi rtgroup shrink design.
We can remove only those rtgroups which are empty.
For non-empty rtgroups the rtextents can migrated to other rtgroups
(assuming the required amount of space is available).
I am working on the patch series [2](by Darrick and
Dave) for completion of the data block migration from the end of the
filesystem for emptying an realtime group. That will be a future work
after this.
The final patch has all the details including the definition of the
terminologies and the overall design.

The design is quite similar to the design of data AG removal implemented
in the patch series[3] that I have posted earlier.
The reason for keeping [3] on hold and posting this patch series is
that (based on the discussion in [5], [6]), realtime devices won't have any
metadata/inodes and migrating data from the end of realtime devices will
be simpler. On the other hand there are challenges in moving metadata
from regular AGs especially inodes.

Please note that I have added RBs from Darrick in patch 1 which was
given in [4].

Instructions to test this patch:
$ Apply the patch for xfsprogs sent with this series and install it.
$ mkfs.xfs -f -m metadir=1  -r rtdev=/dev/loop2,extsize=4096,rgcount=4,size=1G \
	-d size=1G /dev/loop1
$ mount -o rtdev=/dev/loop2 /dev/loop1 /mnt/scratch
$ # shrink by 1.5 rtgroups
$ xfs_growfs -R $(( 65536 * 2 + 32768 ))  /mnt1/scratch

I have also sent the tests.

[1] https://lore.kernel.org/all/20210414195240.1802221-1-hsiangkao@redhat.com/
[2] https://lore.kernel.org/linux-xfs/173568777852.2709794.6356870909327619205.stgit@frogsfrogsfrogs/
[3] https://lore.kernel.org/linux-xfs/cover.1760640936.git.nirjhar.roy.lists@gmail.com/
[4] https://lore.kernel.org/all/20250729202632.GF2672049@frogsfrogsfrogs/
[5] https://lore.kernel.org/linux-xfs/aPnMk_2YNHLJU5wm@infradead.org/
[6] https://lore.kernel.org/linux-xfs/aPiFBxhc34RNgu5h@infradead.org/

Nirjhar Roy (IBM) (4):
  xfs: Re-introduce xg_active_wq field in struct xfs_group
  xfs: Introduce xfs_rtginodes_ensure_all()
  xfs: Add a new state for shrinking
  xfs: Add support to shrink multiple empty realtime groups

 fs/xfs/libxfs/xfs_group.c     |  18 +-
 fs/xfs/libxfs/xfs_group.h     |   4 +
 fs/xfs/libxfs/xfs_rtgroup.c   | 105 ++++-
 fs/xfs/libxfs/xfs_rtgroup.h   |  31 ++
 fs/xfs/xfs_buf_item_recover.c |  25 +-
 fs/xfs/xfs_extent_busy.c      |  30 ++
 fs/xfs/xfs_extent_busy.h      |   2 +
 fs/xfs/xfs_inode.c            |   8 +-
 fs/xfs/xfs_mount.h            |   3 +
 fs/xfs/xfs_rtalloc.c          | 824 +++++++++++++++++++++++++++++++++-
 fs/xfs/xfs_trans.c            |   1 -
 11 files changed, 1023 insertions(+), 28 deletions(-)

--
2.43.5


  reply	other threads:[~2026-02-19  6:05 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  5:57 xfs: Add support for multi rtgroup shrink+removal Nirjhar Roy (IBM)
2026-02-19  6:03 ` Nirjhar Roy (IBM) [this message]
2026-02-19  6:03   ` [RFC v1 1/4] xfs: Re-introduce xg_active_wq field in struct xfs_group Nirjhar Roy (IBM)
2026-02-19  6:13     ` Christoph Hellwig
2026-02-19  6:03   ` [RFC v1 2/4] xfs: Introduce xfs_rtginodes_ensure_all() Nirjhar Roy (IBM)
2026-02-19  6:15     ` Christoph Hellwig
2026-02-25  5:18       ` Nirjhar Roy (IBM)
2026-02-19  6:03   ` [RFC v1 3/4] xfs: Add a new state for shrinking Nirjhar Roy (IBM)
2026-02-19  6:03   ` [RFC v1 4/4] xfs: Add support to shrink multiple empty realtime groups Nirjhar Roy (IBM)
2026-02-19  6:23     ` Christoph Hellwig
2026-02-25  5:17       ` Nirjhar Roy (IBM)
2026-02-25 14:24         ` Christoph Hellwig
2026-02-26 12:59           ` Nirjhar Roy (IBM)
2026-02-23 11:29   ` [RFC v1 0/4] xfs: Add support to shrink multiple empty rtgroups Nirjhar Roy (IBM)
2026-03-18 14:43   ` Nirjhar Roy (IBM)
2026-03-18 15:20     ` Christoph Hellwig
2026-02-19  6:08 ` [PATCH v1] xfs_growfs: Allow shrink of realtime XFS Nirjhar Roy (IBM)
2026-02-19  6:10 ` [PATCH v1 0/7] Add multi rtgroup grow and shrink tests Nirjhar Roy (IBM)
2026-02-19  6:10   ` [PATCH v1 1/7] xfs: Introduce _require_realtime_xfs_{shrink,grow} pre-condition Nirjhar Roy (IBM)
2026-02-19  6:10   ` [PATCH v1 2/7] xfs: Introduce helpers to count the number of bitmap and summary inodes Nirjhar Roy (IBM)
2026-02-19  6:10   ` [PATCH v1 3/7] xfs: Add realtime group grow tests Nirjhar Roy (IBM)
2026-02-19  6:40     ` Christoph Hellwig
2026-02-25  5:24       ` Nirjhar Roy (IBM)
2026-02-19  6:10   ` [PATCH v1 4/7] xfs: Add multi rt group grow + shutdown + recovery tests Nirjhar Roy (IBM)
2026-02-19  6:10   ` [PATCH v1 5/7] xfs: Add realtime group shrink tests Nirjhar Roy (IBM)
2026-02-19  6:10   ` [PATCH v1 6/7] xfs: Add multi rt group shrink + shutdown + recovery tests Nirjhar Roy (IBM)
2026-02-19  6:10   ` [PATCH v1 7/7] xfs: Add parallel back to back grow/shrink tests Nirjhar Roy (IBM)
2026-02-19 12:55   ` [PATCH v1 0/7] Add multi rtgroup grow and shrink tests Carlos Maiolino
2026-02-19 14:40     ` Nirjhar Roy (IBM)
2026-02-19 14:55       ` Carlos Maiolino
2026-02-19 15:49         ` Darrick J. Wong
2026-02-19 16:35           ` Carlos Maiolino
2026-02-20 11:24           ` Nirjhar Roy (IBM)
2026-02-20 16:10             ` Darrick J. Wong
2026-02-20 18:12               ` Nirjhar Roy (IBM)
2026-02-24 13:04                 ` Carlos Maiolino
2026-02-20 11:20         ` Nirjhar Roy (IBM)
2026-02-20 16:15           ` Darrick J. Wong
2026-02-19 14:56     ` Andrey Albershteyn
2026-02-20 14:07     ` Konstantin Ryabitsev
2026-02-24 13:02       ` Carlos Maiolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1771418537.git.nirjhar.roy.lists@gmail.com \
    --to=nirjhar@linux.ibm.com \
    --cc=cem@kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=nirjhar.roy.lists@gmail.com \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox