Skip to contentSkip to conversation

Meaning of PG_foreign

DISCUSSION Jacob Gorm Hansen 2 participants 4 messages Oct 6, 2006

lore
Share & tools
lore
#0 lore raw

hi,

can I count on all pages in a domU that are changed by Xen, backend drivers, or writable pagetable magic, being marked as PG_foreign?

thanks,
Jacob

#1 lore raw
Quoted 2 lines · Jacob Gorm Hansen

can I count on all pages in a domU that are changed by Xen, backend drivers, or writable pagetable magic, being marked as PG_foreign?

I'm not sure what you mean by 'changed'. But I expect you misunderstand the meaning of PG_foreign anyway. What it means is 'foreign' from the point-of-view of Linux's buddy allocator -- i.e., it is a page that actually comes from a different allocator, which is wanting to hook off of free_pages(). It doesn't (necessarily) mean that the page is actually from a foreign virtual machine.

-- Keir

#2 lore raw
Quoted 11 lines · Keir Fraser
Quoted 2 lines · Jacob Gorm Hansen

can I count on all pages in a domU that are changed by Xen, backend drivers, or writable pagetable magic, being marked as PG_foreign?

I'm not sure what you mean by 'changed'. But I expect you misunderstand the meaning of PG_foreign anyway. What it means is 'foreign' from the point-of-view of Linux's buddy allocator -- i.e., it is a page that actually comes from a different allocator, which is wanting to hook off of free_pages(). It doesn't (necessarily) mean that the page is actually from a foreign virtual machine.

I had a problem with self-checkpoint consistency -- page contents would change without my knowledge (I would get no page faults, and the pages did not seem to come from netfront or blkfront drivers), and I 'solved' that in a very ugly way by looping through all pages and explicitly checkpointing those with the PG_foreign bit set.

The offending pages looked like page tables, they would be all zero, and then a single entry would somehow sneak in without warning, even though I was taking care to flush all writable pagetable actions before taking the checkpoint.

This is in -testing, perhaps I should try -unstable, where writable page tables are rumoured to have gone away.

Jacob

#3 lore raw
Quoted 2 lines · Jacob Gorm Hansen

This is in -testing, perhaps I should try -unstable, where writable page tables are rumoured to have gone away.

Yes, the batching stuff is all gone. It's all done by synchronous emulation now.

-- Keir