linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Holmberg <Hans.Holmberg@wdc.com>
To: hch <hch@lst.de>, Carlos Maiolino <cem@kernel.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 2/3] xfs: kick off inodegc when failing to reserve zoned blocks
Date: Mon, 18 Aug 2025 13:05:53 +0000	[thread overview]
Message-ID: <38e03051-f89a-4f4c-a145-d0893d4e7cbc@wdc.com> (raw)
In-Reply-To: <20250818050716.1485521-3-hch@lst.de>

On 18/08/2025 07:07, Christoph Hellwig wrote:
> XFS processes truncating unlinked inodes asynchronously and thus the free
> space pool only sees them with a delay.  The non-zoned write path thus
> calls into inodegc to accelerate this processing before failing an
> allocation due the lack of free blocks.  Do the same for the zoned space
> reservation.
> 
> Fixes: 0bb2193056b5 ("xfs: add support for zoned space reservations")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/xfs/xfs_zone_space_resv.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/fs/xfs/xfs_zone_space_resv.c b/fs/xfs/xfs_zone_space_resv.c
> index 1313c55b8cbe..9cd38716fd25 100644
> --- a/fs/xfs/xfs_zone_space_resv.c
> +++ b/fs/xfs/xfs_zone_space_resv.c
> @@ -10,6 +10,7 @@
>  #include "xfs_mount.h"
>  #include "xfs_inode.h"
>  #include "xfs_rtbitmap.h"
> +#include "xfs_icache.h"
>  #include "xfs_zone_alloc.h"
>  #include "xfs_zone_priv.h"
>  #include "xfs_zones.h"
> @@ -230,6 +231,11 @@ xfs_zoned_space_reserve(
>  
>  	error = xfs_dec_freecounter(mp, XC_FREE_RTEXTENTS, count_fsb,
>  			flags & XFS_ZR_RESERVED);
> +	if (error == -ENOSPC && !(flags & XFS_ZR_NOWAIT)) {
> +		xfs_inodegc_flush(mp);
> +		error = xfs_dec_freecounter(mp, XC_FREE_RTEXTENTS, count_fsb,
> +				flags & XFS_ZR_RESERVED);
> +	}
>  	if (error == -ENOSPC && (flags & XFS_ZR_GREEDY) && count_fsb > 1)
>  		error = xfs_zoned_reserve_extents_greedy(mp, &count_fsb, flags);
>  	if (error)

Looks good to me.

Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>

  reply	other threads:[~2025-08-18 13:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18  5:06 zoned allocator fixes Christoph Hellwig
2025-08-18  5:06 ` [PATCH 1/3] xfs: remove xfs_last_used_zone Christoph Hellwig
2025-08-18 13:05   ` Hans Holmberg
2025-08-19  5:56   ` Damien Le Moal
2025-08-18  5:06 ` [PATCH 2/3] xfs: kick off inodegc when failing to reserve zoned blocks Christoph Hellwig
2025-08-18 13:05   ` Hans Holmberg [this message]
2025-08-18  5:06 ` [PATCH 3/3] xfs: reject swapon for inodes on a zoned file system earlier Christoph Hellwig
2025-08-18 13:06   ` Hans Holmberg
2025-08-19  7:17   ` Damien Le Moal
2025-08-19 13:11 ` zoned allocator fixes 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=38e03051-f89a-4f4c-a145-d0893d4e7cbc@wdc.com \
    --to=hans.holmberg@wdc.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).