Messages in this thread | | | Date | Sun, 03 Nov 2002 12:21:55 -0800 | From | Andrew Morton <> | Subject | Re: Hot/cold allocation -- swsusp can not handle hot pages |
| |
Pavel Machek wrote: > > ... > "big-picture" should be in Documentation/swsusp.txt... > > *Should* be :-(. I need to copy all used memory, to make sure my > snapshot is atomic. > > Copying works by looking at what is allocated, counting needed pages, > allocating 'directory' for them, allocating memory for copies, and > actually copying.
Ah. I see.
> When I suddenly find I have less data to copy than I thought, it > screws up the code.
Having a less-than-expected amount to copy sounds like it can be safely handled?
> > I'm not really sure what to suggest here. Emptying the per-cpu > > page pools would be tricky. Maybe a swsusp-special page allocator > > which goes direct to the buddy lists or something. > > Well, see the patch above. That seems to do the trick for > me. It seems that even "cold" allocation can give page from per-cpu > pool. I thought that was a bug?
There are two queues per cpu. cache-warm pages and cache-cold pages. The cold queue is mainly for lock amortisation, to avoid taking the zone lock once per page. But we can also allocate from the cold queue for situations where we'll be invalidating the cache anyway (file readahead). We don't want to waste cache-hot pages. Your change breaks that. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |