From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: 孙世龙 sunshilong <sunshilong369@gmail.com>
Cc: Kernelnewbies@kernelnewbies.org
Subject: Re: How do you comprehend the saying that the kernel's memory is not pageable whereas get_free_page use a page-oriented technique?
Date: Sat, 20 Jun 2020 05:11:21 -0400 [thread overview]
Message-ID: <546231.1592644281@turing-police> (raw)
In-Reply-To: <CAAvDm6ZrW04V8MX0QfxPvXOHHMnw9fF8GMeFsE66HLMLzCfbdA@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: Type: text/plain; charset=us-ascii, Size: 797 bytes --]
On Sat, 20 Jun 2020 14:18:21 +0800, 孙世龙 sunshilong said:
> Unfortunately for kernel developers, allocating memory in the kernel
> is not as simple as allocating memory in userspace. A number of
> factors contribute to the complication, among them:
> The kernel is limited to about 1GB of virtual and physical memory.
> **The kernel's memory is not pageable.**
> If a module needs to allocate big chunks of memory, it is usually
> better to use a page-oriented technique.
Due to memory fragmentation, if a module needs (say) 2M of
memory for an I/O buffer, it's more likely to be able to allocate
512 4K pages scattered through the 1GB of memory than it
is to get 1 contiguous chunk of memory.
The fact it's not pageable doesn't mean that pages aren't relevant
as the unit of allocation.
[-- 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-20 9:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-20 6:18 How do you comprehend the saying that the kernel's memory is not pageable whereas get_free_page use a page-oriented technique? 孙世龙 sunshilong
2020-06-20 9:11 ` Valdis Klētnieks [this message]
2020-06-20 9:39 ` 孙世龙 sunshilong
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=546231.1592644281@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.