linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* how to tell which pages were allocated from kernel?
@ 2002-07-31  0:12 Nathan Friess
  0 siblings, 0 replies; only message in thread
From: Nathan Friess @ 2002-07-31  0:12 UTC (permalink / raw)
  To: linux-mm

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-07-31  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-31  0:12 how to tell which pages were allocated from kernel? Nathan Friess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox