Re: How to allocate hugepage in kernel module?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
You can try by passing the flag GFP_KERNEL to __get_free_pages(). 
Eg: __get_free_pages(GFP_KERNEL,9)  where "9" represents -  Order of 9; means requesting for 2^9(=512) contiguous pages in virtual address space
         in order to allocate 2MB of contiguous memory.


Thanks & Regards
Murali 



-----Original Message-----
From: kernelnewbies-bounces@xxxxxxxxxxxxxxxxx [mailto:kernelnewbies-bounces@xxxxxxxxxxxxxxxxx] On Behalf Of kernelnewbies-request@xxxxxxxxxxxxxxxxx
Sent: Friday, August 10, 2012 9:30 PM
To: kernelnewbies@xxxxxxxxxxxxxxxxx
Subject: Kernelnewbies Digest, Vol 21, Issue 13

Send Kernelnewbies mailing list submissions to
	kernelnewbies@xxxxxxxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
or, via email, send a message with subject or body 'help' to
	kernelnewbies-request@xxxxxxxxxxxxxxxxx

You can reach the person managing the list at
	kernelnewbies-owner@xxxxxxxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific than "Re: Contents of Kernelnewbies digest..."


Today's Topics:

   1. Re: How to allocate hugepage in kernel module? (J.Hwan Kim)
   2. Re: How to allocate hugepage in kernel module? (anish kumar)


----------------------------------------------------------------------

Message: 1
Date: Fri, 10 Aug 2012 09:00:12 +0900
From: "J.Hwan Kim" <frog1120@xxxxxxxxx>
Subject: Re: How to allocate hugepage in kernel module?
To: Denis Kirjanov <kirjanov@xxxxxxxxx>
Cc: kernelnewbies@xxxxxxxxxxxxxxxxx
Message-ID: <50244F0C.90109@xxxxxxxxx>
Content-Type: text/plain; charset=UTF-8; format=flowed

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

2012? 08? 09? 17:59, Denis Kirjanov ? ?:
> Forgot to CC kernelnewbies:
>
> Did you pass the __GFP_COMP flag to __get_free_pages?
>
>
> On 8/9/12, J.Hwan Kim<frog1120@xxxxxxxxx>  wrote:
>> 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@xxxxxxxxxxxxxxxxx
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>




------------------------------

Message: 2
Date: Thu, 09 Aug 2012 20:18:02 -0700
From: anish kumar <anish198519851985@xxxxxxxxx>
Subject: Re: How to allocate hugepage in kernel module?
To: "J.Hwan Kim" <frog1120@xxxxxxxxx>
Cc: Denis Kirjanov <kirjanov@xxxxxxxxx>,
	kernelnewbies@xxxxxxxxxxxxxxxxx
Message-ID: <1344568682.1532.30.camel@anish-Inspiron-N5050>
Content-Type: text/plain; charset="UTF-8"

On Fri, 2012-08-10 at 09:00 +0900, J.Hwan Kim wrote:
> I set the __GFP_COMP flag to __get_free_pages(), but the result was 
> same.

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

> 2012? 08? 09? 17:59, Denis Kirjanov ? ?:
> > Forgot to CC kernelnewbies:
> >
> > Did you pass the __GFP_COMP flag to __get_free_pages?
> >
> >
> > On 8/9/12, J.Hwan Kim<frog1120@xxxxxxxxx>  wrote:
> >> 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@xxxxxxxxxxxxxxxxx
> >> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >>
> >
> 
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies





------------------------------

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


End of Kernelnewbies Digest, Vol 21, Issue 13
*********************************************


::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------


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


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux