Re: [patch 1/9] Guest page hinting: unused / free pages.
From: Martin Schwidefsky <hidden>
Date: 2006-09-13 12:45:40
Also in:
lkml
On Wed, 2006-09-13 at 08:06 -0400, Hubertus Franke wrote:
Martin Schwidefsky wrote:quoted
On Tue, 2006-09-12 at 21:29 -0400, Rik van Riel wrote:quoted
Note that the transition _to_ volatile can also be batched and done somewhat lazily. For frequently mmaped pages that could end up saving us the transition the other way, too...That would be helpful, only how to do it? We need some sort of list or array where to store the pages that should be made volatile. The main problem that I see is that you have to remove a page that is freed from the list/array again, otherwise you would end up with a non page-cache page being made volatile. That makes using per-cpu arrays hard since a page can be freed on another cpu.Martin. the point was that pages which are in the hold/cold lists are technically free. However we keep them stable. When the hot/cold list is spilled back to the buddy allocator we make them volatile in buld (i.e. through the array).
You mean unused.
So we only build the array for the duration of the bulk-release to the buddy allocator (and potentially the other way as well). Hence there is no "state" to maintain or track for the array. Pages in the hot/cold lists remain stable. This would not any of the problems you described as long as we hold the lock for the hot/cold list during buld-volatile.
I was not talking about free pages, and I don't think Rik was either. The idea is to be lazy about the make-volatile calls. Put the pages for which a make-volatile call should be done to some array/list and do a bulk make-volatile. These pages are still in the page/swap cache. The trouble is we have to be sure these pages have not been freed in the meantime. The bulk set-unused/set-stable to the buddy allocator should not be to problematic. We just have to find new places where to do the calls. -- blue skies, Martin. Martin Schwidefsky Linux for zSeries Development & Services IBM Deutschland Entwicklung GmbH "Reality continues to ruin my life." - Calvin.