Re: [PATCH 3/4] xfs: Modify xlog_ticket_alloc() to use kernel's MM API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 08, 2020 at 02:56:07PM +0200, Carlos Maiolino wrote:
> change xlog_ticket_alloc() to use default kmem_cache_zalloc(), and
> modify its callers to pass MM flags as arguments.
> 
> Signed-off-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
> ---
>  fs/xfs/xfs_log.c      | 7 ++++---
>  fs/xfs/xfs_log_cil.c  | 2 +-
>  fs/xfs/xfs_log_priv.h | 2 +-
>  3 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 00fda2e8e7380..6d40d479e34a1 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -433,7 +433,8 @@ xfs_log_reserve(
>  	XFS_STATS_INC(mp, xs_try_logspace);
>  
>  	ASSERT(*ticp == NULL);
> -	tic = xlog_ticket_alloc(log, unit_bytes, cnt, client, permanent, 0);
> +	tic = xlog_ticket_alloc(log, unit_bytes, cnt, client, permanent,
> +				(GFP_KERNEL | __GFP_NOFAIL));
>  	*ticp = tic;

xfs_log_reserve() is called either from transaction reservation
which is under memalloc_nofs context, or from the CIL with explicit
GFP_NOFS, or from the unmount path which is GFP_KERNEL but is
holding various filesystem locks.

I suspect that this patch should just remove the gfp flags from
xlog_ticket_alloc() and just unconditionally use GFP_NOFS |
__GFP_NOFAIL fo allocating the ticket. That would clean this up
quite a bit....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux