Re: [RFC] Arch option to touch newly allocated pages

Alan Cox
2002-03-03T23:34:45Z

> I don't have individual little map requests going on here. I have a single
> large map happening at boot time which creates the UML "physical" memory
> area.

Doesn't matter

> So, say I have a 128M UML which is only ever going to use 32M of that. If
> there isn't 128M of address space, but there is 32M, this UML will never
> get off the ground, even though it really deserved to.

Well thats up to you on how you implement it. mmap will tell you the truth
in overcommit mode 2 or 3. Nothing will get killed off when you try and
mmap too much or dirty pages you have.

> About the swap allocation, I'd bet essentially all the time when a page
> is allocated, its dirtiness is imminent anyway. So, I'm not adding anything

Nothing of the sort. Sitting in a gnome desktop I'm showing a 41200Kb worst
case swap requirement, but it appears under half of that is used.

> to swap. It'll be there a usec later anyway. What I want is for the dirtying
> to happen in a controlled place where something sane can be done if the page
> isn't really there.

Like randomly killing another process off ? If you want to dirty the pages
pray and catch the sigbus then see memset(3). If you want to be told "sorry
you can't have that" and write a simple loop to pick a good memory size,
you need the address space accounting.

Alan