Re: can a malloc be *both* GFP_KERNEL and GFP_ATOMIC?

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

 



On Mon, 26 Mar 2007, Pharaoh . wrote:

> On 3/25/07, Robert P. J. Day <rpjday@xxxxxxxxxxxxxx> wrote:
> >
> >   from everything i'd ever read, i was under the impression that a
> > memory allocation might be GFP_KERNEL or GFP_ATOMIC, but not both.
> > however, there are at least a couple calls in the kernel where both of
> > those flags are used simultaneously.  does that make sense?
> >
> > rday

> Yes.

could you expand on that just a little?  given that my copy of LDD3
says things like, "GFP_KERNEL isn't always the right allocation flag
to use ... use a flag of GFP_ATOMIC instead" and "usually either
GFP_KERNEL or GFP_ATOMIC is used" and that the definition of those two
flags on p. 214 of that same book states:

  GFP_ATOMIC: ... Never sleeps.

  GFP_KERNEL: ... May sleep.

everything implies *strongly* that those two flags are mutually
exclusive, so saying "Yes." as your entire response to my question is
somewhat less than enlightening.

rday

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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