From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Carlos Maiolino <cmaiolino@redhat.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH V2 1/5] xfs: Remove kmem_zone_alloc() usage
Date: Sat, 11 Jul 2020 08:21:32 +1000 [thread overview]
Message-ID: <20200710222132.GC2005@dread.disaster.area> (raw)
In-Reply-To: <20200710160804.GA10364@infradead.org>
On Fri, Jul 10, 2020 at 05:08:04PM +0100, Christoph Hellwig wrote:
> > 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.
Checking PF_FSTRANS was what I suggested should be done here, not
PF_MEMALLOC_NOFS...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2020-07-10 22:21 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
2020-07-10 22:21 ` Dave Chinner [this message]
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=20200710222132.GC2005@dread.disaster.area \
--to=david@fromorbit.com \
--cc=cmaiolino@redhat.com \
--cc=hch@infradead.org \
--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).