From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: 孙世龙 <sunshilong369@gmail.com>
Cc: Kernelnewbies@kernelnewbies.org
Subject: Re: Why does “page allocation failure” occur whereas there are still “58*4096kB (C)” could be used?
Date: Fri, 19 Jun 2020 00:48:35 -0400 [thread overview]
Message-ID: <459330.1592542115@turing-police> (raw)
In-Reply-To: <CAAvDm6YhTfJusHQ-L+varm_AHciqn4hq-ONW-8w3Yc4Xp49qkA@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: Type: text/plain; charset=us-ascii, Size: 1346 bytes --]
On Thu, 18 Jun 2020 14:21:05 +0800, 孙世龙 said:
> Why does "page allocation failure" occur whereas there are still "58*4096kB
> (C)"(*I think it indicates there are 58 order 10 memory could be used*)
> could be used?
>
> Here is the related log:
>
> [ 2161.623563] xxxx: page allocation failure: order:10,
> mode:0x2084020(GFP_ATOMIC|__GFP_COMP)
Most likely, the allocation wanted some other type of allocation.
The (C) on the order-10 says it's an CMA area.
static const char types[MIGRATE_TYPES] = {
[MIGRATE_UNMOVABLE] = 'U',
[MIGRATE_MOVABLE] = 'M',
[MIGRATE_RECLAIMABLE] = 'E',
[MIGRATE_HIGHATOMIC] = 'H',
#ifdef CONFIG_CMA
[MIGRATE_CMA] = 'C',
#endif
#ifdef CONFIG_MEMORY_ISOLATION
[MIGRATE_ISOLATE] = 'I',
#endif
If the call was for an unmovable, movable, reclaimable, or highatomic
allocation, you lose.
If you look at the source for alloc_ap_req(), you find it wants GFP_ATOMIC, not
CMA. And your box is fresh out of contiguous order-10 spaces that aren't CMA,
and you're down to your last 3 order-9 flagged as (UEC).
I admit I find it a tad suspicious that the USB gadget driver asks for a 4M
chunk of memory. Does USB actually support single transfers that large? (I'm
not a USB expert)
[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2020-06-19 4:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 6:21 Why does “page allocation failure” occur whereas there are still “58*4096kB (C)” could be used? 孙世龙
2020-06-19 4:48 ` Valdis Klētnieks [this message]
2020-06-19 6:56 ` 孙世龙 sunshilong
2020-06-19 7:14 ` Valdis Klētnieks
2020-06-20 5:53 ` 孙世龙 sunshilong
2020-06-20 9:51 ` Valdis Klētnieks
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=459330.1592542115@turing-police \
--to=valdis.kletnieks@vt.edu \
--cc=Kernelnewbies@kernelnewbies.org \
--cc=sunshilong369@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).