From: Arjan van de Ven <arjan@infradead.org>
To: "Leonidas ." <leonidas137@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: GFP_NOWAIT and GFP_NOMEMALLOC
Date: Tue, 29 Sep 2009 14:37:29 +0200 [thread overview]
Message-ID: <20090929143729.5af8e1f8@infradead.org> (raw)
In-Reply-To: <f22d86810909290516l4cdda2bav3588cc5f7d1f2f65@mail.gmail.com>
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
next prev parent reply other threads:[~2009-09-29 12:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-29 11:25 GFP_NOWAIT and GFP_NOMEMALLOC Leonidas .
2009-09-29 11:59 ` Arjan van de Ven
2009-09-29 12:16 ` Leonidas .
2009-09-29 12:37 ` Arjan van de Ven [this message]
2009-09-29 12:43 ` Leonidas .
2009-10-04 18:56 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090929143729.5af8e1f8@infradead.org \
--to=arjan@infradead.org \
--cc=leonidas137@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox