hfi1: use kmalloc_cache for tid_rb_node allocations

This commit is contained in:
Balazs Gerofi
2017-09-24 21:13:36 +09:00
parent 89c5aaa9e9
commit a5aa68744f

View File

@ -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;