From a5aa68744fedd307de08dd92f91ed6ace9df53d0 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Sun, 24 Sep 2017 21:13:36 +0900 Subject: [PATCH] hfi1: use kmalloc_cache for tid_rb_node allocations --- kernel/user_exp_rcv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/user_exp_rcv.c b/kernel/user_exp_rcv.c index 0daf517b..bb18b29e 100644 --- a/kernel/user_exp_rcv.c +++ b/kernel/user_exp_rcv.c @@ -342,6 +342,8 @@ static int program_rcvarray(struct hfi1_filedata *fd, uintptr_t phys, return count; } +struct kmalloc_cache_header tid_node_cache = { NULL }; + static int set_rcvarray_entry(struct hfi1_filedata *fd, uintptr_t phys, u32 rcventry, struct tid_group *grp, u16 order) @@ -354,7 +356,7 @@ static int set_rcvarray_entry(struct hfi1_filedata *fd, uintptr_t phys, * Allocate the node first so we can handle a potential * failure before we've programmed anything. */ - node = kcalloc(1, sizeof(*node), GFP_KERNEL); + node = kmalloc_cache_alloc(&tid_node_cache, sizeof(*node)); if (!node) return -ENOMEM;