Skip to content

Commit 0a73acb

Browse files
committed
slab: use 2M page for global_meta_slab
This permits to allocate more slabs, due to the static nature of global_meta_slab. This is a workaround, until global_meta_slab allocation is made fully dynamic. Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
1 parent 49aec5d commit 0a73acb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mm/slab.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,20 +244,20 @@ int init_slab(void) {
244244
memset(&meta_slab_list, 0, sizeof(meta_slab_list));
245245
memset(&global_meta_slab, 0, sizeof(global_meta_slab));
246246

247-
alloc_pages = get_free_pages(PAGE_ORDER_4K, GFP_KERNEL);
247+
alloc_pages = get_free_pages(PAGE_ORDER_2M, GFP_KERNEL);
248248
if (NULL == alloc_pages) {
249249
dprintk("get_free_pages failed\n");
250250
return -ENOMEM;
251251
}
252-
memset(alloc_pages, 0, PAGE_SIZE);
252+
memset(alloc_pages, 0, PAGE_SIZE_2M);
253253

254254
global_meta_slab.slab_base = alloc_pages;
255-
global_meta_slab.slab_len = PAGE_SIZE;
255+
global_meta_slab.slab_len = PAGE_SIZE_2M;
256256
global_meta_slab.slab_size = next_power_of_two(sizeof(meta_slab_t));
257257
ret = initialize_slab(&global_meta_slab);
258258
if (ret != ESUCCESS) {
259259
dprintk("initialize_slab failed\n");
260-
put_pages(alloc_pages, PAGE_ORDER_4K);
260+
put_pages(alloc_pages, PAGE_ORDER_2M);
261261
return ret;
262262
}
263263

0 commit comments

Comments
 (0)