Skip to contentSkip to conversation

How to allocate hugepage in kernel module?

DISCUSSION J.Hwan Kim 3 participants 4 messages Aug 9, 2012 – Aug 10, 2012

lore
Share & tools
lore

J.Hwan Kim

author
#0 lore raw

Hi, everyone

How can I allocate physically contiguous huge page in kernel module ? The routine of _get_fee_pages() fails whenever there are much free memory in system.

I found the procedures for set hugepages with sysctl or /proc/sys/vm/nr_hugepages
but I've not found the api for allocate the huge page in kernel.

Thanks in advnace.

Best Regards,
J.Hwan Kim

#1 lore raw

Forgot to CC kernelnewbies:

Did you pass the __GFP_COMP flag to __get_free_pages?

Quoted 22 lines · J.Hwan Kim

Hi, everyone

How can I allocate physically contiguous huge page in kernel module ? The routine of _get_fee_pages() fails whenever there are much free memory in system.

I found the procedures for set hugepages with sysctl or /proc/sys/vm/nr_hugepages
but I've not found the api for allocate the huge page in kernel.

Thanks in advnace.

Best Regards,
J.Hwan Kim

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Signature · 2 lines
Regards,
Denis
author
#2 lore raw

I set the __GFP_COMP flag to __get_free_pages(),
but the result was same.

2012? 08? 09? 17:59, Denis Kirjanov ? ?:

Quoted 29 lines

Forgot to CC kernelnewbies:

Did you pass the __GFP_COMP flag to __get_free_pages?

Quoted 22 lines · J.Hwan Kim

Hi, everyone

How can I allocate physically contiguous huge page in kernel module ? The routine of _get_fee_pages() fails whenever there are much free memory in system.

I found the procedures for set hugepages with sysctl or /proc/sys/vm/nr_hugepages
but I've not found the api for allocate the huge page in kernel.

Thanks in advnace.

Best Regards,
J.Hwan Kim

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

#3 lore raw
Quoted 2 lines · J.Hwan Kim

I set the __GFP_COMP flag to __get_free_pages(),
but the result was same.

Does this help?
sourd/core/memalloc.c +170

Quoted 36 lines

2012? 08? 09? 17:59, Denis Kirjanov ? ?:

Quoted 29 lines

Forgot to CC kernelnewbies:

Did you pass the __GFP_COMP flag to __get_free_pages?

Quoted 22 lines · J.Hwan Kim

Hi, everyone

How can I allocate physically contiguous huge page in kernel module ? The routine of _get_fee_pages() fails whenever there are much free memory in system.

I found the procedures for set hugepages with sysctl or /proc/sys/vm/nr_hugepages
but I've not found the api for allocate the huge page in kernel.

Thanks in advnace.

Best Regards,
J.Hwan Kim

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies