File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,17 @@ struct msg_msgseg {
42
42
#define DATALEN_MSG ((size_t)PAGE_SIZE-sizeof(struct msg_msg))
43
43
#define DATALEN_SEG ((size_t)PAGE_SIZE-sizeof(struct msg_msgseg))
44
44
45
+ static kmem_buckets * msg_buckets __ro_after_init ;
46
+
47
+ static int __init init_msg_buckets (void )
48
+ {
49
+ msg_buckets = kmem_buckets_create ("msg_msg" , SLAB_ACCOUNT ,
50
+ sizeof (struct msg_msg ),
51
+ DATALEN_MSG , NULL );
52
+
53
+ return 0 ;
54
+ }
55
+ subsys_initcall (init_msg_buckets );
45
56
46
57
static struct msg_msg * alloc_msg (size_t len )
47
58
{
@@ -50,7 +61,7 @@ static struct msg_msg *alloc_msg(size_t len)
50
61
size_t alen ;
51
62
52
63
alen = min (len , DATALEN_MSG );
53
- msg = kmalloc ( sizeof (* msg ) + alen , GFP_KERNEL_ACCOUNT );
64
+ msg = kmem_buckets_alloc ( msg_buckets , sizeof (* msg ) + alen , GFP_KERNEL );
54
65
if (msg == NULL )
55
66
return NULL ;
56
67
You can’t perform that action at this time.
0 commit comments