When working with the MM subsystem, 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,
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, but if possible, I'm looking for some way around
adding my own flags.
Are there any good books on the MM subsystem?
Thanks,
Natman
Perhaps of some help
"Natman" <n...@where.com> wrote in message
news:Kql69.138253$v53.7...@news3.calgary.shaw.ca...