lkml.org 
[lkml]   [2009]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: GFP_NOWAIT and GFP_NOMEMALLOC
From
On Tue, Sep 29, 2009 at 6:07 PM, Arjan van de Ven <arjan@infradead.org> wrote:
> On Tue, 29 Sep 2009 17:46:35 +0530
> "Leonidas ." <leonidas137@gmail.com> wrote:
>>
>> The module is going to be a profiling module and the user module which
>> is under profiling
>> will call the apis which I am exporting. My apis will collect certain
>> data from point
>
> (I assume you are aware of 'perf' and such)
>
>
>> But frankly, I am not very familiar with Linux kernel apis yet hence
>> have resorted to
>> using a tree data structure for the first cut where I allocate memory
>> as needed depending on the context I am executing in. To optimize a
>> bit, I do not free my memory
>> till some threshold is reached.
>>
>> Some questions here:
>>
>> 1. GFP_NOWAIT as in kmalloc(size, GFP_KERNEL | GFPNOWAIT)?
>>
>> or
>>
>> kmalloc(size, GFP_NOWAIT), I know this one is a dumb one.
>
> don't do GFP_KERNEL |
>
> because that makes it basically equivalent to GFP_KERNEL, which is a
> sleeping version.
>
>>
>> 2. Any reference for the mempool kind of implementation mentioned
>> above?
>
> there's mm/mempool.c..
>
> as a general suggestion I would say "look at perf, and see if you can
> build on that, or borrow from it"...
>
>
> --
> Arjan van de Ven        Intel Open Source Technology Centre
> For development, discussion and tips for power savings,
> visit http://www.lesswatts.org
>

I will have a look at perf. Thanks for the inputs.

-Leo.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-09-29 14:47    [W:0.058 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site