From 50fafa6d71fc43514e09cb190fa3e7fb505cd6ba Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Thu, 21 Sep 2017 16:32:59 +0900 Subject: [PATCH] hfi1/user_exp_rcv/setup: use cache_alloc for tidlist --- kernel/user_exp_rcv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/user_exp_rcv.c b/kernel/user_exp_rcv.c index d5ba1100..839bb8e8 100644 --- a/kernel/user_exp_rcv.c +++ b/kernel/user_exp_rcv.c @@ -73,6 +73,7 @@ struct tid_rb_node { struct tid_group *grp; }; +struct kmalloc_cache_header tidlist_cache = { NULL }; /* * RcvArray entry allocation for Expected Receives is done by the @@ -98,8 +99,8 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, struct hfi1_tid_info *tinf return -EINVAL; } - tidlist = kmalloc(sizeof(*tidlist)*uctxt->expected_count, - IHK_MC_AP_NOWAIT); + tidlist = kmalloc_cache_alloc(&tidlist_cache, + sizeof(*tidlist) * uctxt->expected_count); if (!tidlist) return -ENOMEM; @@ -198,7 +199,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, struct hfi1_tid_info *tinf } } - kfree(tidlist); + kmalloc_cache_free(tidlist); return ret > 0 ? 0 : ret; }