All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Carlos Maiolino <cmaiolino@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH V2 1/5] xfs: Remove kmem_zone_alloc() usage
Date: Fri, 10 Jul 2020 17:08:04 +0100	[thread overview]
Message-ID: <20200710160804.GA10364@infradead.org> (raw)
In-Reply-To: <20200710091536.95828-2-cmaiolino@redhat.com>

> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 5daef654956cb..8c3fe7ef56e27 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -35,15 +35,20 @@ xfs_inode_alloc(
>  	xfs_ino_t		ino)
>  {
>  	struct xfs_inode	*ip;
> +	gfp_t			gfp_mask = GFP_KERNEL;
>  
>  	/*
> -	 * if this didn't occur in transactions, we could use
> -	 * KM_MAYFAIL and return NULL here on ENOMEM. Set the
> -	 * code up to do this anyway.
> +	 * If this is inside a transaction, we can not fail here,
> +	 * otherwise we can return NULL on ENOMEM.
>  	 */
> -	ip = kmem_zone_alloc(xfs_inode_zone, 0);
> +
> +	if (current->flags & PF_MEMALLOC_NOFS)
> +		gfp_mask |= __GFP_NOFAIL;

I'm a little worried about this change in beavior here.  Can we
just keep the unconditional __GFP_NOFAIL and if we really care do the
change separately after the series?  At that point it should probably
use the re-added PF_FSTRANS flag as well.

  reply	other threads:[~2020-07-10 16:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10  9:15 [PATCH 0/5] Continue xfs kmem cleanup - V2 Carlos Maiolino
2020-07-10  9:15 ` [PATCH V2 1/5] xfs: Remove kmem_zone_alloc() usage Carlos Maiolino
2020-07-10 16:08   ` Christoph Hellwig [this message]
2020-07-10 22:21     ` Dave Chinner
2020-07-13  9:16       ` Carlos Maiolino
2020-07-13 16:17         ` Darrick J. Wong
2020-07-15 15:06           ` Carlos Maiolino
2020-07-15 15:37             ` Darrick J. Wong
2020-07-15 17:32               ` Christoph Hellwig
2020-07-10  9:15 ` [PATCH V2 2/5] xfs: Remove kmem_zone_zalloc() usage Carlos Maiolino
2020-07-10 16:09   ` Christoph Hellwig
2020-07-10  9:15 ` [PATCH V3 3/5] xfs: Modify xlog_ticket_alloc() to use kernel's MM API Carlos Maiolino
2020-07-10  9:23   ` Carlos Maiolino
2020-07-10 16:09   ` Christoph Hellwig
2020-07-10  9:15 ` [PATCH 4/5] xfs: remove xfs_zone_{alloc,zalloc} helpers Carlos Maiolino
2020-07-10 16:09   ` Christoph Hellwig
2020-07-10  9:15 ` [PATCH 5/5] xfs: Remove xfs_da_state_alloc() helper Carlos Maiolino
2020-07-10 16:11   ` Christoph Hellwig
2020-07-13  9:17     ` 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=20200710160804.GA10364@infradead.org \
    --to=hch@infradead.org \
    --cc=cmaiolino@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.