From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DD33C47DAF for ; Thu, 18 Jan 2024 23:38:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 928BE6B00A2; Thu, 18 Jan 2024 18:38:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D8AE6B00A3; Thu, 18 Jan 2024 18:38:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A0416B00A4; Thu, 18 Jan 2024 18:38:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 690B46B00A2 for ; Thu, 18 Jan 2024 18:38:25 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 284E080529 for ; Thu, 18 Jan 2024 23:38:25 +0000 (UTC) X-FDA: 81694048170.22.58CB558 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id 6A9F240021 for ; Thu, 18 Jan 2024 23:38:23 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OiLGE3Me; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of djwong@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=djwong@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705621103; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XzpcGlZisjvehXGDCuSS0nuJRe/DB3VQ+eQ6dsKuhJM=; b=AgZtV/zRsot+LQY0bgr50Gg/NVl35COKJEaYPXjqdpqGnnCLZBTdnumyC0itEXswpk+jl3 MQXoC2FONfdRKSVk/cFjN12RzJk2NR+eTkEnI4vPxWXo03+V6aSv1Sm8KQTAddI+KPlcua TOF3jrlWMdY0qCdOHvGkLvcxMmvjhlo= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OiLGE3Me; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of djwong@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=djwong@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705621103; a=rsa-sha256; cv=none; b=BJkRqk3idsH8kJ2TeltUDfpsSbhKaa981bcwXjFnSD7+HkNj69r3A5UPq5XAmCwVU0Ch4f mOGNwiSL+LAZ+nnZvGQH5LIXf9/+zRo1EdhDpGfDDdRpv8O7CvFubXsQoksXT6uvFw3C6S a8jvqODl7kxo+vu1pUbDGMwJMm5Gxak= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8D30E618BF; Thu, 18 Jan 2024 23:38:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3126FC433F1; Thu, 18 Jan 2024 23:38:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705621102; bh=xWFSlb7ZMy+dvnLjA2zyB4Yuz639X4LzJAlJcYrV7y0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OiLGE3MeBxqHkUHTLDxE+tgTy9B3kesjuMdz8vDgEuQLnv8A+IxvIpJZaSmjdjgTe xGVaSJsM4qorulTSRZPFsZsFCTaCKAqQWiUZ6tfkAwMbm9+Dk3+CAKSsC4HxzuOaJj y4uOV4FEw+IaRClGBb1WLRPBAosDvPduk24aveKdlHpu/MhmEeslk4JaXDeMzkik0E vUBKbODqDeH2Y3qdh63gw1OKN0FE0O+gytwefVo45vo7hH33nsYOTBE6OCxJcf/kSm ThJIIq+mNAYJfMkrUBRoIap1G19CQntgnJtATDBDwWpo8G80y+vr2J7TC5WKEk5WTp sBEOr8C/AOEqw== Date: Thu, 18 Jan 2024 15:38:21 -0800 From: "Darrick J. Wong" To: Dave Chinner Cc: linux-xfs@vger.kernel.org, willy@infradead.org, linux-mm@kvack.org Subject: Re: [PATCH 08/12] xfs: use GFP_KERNEL in pure transaction contexts Message-ID: <20240118233821.GK674499@frogsfrogsfrogs> References: <20240115230113.4080105-1-david@fromorbit.com> <20240115230113.4080105-9-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240115230113.4080105-9-david@fromorbit.com> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 6A9F240021 X-Stat-Signature: eyrbsmtqg1u6bbp1rr9exh6fxy1ocrdw X-HE-Tag: 1705621103-264759 X-HE-Meta: U2FsdGVkX199AI1H2KTqUdLOFooi7/FRxLhIpLojIuyvtW1siIKdAMqkUTKF/cfuty0un7Sqs4wFwLQU5h56Iulhg9qVPHFkPMro0fatTRJ5epCPLI+8sdzUDyZylFhyWVQ1gkPmWARildh7Z3dZ5n1rz5sRdwPHpfMIL976lPOkhG9qp0UF914+zetE1iD+cpI3XwPYgHwgBxGSAq5KesRiDUP+XbzyvAcgEcpEYK8aQqpuEXh4gfbHIxZULdnxpFyCijJuK9rs8mwQ/Br4A5SoX7znkdIsWCDtD1SuxNFSxIHgLjTgD7zYXpHJQLiGjRxOMu07Tu4l38SKQlls8y2+GnEaDYSy4WjF7Xwn/6xGZrIysG2h0pF4V9xHGM8R5jvHtyhbO358thbwaPgrt0R4ehO8OZvbvP1HkcBm4bZ+0Y6VG8S7f8F/RX/f4nd3+YjiYl/SaMmcY5/YLjzu7CGl2KlTadfVJRotI6uY0uRP9DDn2sKwykDG6X3Uh/nt+G9mEWC8NUQ30dIgWkB64zsBuxJC7TN5RsT0xtCCW2jLN6BZ8672KBFHbMEUVMQ393qpfPnrgTaVsT2w7KhG0mwNJIyP98wBSTMwYscwTU7Yd3OBizPKTT1gy0snO0M3DmYeu3PherPZcQ3VNoiDfdhRUL2J2UHfgC+75YIjfCF9vvKdzbcOFkDo6FfEIR+Rn7Y249SNiniVLE0sqUdWs8GJm43q/u9+ZRo7qmsGSNMizbAKlIuLrEg+rcB8JZF1IqAAZA8N2VEyk7yABy+QA/y8EoOotFmRacjCxrRt1OaR2MRkoPc0URwlyTwd02yv8YwSDxOenjx5AA6cathltwB4/IWbTk7JNE0Olvx+N/5FMDN02woEPfnJFW5PWosAtOHEha7dNJV69Ws25RUqPDicJnE2aRIOur6dHlGdHYLwM4ARt4NJ1XD5Ex1rkuzodEtPbO9VTBPMY4vbyd4 hHKj0IvB C/MW45jTAGYmzLtfPv8Ic+tJZx/RbLJyqx6EBird7Jw/3jMhfYNIxNssKJH9ebbq78RZbxj6EDxU12oQ3JKqxPxBpyWplgbBX5YgQ08E6NVyWNuGo+9PU9jnNzvWZzZDh+VuPxsnE+bB0alDhJQv8id09O2PCKrKLHa8MNNzYAYNEcXhpv7qVoCfENVsLw0QyqMCRWnZkVA/XpSwhXz/sVQOINwLw9FetT4n1zZXKDOiTNmdO4sF7s/Qk074ZVRZ5Mh/qpTWI6ixNg12EmSSKQ8K06A2ROWnF4zOp8CRtFVj+W+KDSlNOoyBwqFg6LGx95isc X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Jan 16, 2024 at 09:59:46AM +1100, Dave Chinner wrote: > From: Dave Chinner > > When running in a transaction context, memory allocations are scoped > to GFP_NOFS. Hence we don't need to use GFP_NOFS contexts in pure > transaction context allocations - GFP_KERNEL will automatically get > converted to GFP_NOFS as appropriate. > > Go through the code and convert all the obvious GFP_NOFS allocations > in transaction context to use GFP_KERNEL. This further reduces the > explicit use of GFP_NOFS in XFS. > > Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong --D > --- > fs/xfs/libxfs/xfs_attr.c | 3 ++- > fs/xfs/libxfs/xfs_bmap.c | 2 +- > fs/xfs/libxfs/xfs_defer.c | 6 +++--- > fs/xfs/libxfs/xfs_dir2.c | 8 ++++---- > fs/xfs/libxfs/xfs_inode_fork.c | 8 ++++---- > fs/xfs/libxfs/xfs_refcount.c | 2 +- > fs/xfs/libxfs/xfs_rmap.c | 2 +- > fs/xfs/xfs_attr_item.c | 4 ++-- > fs/xfs/xfs_bmap_util.c | 2 +- > fs/xfs/xfs_buf.c | 28 +++++++++++++++++----------- > fs/xfs/xfs_log.c | 3 ++- > fs/xfs/xfs_mru_cache.c | 2 +- > 12 files changed, 39 insertions(+), 31 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c > index 9976a00a73f9..269a57420859 100644 > --- a/fs/xfs/libxfs/xfs_attr.c > +++ b/fs/xfs/libxfs/xfs_attr.c > @@ -891,7 +891,8 @@ xfs_attr_defer_add( > > struct xfs_attr_intent *new; > > - new = kmem_cache_zalloc(xfs_attr_intent_cache, GFP_NOFS | __GFP_NOFAIL); > + new = kmem_cache_zalloc(xfs_attr_intent_cache, > + GFP_KERNEL | __GFP_NOFAIL); > new->xattri_op_flags = op_flags; > new->xattri_da_args = args; > > diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c > index 98aaca933bdd..fbdaa53deecd 100644 > --- a/fs/xfs/libxfs/xfs_bmap.c > +++ b/fs/xfs/libxfs/xfs_bmap.c > @@ -6098,7 +6098,7 @@ __xfs_bmap_add( > bmap->br_blockcount, > bmap->br_state); > > - bi = kmem_cache_alloc(xfs_bmap_intent_cache, GFP_NOFS | __GFP_NOFAIL); > + bi = kmem_cache_alloc(xfs_bmap_intent_cache, GFP_KERNEL | __GFP_NOFAIL); > INIT_LIST_HEAD(&bi->bi_list); > bi->bi_type = type; > bi->bi_owner = ip; > diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c > index 75689c151a54..8ae4401f6810 100644 > --- a/fs/xfs/libxfs/xfs_defer.c > +++ b/fs/xfs/libxfs/xfs_defer.c > @@ -825,7 +825,7 @@ xfs_defer_alloc( > struct xfs_defer_pending *dfp; > > dfp = kmem_cache_zalloc(xfs_defer_pending_cache, > - GFP_NOFS | __GFP_NOFAIL); > + GFP_KERNEL | __GFP_NOFAIL); > dfp->dfp_ops = ops; > INIT_LIST_HEAD(&dfp->dfp_work); > list_add_tail(&dfp->dfp_list, &tp->t_dfops); > @@ -888,7 +888,7 @@ xfs_defer_start_recovery( > struct xfs_defer_pending *dfp; > > dfp = kmem_cache_zalloc(xfs_defer_pending_cache, > - GFP_NOFS | __GFP_NOFAIL); > + GFP_KERNEL | __GFP_NOFAIL); > dfp->dfp_ops = ops; > dfp->dfp_intent = lip; > INIT_LIST_HEAD(&dfp->dfp_work); > @@ -979,7 +979,7 @@ xfs_defer_ops_capture( > return ERR_PTR(error); > > /* Create an object to capture the defer ops. */ > - dfc = kzalloc(sizeof(*dfc), GFP_NOFS | __GFP_NOFAIL); > + dfc = kzalloc(sizeof(*dfc), GFP_KERNEL | __GFP_NOFAIL); > INIT_LIST_HEAD(&dfc->dfc_list); > INIT_LIST_HEAD(&dfc->dfc_dfops); > > diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c > index 728f72f0d078..8c9403b33191 100644 > --- a/fs/xfs/libxfs/xfs_dir2.c > +++ b/fs/xfs/libxfs/xfs_dir2.c > @@ -236,7 +236,7 @@ xfs_dir_init( > if (error) > return error; > > - args = kzalloc(sizeof(*args), GFP_NOFS | __GFP_NOFAIL); > + args = kzalloc(sizeof(*args), GFP_KERNEL | __GFP_NOFAIL); > if (!args) > return -ENOMEM; > > @@ -273,7 +273,7 @@ xfs_dir_createname( > XFS_STATS_INC(dp->i_mount, xs_dir_create); > } > > - args = kzalloc(sizeof(*args), GFP_NOFS | __GFP_NOFAIL); > + args = kzalloc(sizeof(*args), GFP_KERNEL | __GFP_NOFAIL); > if (!args) > return -ENOMEM; > > @@ -435,7 +435,7 @@ xfs_dir_removename( > ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); > XFS_STATS_INC(dp->i_mount, xs_dir_remove); > > - args = kzalloc(sizeof(*args), GFP_NOFS | __GFP_NOFAIL); > + args = kzalloc(sizeof(*args), GFP_KERNEL | __GFP_NOFAIL); > if (!args) > return -ENOMEM; > > @@ -496,7 +496,7 @@ xfs_dir_replace( > if (rval) > return rval; > > - args = kzalloc(sizeof(*args), GFP_NOFS | __GFP_NOFAIL); > + args = kzalloc(sizeof(*args), GFP_KERNEL | __GFP_NOFAIL); > if (!args) > return -ENOMEM; > > diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c > index 709fda3d742f..136d5d7b9de9 100644 > --- a/fs/xfs/libxfs/xfs_inode_fork.c > +++ b/fs/xfs/libxfs/xfs_inode_fork.c > @@ -402,7 +402,7 @@ xfs_iroot_realloc( > if (ifp->if_broot_bytes == 0) { > new_size = XFS_BMAP_BROOT_SPACE_CALC(mp, rec_diff); > ifp->if_broot = kmalloc(new_size, > - GFP_NOFS | __GFP_NOFAIL); > + GFP_KERNEL | __GFP_NOFAIL); > ifp->if_broot_bytes = (int)new_size; > return; > } > @@ -417,7 +417,7 @@ xfs_iroot_realloc( > new_max = cur_max + rec_diff; > new_size = XFS_BMAP_BROOT_SPACE_CALC(mp, new_max); > ifp->if_broot = krealloc(ifp->if_broot, new_size, > - GFP_NOFS | __GFP_NOFAIL); > + GFP_KERNEL | __GFP_NOFAIL); > op = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1, > ifp->if_broot_bytes); > np = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1, > @@ -443,7 +443,7 @@ xfs_iroot_realloc( > else > new_size = 0; > if (new_size > 0) { > - new_broot = kmalloc(new_size, GFP_NOFS | __GFP_NOFAIL); > + new_broot = kmalloc(new_size, GFP_KERNEL | __GFP_NOFAIL); > /* > * First copy over the btree block header. > */ > @@ -512,7 +512,7 @@ xfs_idata_realloc( > > if (byte_diff) { > ifp->if_data = krealloc(ifp->if_data, new_size, > - GFP_NOFS | __GFP_NOFAIL); > + GFP_KERNEL | __GFP_NOFAIL); > if (new_size == 0) > ifp->if_data = NULL; > ifp->if_bytes = new_size; > diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c > index 6709a7f8bad5..7df52daa22cf 100644 > --- a/fs/xfs/libxfs/xfs_refcount.c > +++ b/fs/xfs/libxfs/xfs_refcount.c > @@ -1449,7 +1449,7 @@ __xfs_refcount_add( > blockcount); > > ri = kmem_cache_alloc(xfs_refcount_intent_cache, > - GFP_NOFS | __GFP_NOFAIL); > + GFP_KERNEL | __GFP_NOFAIL); > INIT_LIST_HEAD(&ri->ri_list); > ri->ri_type = type; > ri->ri_startblock = startblock; > diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c > index 76bf7f48cb5a..0bd1f47b2c2b 100644 > --- a/fs/xfs/libxfs/xfs_rmap.c > +++ b/fs/xfs/libxfs/xfs_rmap.c > @@ -2559,7 +2559,7 @@ __xfs_rmap_add( > bmap->br_blockcount, > bmap->br_state); > > - ri = kmem_cache_alloc(xfs_rmap_intent_cache, GFP_NOFS | __GFP_NOFAIL); > + ri = kmem_cache_alloc(xfs_rmap_intent_cache, GFP_KERNEL | __GFP_NOFAIL); > INIT_LIST_HEAD(&ri->ri_list); > ri->ri_type = type; > ri->ri_owner = owner; > diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c > index 2a142cefdc3d..0bf25a2ba3b6 100644 > --- a/fs/xfs/xfs_attr_item.c > +++ b/fs/xfs/xfs_attr_item.c > @@ -226,7 +226,7 @@ xfs_attri_init( > { > struct xfs_attri_log_item *attrip; > > - attrip = kmem_cache_zalloc(xfs_attri_cache, GFP_NOFS | __GFP_NOFAIL); > + attrip = kmem_cache_zalloc(xfs_attri_cache, GFP_KERNEL | __GFP_NOFAIL); > > /* > * Grab an extra reference to the name/value buffer for this log item. > @@ -666,7 +666,7 @@ xfs_attr_create_done( > > attrip = ATTRI_ITEM(intent); > > - attrdp = kmem_cache_zalloc(xfs_attrd_cache, GFP_NOFS | __GFP_NOFAIL); > + attrdp = kmem_cache_zalloc(xfs_attrd_cache, GFP_KERNEL | __GFP_NOFAIL); > > xfs_log_item_init(tp->t_mountp, &attrdp->attrd_item, XFS_LI_ATTRD, > &xfs_attrd_item_ops); > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > index c2531c28905c..cb2a4b940292 100644 > --- a/fs/xfs/xfs_bmap_util.c > +++ b/fs/xfs/xfs_bmap_util.c > @@ -66,7 +66,7 @@ xfs_zero_extent( > return blkdev_issue_zeroout(target->bt_bdev, > block << (mp->m_super->s_blocksize_bits - 9), > count_fsb << (mp->m_super->s_blocksize_bits - 9), > - GFP_NOFS, 0); > + GFP_KERNEL, 0); > } > > /* > diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c > index a09ffbbb0dda..de99368000b4 100644 > --- a/fs/xfs/xfs_buf.c > +++ b/fs/xfs/xfs_buf.c > @@ -190,7 +190,7 @@ xfs_buf_get_maps( > } > > bp->b_maps = kzalloc(map_count * sizeof(struct xfs_buf_map), > - GFP_NOFS | __GFP_NOFAIL); > + GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL); > if (!bp->b_maps) > return -ENOMEM; > return 0; > @@ -222,7 +222,8 @@ _xfs_buf_alloc( > int i; > > *bpp = NULL; > - bp = kmem_cache_zalloc(xfs_buf_cache, GFP_NOFS | __GFP_NOFAIL); > + bp = kmem_cache_zalloc(xfs_buf_cache, > + GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL); > > /* > * We don't want certain flags to appear in b_flags unless they are > @@ -325,7 +326,7 @@ xfs_buf_alloc_kmem( > struct xfs_buf *bp, > xfs_buf_flags_t flags) > { > - gfp_t gfp_mask = GFP_NOFS | __GFP_NOFAIL; > + gfp_t gfp_mask = GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL; > size_t size = BBTOB(bp->b_length); > > /* Assure zeroed buffer for non-read cases. */ > @@ -356,13 +357,11 @@ xfs_buf_alloc_pages( > struct xfs_buf *bp, > xfs_buf_flags_t flags) > { > - gfp_t gfp_mask = __GFP_NOWARN; > + gfp_t gfp_mask = GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOWARN; > long filled = 0; > > if (flags & XBF_READ_AHEAD) > gfp_mask |= __GFP_NORETRY; > - else > - gfp_mask |= GFP_NOFS; > > /* Make sure that we have a page list */ > bp->b_page_count = DIV_ROUND_UP(BBTOB(bp->b_length), PAGE_SIZE); > @@ -429,11 +428,18 @@ _xfs_buf_map_pages( > > /* > * vm_map_ram() will allocate auxiliary structures (e.g. > - * pagetables) with GFP_KERNEL, yet we are likely to be under > - * GFP_NOFS context here. Hence we need to tell memory reclaim > - * that we are in such a context via PF_MEMALLOC_NOFS to prevent > - * memory reclaim re-entering the filesystem here and > - * potentially deadlocking. > + * pagetables) with GFP_KERNEL, yet we often under a scoped nofs > + * context here. Mixing GFP_KERNEL with GFP_NOFS allocations > + * from the same call site that can be run from both above and > + * below memory reclaim causes lockdep false positives. Hence we > + * always need to force this allocation to nofs context because > + * we can't pass __GFP_NOLOCKDEP down to auxillary structures to > + * prevent false positive lockdep reports. > + * > + * XXX(dgc): I think dquot reclaim is the only place we can get > + * to this function from memory reclaim context now. If we fix > + * that like we've fixed inode reclaim to avoid writeback from > + * reclaim, this nofs wrapping can go away. > */ > nofs_flag = memalloc_nofs_save(); > do { > diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c > index ee39639bb92b..1f68569e62ca 100644 > --- a/fs/xfs/xfs_log.c > +++ b/fs/xfs/xfs_log.c > @@ -3518,7 +3518,8 @@ xlog_ticket_alloc( > struct xlog_ticket *tic; > int unit_res; > > - tic = kmem_cache_zalloc(xfs_log_ticket_cache, GFP_NOFS | __GFP_NOFAIL); > + tic = kmem_cache_zalloc(xfs_log_ticket_cache, > + GFP_KERNEL | __GFP_NOFAIL); > > unit_res = xlog_calc_unit_res(log, unit_bytes, &tic->t_iclog_hdrs); > > diff --git a/fs/xfs/xfs_mru_cache.c b/fs/xfs/xfs_mru_cache.c > index ce496704748d..7443debaffd6 100644 > --- a/fs/xfs/xfs_mru_cache.c > +++ b/fs/xfs/xfs_mru_cache.c > @@ -428,7 +428,7 @@ xfs_mru_cache_insert( > if (!mru || !mru->lists) > return -EINVAL; > > - if (radix_tree_preload(GFP_NOFS)) > + if (radix_tree_preload(GFP_KERNEL)) > return -ENOMEM; > > INIT_LIST_HEAD(&elem->list_node); > -- > 2.43.0 > >