diff options
author | 2019-07-24 17:00:06 +0100 | |
---|---|---|
committer | 2019-07-24 17:00:06 +0100 | |
commit | 27988c96687667e74df1a9a3b8662519bc1c29c9 (patch) | |
tree | 0aa67d365e8d544bf48a4de9ae94d7f8536de073 /lib/xarray.c | |
parent | regulator: axp20x: fix DCDC5 and DCDC6 for AXP803 (diff) | |
parent | Linus 5.3-rc1 (diff) | |
download | wireguard-linux-27988c96687667e74df1a9a3b8662519bc1c29c9.tar.xz wireguard-linux-27988c96687667e74df1a9a3b8662519bc1c29c9.zip |
Merge tag 'v5.3-rc1' into regulator-5.3
Linus 5.3-rc1
Diffstat (limited to 'lib/xarray.c')
-rw-r--r-- | lib/xarray.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/xarray.c b/lib/xarray.c index 6be3acbb861f..446b956c9188 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -298,6 +298,8 @@ bool xas_nomem(struct xa_state *xas, gfp_t gfp) xas_destroy(xas); return false; } + if (xas->xa->xa_flags & XA_FLAGS_ACCOUNT) + gfp |= __GFP_ACCOUNT; xas->xa_alloc = kmem_cache_alloc(radix_tree_node_cachep, gfp); if (!xas->xa_alloc) return false; @@ -325,6 +327,8 @@ static bool __xas_nomem(struct xa_state *xas, gfp_t gfp) xas_destroy(xas); return false; } + if (xas->xa->xa_flags & XA_FLAGS_ACCOUNT) + gfp |= __GFP_ACCOUNT; if (gfpflags_allow_blocking(gfp)) { xas_unlock_type(xas, lock_type); xas->xa_alloc = kmem_cache_alloc(radix_tree_node_cachep, gfp); @@ -358,8 +362,12 @@ static void *xas_alloc(struct xa_state *xas, unsigned int shift) if (node) { xas->xa_alloc = NULL; } else { - node = kmem_cache_alloc(radix_tree_node_cachep, - GFP_NOWAIT | __GFP_NOWARN); + gfp_t gfp = GFP_NOWAIT | __GFP_NOWARN; + + if (xas->xa->xa_flags & XA_FLAGS_ACCOUNT) + gfp |= __GFP_ACCOUNT; + + node = kmem_cache_alloc(radix_tree_node_cachep, gfp); if (!node) { xas_set_err(xas, -ENOMEM); return NULL; |