Skip to contentSkip to conversation

Getting the page fault count for domU

DISCUSSION Chintu 3 participants 9 messages Sep 28, 2011 – Oct 3, 2011

lore
Share & tools
lore
#1 lore raw

I am thinking of doing something like

1) Add a field "unsigned long page_fault_count" to struct domain defined in in xen/sched.h

2) Increment this counter mem_paging_domctl(...) defined in arch/x_86/mm/mem_paging.c for
case XEN_DOMCTL_MEM_EVENT_OP_PAGING_EVICT

I will then access this information is available from within struct vcpu->domain->page_fault_count.

Please correct me if my chain of thought is wrong or if it is too simplistic.
Looking forward to your valuable comments

thanks
Chintamani

--
View this message in context: http://xen.1045712.n5.nabble.com/Getting-the-page-fault-count-for-domU-tp4847541p4853794.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

#2 lore raw

I'm assuming you're talking about faults through the paging mechanism.

The page fault handling is all done in dom0 user-space, so the number of faults for a particular vCPU for a given period in time can be easily tracked by the daemon without modifying hypervisor code. When a vCPU faults (i.e. trys to access a page that is currently paged out), it will be paused -- so it's not possible for the vCPU to accrue additional page faults until the userspace daemon handles the first one. I'm not sure what your use-case is, but there's probably a better way of sharing this information with other user-space tools than through an additional field in struct domain.

Cheers,
-Adin

Quoted 30 lines · Chintamani Siddeshwar

I am thinking of doing something like

1) Add a field "unsigned long page_fault_count" to struct domain defined in in xen/sched.h

2) Increment this counter mem_paging_domctl(...) defined in arch/x_86/mm/mem_paging.c for
              case XEN_DOMCTL_MEM_EVENT_OP_PAGING_EVICT

I will then access this information is available from within struct vcpu->domain->page_fault_count.

Please correct me if my chain of thought is wrong or if it is too simplistic.
Looking forward to your valuable comments

   thanks
Chintamani

--
View this message in context: http://xen.1045712.n5.nabble.com/Getting-the-page-fault-count-for-domU-tp4847541p4853794.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Thanks a lot Adin.

Can you please tell me, which daemon should I look for?
I am trying to see whether it makes sense to include this page-fault count while scheduling guests (vcpus), to achieve better performance isolation among guests. That is why I am interested in changing XEN's code - If the code changes that I suggested wont work, can you please suggest me any alternatives? That will be really helpful.

thanks
Chintamani

--
View this message in context: http://xen.1045712.n5.nabble.com/Getting-the-page-fault-count-for-domU-tp4847541p4861071.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

#4 lore raw

Hi,

Quoted 5 lines · Chintamani Siddeshwar

I am trying to see whether it makes sense to include this page-fault count while scheduling guests (vcpus), to achieve better performance isolation among guests. That is why I am interested in changing XEN's code - If the code changes that I suggested wont work, can you please suggest me any alternatives? That will be really helpful.

Are you looking to count:
- page faults in the guest (that would have happened on a real server);
- page faults caused by the hypervisor (i.e. due to shadow pagetables); or
- page faults caused by Xen tools paging the guest memory to disk?

Or something else? Not all pagefaults are easy to count, by the way.

Tim.

#5 lore raw

I am interested in counting the number of page-faults in the guest - page-faults that result in a disk I/O.
Also when would XEN tools page a guest memory to disk? Is it a manual process (by running "xenpaging" command) or is it a performance enhancement added in recent versions of XEN?

I am looking forward to your valuable comments/suggestions.

thanks
Chintamani

--
View this message in context: http://xen.1045712.n5.nabble.com/Getting-the-page-fault-count-for-domU-tp4847541p4864887.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

#6 lore raw
Quoted 2 lines · Chintamani Siddeshwar

I am interested in counting the number of page-faults in the guest - page-faults that result in a disk I/O.

You will have to do that from inside the guest - only the guest's OS knows which of its page-faults result in I/O, and on modern (EPT/RVI) hardware, Xen doesn't even see most guest page-faults.

Quoted 3 lines

Also when would XEN tools page a guest memory to disk? Is it a manual process (by running "xenpaging" command) or is it a performance enhancement added in recent versions of XEN?

Only when the xenpaging daemon is running. It is definitely not a performance enhancement (memory pressure is better dealt with by the guest) but is useful as a backstop if you're overcommitting memory some other way.

Tim.

#7 lore raw

Okay.
Is it possible to get this info from within Dom0, because Dom0 handles disk paging.
Would it help to look at the backend dd's or the xend?

thanks
Chintamani

Quoted 26 lines · On Mon, Oct 3, 2011 at 8:44 AM, Tim Deegan-6 [via Xen] <…
Quoted 2 lines · Chintamani Siddeshwar

I am interested in counting the number of page-faults in the guest - page-faults that result in a disk I/O.

You will have to do that from inside the guest - only the guest's OS knows which of its page-faults result in I/O, and on modern (EPT/RVI) hardware, Xen doesn't even see most guest page-faults.

Quoted 2 lines

Also when would XEN tools page a guest memory to disk? Is it a manual process (by running "xenpaging" command) or is it a performance

enhancement

Quoted 1 line

added in recent versions of XEN?

Only when the xenpaging daemon is running. It is definitely not a performance enhancement (memory pressure is better dealt with by the guest) but is useful as a backstop if you're overcommitting memory some other way.

Tim.

_______________________________________________
Xen-devel mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=4864909&i=0>
http://lists.xensource.com/xen-devel

Quoted 8 lines

------------------------------
If you reply to this email, your message will be added to the discussion
below:

http://xen.1045712.n5.nabble.com/Getting-the-page-fault-count-for-domU-tp4847541p4864909.html
To unsubscribe from Getting the page fault count for domU, click here<http://xen.1045712.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4847541&code=Y2hpbnRhbWFuaS5zaWRAZ21haWwuY29tfDQ4NDc1NDF8MTYwNDQ2Nzc4MQ==>.

--
View this message in context: http://xen.1045712.n5.nabble.com/Getting-the-page-fault-count-for-domU-tp4847541p4864950.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#8 lore raw

Please don't top-post.

Quoted 3 lines · Chintamani Siddeshwar

Okay.
Is it possible to get this info from within Dom0, because Dom0 handles disk paging.

Not unless dom0 can figure out which parts of the guest's disk I/O is paging and which not. In some OSes that might be easier than others, but it will always need knowledge of the guest OS internals and configuration.

Tim.

Quoted 22 lines
Quoted 19 lines · On Mon, Oct 3, 2011 at 8:44 AM, Tim Deegan-6 [via Xen] <…
Quoted 2 lines · Chintamani Siddeshwar

I am interested in counting the number of page-faults in the guest - page-faults that result in a disk I/O.

You will have to do that from inside the guest - only the guest's OS knows which of its page-faults result in I/O, and on modern (EPT/RVI) hardware, Xen doesn't even see most guest page-faults.

Quoted 2 lines

Also when would XEN tools page a guest memory to disk? Is it a manual process (by running "xenpaging" command) or is it a performance

enhancement

Quoted 1 line

added in recent versions of XEN?

Only when the xenpaging daemon is running. It is definitely not a performance enhancement (memory pressure is better dealt with by the guest) but is useful as a backstop if you're overcommitting memory some other way.

Tim.