mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
NFS: Fix memory allocation in rpc_alloc_task()
As for rpc_malloc(), we first try allocating from the slab, then fall back to a non-waiting allocation from the mempool. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
33e5c765bc
commit
910ad38697
1 changed files with 7 additions and 3 deletions
|
@ -1108,10 +1108,14 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta
|
||||||
rpc_init_task_statistics(task);
|
rpc_init_task_statistics(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct rpc_task *
|
static struct rpc_task *rpc_alloc_task(void)
|
||||||
rpc_alloc_task(void)
|
|
||||||
{
|
{
|
||||||
return (struct rpc_task *)mempool_alloc(rpc_task_mempool, GFP_KERNEL);
|
struct rpc_task *task;
|
||||||
|
|
||||||
|
task = kmem_cache_alloc(rpc_task_slabp, rpc_task_gfp_mask());
|
||||||
|
if (task)
|
||||||
|
return task;
|
||||||
|
return mempool_alloc(rpc_task_mempool, GFP_NOWAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue