From: Roland Dreier <roland@topspin.com>
To: Michael Hines <mhines@cs.fsu.edu>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: can you switch between GFP_ATOMIC and GFP_KERNEL?
Date: Fri, 31 Dec 2004 20:16:48 -0800 [thread overview]
Message-ID: <523bxlaimn.fsf@topspin.com> (raw)
In-Reply-To: <Pine.GSO.4.33.0412312259160.28251-100000@diablo.cs.fsu.edu> (Michael Hines's message of "Fri, 31 Dec 2004 23:04:58 -0500 (EST)")
Michael> My question is, new sk_buffs are always allocated with
Michael> GFP_KERNEL and can be swapped out. Is it possible to
Michael> change the allocation status of already-allocated memory
Michael> to GFP_ATOMIC on the fly? (i.e. both the slab-cache
Michael> sk_buff header memory as well as the kmalloc'd data
Michael> area).
This question is ill-posed -- kernel memory can never be swapped out,
whether it's allocated with GFP_KERNEL or GFP_ATOMIC. The difference
between GFP_KERNEL and GFP_ATOMIC is whether the actual allocation can
sleep, that is:
foo = kmalloc(sizeof foo, GFP_ATOMIC); /* will not sleep */
foo = kmalloc(sizeof foo, GFP_KERNEL); /* can sleep */
However, whichever gfp flags are used to allocate memory, the memory
is the same once the allocation is done. Neither kmalloc'ed memory
nor sk_buffs will ever be swapped.
- Roland
next prev parent reply other threads:[~2005-01-01 4:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-01 4:04 Michael Hines
2005-01-01 4:16 ` Roland Dreier [this message]
2005-01-01 4:21 ` Michael Hines
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=523bxlaimn.fsf@topspin.com \
--to=roland@topspin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhines@cs.fsu.edu \
/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
all inboxes | Powered by JetHome®