From: Nathan Friess <natmanz@shaw.ca>
To: linux-mm@kvack.org
Subject: how to tell which pages were allocated from kernel?
Date: Tue, 30 Jul 2002 18:12:56 -0600 [thread overview]
Message-ID: <000901c23827$05604370$0201010a@W800> (raw)
Please CC to me, as I'm not subscribed to the list.
Short version:
I know how to see a list of all memory pages in the variable mem_map, but
how do I tell which pages are allocated for the kernel, and which pages are
allocated for user space processes?
Long version:
I recently learned about a project (patch) that gives the linux kernel the
ability to suspend to disk. I'm planning to make some changes to see if I
can improve it's performance on my laptop. I've looked through the code and
relevent protions of the kernel, and googled for some help, but I still
don't seem to have all of the information I'm looking for. In particular,
currently the suspending code just allocates a new page for every existing
one, and copies every existing page to a newly allocated page, then writes
all of the newly allocated pages to swap. As a result, the suspend requires
that at least 1/2 of the physical RAM is free, so these temporary pages can
be allocated in RAM before writing to swap.
If there is some way that I could tell which pages belong to user space
processes, then I could write those pages directly to swap without copying
them. So, how would I find out where they came from? I don't see any field
in the page struct to indicate this, although I did notice that there is a
#define called GFP_USER which I believe is passed to the alloc functions
when the kernel allocates space on behalf of a user process. If need be, I
might try to add something so that I could keep track of the pages, like add
a field to the page struct.
Sorry if this seems trivial, but I figure I can spend more hours searching
the web and mm code, or I can just ask the experts directly.
Thanks,
Nathan Friess
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/
reply other threads:[~2002-07-31 0:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='000901c23827$05604370$0201010a@W800' \
--to=natmanz@shaw.ca \
--cc=linux-mm@kvack.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