Hi,
At 23:35 +0800 on 08 Mar (1331249756), peng yang wrote:> I wonder if shadow 2 is supported in Xen 3.1.
Yes.
> This is important because only shadow 2 emulated every write to guest
> pagetables. If so, I can count the exact number of pages belong to a
> process and calculate the memory usage of every process.
Sadly, not. Shadow 2 emulates all writes to _shadowed_ pagetables, but
there''s no guarantee that all pagetables will be shadowed. Pagetables
that haven''t been used by the guest yet won''t be shadowed yet.
Also,
there''s only a finite amount of shadow memory, so less-recently-used
pagetables get un-shadowed to make room. (A related problem is that Xen
can''t always tell when a page has stopped being a pagetable, so just
because it''s shadowed doesn''t meen it''s definitely a
pagetable).
> Besides, I wonder once this counting number drops to zero, can I absolutely
> assume that the process exits.
No, for the same reason.
Cheers,
Tim.