* What's the advantage of Writable pagetable?
@ 2004-10-09 8:30 Chengyuan Li
2004-10-09 9:11 ` Keir Fraser
0 siblings, 1 reply; 6+ messages in thread
From: Chengyuan Li @ 2004-10-09 8:30 UTC (permalink / raw)
To: Xen-devel
Hi,
Before writable pagetable is enabled, XenLinux use Hypercall to update
PTE. After the writable pagetable is enabled, it depends on page fault
to update PTE. What's the advantage then?
Thanks,
Chengyuan
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What's the advantage of Writable pagetable?
2004-10-09 8:30 What's the advantage of Writable pagetable? Chengyuan Li
@ 2004-10-09 9:11 ` Keir Fraser
2004-10-10 2:44 ` Chengyuan Li
0 siblings, 1 reply; 6+ messages in thread
From: Keir Fraser @ 2004-10-09 9:11 UTC (permalink / raw)
To: Chengyuan Li; +Cc: Xen-devel
Advantages are that update snaturally get batched, rather than needong
to be explicitly maintainbed in a queue and then explicitly
flushed. The flushes are a problem in Linux 2.4 because they are
needed in various places in the generic VM code, to avoid races where
the kernel reads a PTE that it has just written, but where the update
is still buffered in in the update queue.
A further advantage is that atomic read-modify-write instructions will
trivially work correctly with writable page tables. e.g., when we
support SMP guests they will wish to 'CMPXCHG' the contents of a PTE
to zero them while notg racing against updates of accessed/dirty bits
by another CPU. Using the old interface with explicit batching. we
would have to add a new kind of update command to support each kind of
atomic instruction!
-- Keir
> Hi,
>
> Before writable pagetable is enabled, XenLinux use Hypercall to update
> PTE. After the writable pagetable is enabled, it depends on page fault
> to update PTE. What's the advantage then?
>
>
> Thanks,
> Chengyuan
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What's the advantage of Writable pagetable?
2004-10-09 9:11 ` Keir Fraser
@ 2004-10-10 2:44 ` Chengyuan Li
2004-10-10 12:00 ` Mark A. Williamson
0 siblings, 1 reply; 6+ messages in thread
From: Chengyuan Li @ 2004-10-10 2:44 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
As the queue is canceled, it seems that the performance will decline. Right?
On Sat, 09 Oct 2004 10:11:26 +0100, Keir Fraser
<keir.fraser@cl.cam.ac.uk> wrote:
>
> Advantages are that update snaturally get batched, rather than needong
> to be explicitly maintainbed in a queue and then explicitly
> flushed. The flushes are a problem in Linux 2.4 because they are
> needed in various places in the generic VM code, to avoid races where
> the kernel reads a PTE that it has just written, but where the update
> is still buffered in in the update queue.
>
> A further advantage is that atomic read-modify-write instructions will
> trivially work correctly with writable page tables. e.g., when we
> support SMP guests they will wish to 'CMPXCHG' the contents of a PTE
> to zero them while notg racing against updates of accessed/dirty bits
> by another CPU. Using the old interface with explicit batching. we
> would have to add a new kind of update command to support each kind of
> atomic instruction!
>
> -- Keir
>
>
>
>
> > Hi,
> >
> > Before writable pagetable is enabled, XenLinux use Hypercall to update
> > PTE. After the writable pagetable is enabled, it depends on page fault
> > to update PTE. What's the advantage then?
> >
> >
> > Thanks,
> > Chengyuan
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> > Use IT products in your business? Tell us what you think of them. Give us
> > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> > http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/xen-devel
>
>
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What's the advantage of Writable pagetable?
2004-10-10 2:44 ` Chengyuan Li
@ 2004-10-10 12:00 ` Mark A. Williamson
2004-10-11 3:04 ` Chengyuan Li
0 siblings, 1 reply; 6+ messages in thread
From: Mark A. Williamson @ 2004-10-10 12:00 UTC (permalink / raw)
To: xen-devel, Chengyuan Li; +Cc: Keir Fraser
> As the queue is canceled, it seems that the performance will decline.
> Right?
Writeable pagetable performance is (I believe) comparable to the old batching
interface.
Basically, when a guest tries to write to a page table entry, Xen removes that
node from the page tables and makes it writeable. The guest can then write
to it as much as it wants but when it tries to actually *use* that part of
the page table (i.e. access a page corresponsing to one of its entries)
another fault occurs and Xen validates the node before returning it (assuming
it's valid) to the page tables.
Because the page table node is removed from the table and made writeable, only
the first change requires a fault. The node is only restored when it is
needed, at which point you would have needed a flush anyway in the old
system. This ensures good batching happens but it is always safe.
The end result is pretty much the same performance but the batching happens
implicitly without the guest having to worry about it. This makes porting
simpler, requires less source code changes and hopefully less tedious
debugging of guest memory management ;-)
HTH,
Mark
> On Sat, 09 Oct 2004 10:11:26 +0100, Keir Fraser
>
> <keir.fraser@cl.cam.ac.uk> wrote:
> > Advantages are that update snaturally get batched, rather than needong
> > to be explicitly maintainbed in a queue and then explicitly
> > flushed. The flushes are a problem in Linux 2.4 because they are
> > needed in various places in the generic VM code, to avoid races where
> > the kernel reads a PTE that it has just written, but where the update
> > is still buffered in in the update queue.
> >
> > A further advantage is that atomic read-modify-write instructions will
> > trivially work correctly with writable page tables. e.g., when we
> > support SMP guests they will wish to 'CMPXCHG' the contents of a PTE
> > to zero them while notg racing against updates of accessed/dirty bits
> > by another CPU. Using the old interface with explicit batching. we
> > would have to add a new kind of update command to support each kind of
> > atomic instruction!
> >
> > -- Keir
> >
> > > Hi,
> > >
> > > Before writable pagetable is enabled, XenLinux use Hypercall to update
> > > PTE. After the writable pagetable is enabled, it depends on page fault
> > > to update PTE. What's the advantage then?
> > >
> > >
> > > Thanks,
> > > Chengyuan
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: IT Product Guide on
> > > ITManagersJournal Use IT products in your business? Tell us what you
> > > think of them. Give us Your Opinions, Get Free ThinkGeek Gift
> > > Certificates! Click to find out more
> > > http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/xen-devel
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: What's the advantage of Writable pagetable?
2004-10-10 12:00 ` Mark A. Williamson
@ 2004-10-11 3:04 ` Chengyuan Li
0 siblings, 0 replies; 6+ messages in thread
From: Chengyuan Li @ 2004-10-11 3:04 UTC (permalink / raw)
To: mark.williamson; +Cc: xen-devel, Keir Fraser, Ian Pratt
I misundstand the writable pagetable mechanism before.
According to your and Ian's explication, I think the performance
wouldn't be affected much.
Could you please tell me where can I obtain some papers that describe
the writable pagetable? Thanks in advance!
Chengyuan
On Sun, 10 Oct 2004 13:00:57 +0100, Mark A. Williamson
<mark.williamson@cl.cam.ac.uk> wrote:
> > As the queue is canceled, it seems that the performance will decline.
> > Right?
>
> Writeable pagetable performance is (I believe) comparable to the old batching
> interface.
>
> Basically, when a guest tries to write to a page table entry, Xen removes that
> node from the page tables and makes it writeable. The guest can then write
> to it as much as it wants but when it tries to actually *use* that part of
> the page table (i.e. access a page corresponsing to one of its entries)
> another fault occurs and Xen validates the node before returning it (assuming
> it's valid) to the page tables.
>
> Because the page table node is removed from the table and made writeable, only
> the first change requires a fault. The node is only restored when it is
> needed, at which point you would have needed a flush anyway in the old
> system. This ensures good batching happens but it is always safe.
>
> The end result is pretty much the same performance but the batching happens
> implicitly without the guest having to worry about it. This makes porting
> simpler, requires less source code changes and hopefully less tedious
> debugging of guest memory management ;-)
>
> HTH,
> Mark
>
>
>
> > On Sat, 09 Oct 2004 10:11:26 +0100, Keir Fraser
> >
> > <keir.fraser@cl.cam.ac.uk> wrote:
> > > Advantages are that update snaturally get batched, rather than needong
> > > to be explicitly maintainbed in a queue and then explicitly
> > > flushed. The flushes are a problem in Linux 2.4 because they are
> > > needed in various places in the generic VM code, to avoid races where
> > > the kernel reads a PTE that it has just written, but where the update
> > > is still buffered in in the update queue.
> > >
> > > A further advantage is that atomic read-modify-write instructions will
> > > trivially work correctly with writable page tables. e.g., when we
> > > support SMP guests they will wish to 'CMPXCHG' the contents of a PTE
> > > to zero them while notg racing against updates of accessed/dirty bits
> > > by another CPU. Using the old interface with explicit batching. we
> > > would have to add a new kind of update command to support each kind of
> > > atomic instruction!
> > >
> > > -- Keir
> > >
> > > > Hi,
> > > >
> > > > Before writable pagetable is enabled, XenLinux use Hypercall to update
> > > > PTE. After the writable pagetable is enabled, it depends on page fault
> > > > to update PTE. What's the advantage then?
> > > >
> > > >
> > > > Thanks,
> > > > Chengyuan
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.net email is sponsored by: IT Product Guide on
> > > > ITManagersJournal Use IT products in your business? Tell us what you
> > > > think of them. Give us Your Opinions, Get Free ThinkGeek Gift
> > > > Certificates! Click to find out more
> > > > http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > > > _______________________________________________
> > > > Xen-devel mailing list
> > > > Xen-devel@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/xen-devel
> >
> > -------------------------------------------------------
>
>
> > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> > Use IT products in your business? Tell us what you think of them. Give us
> > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> > http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/xen-devel
>
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: What's the advantage of Writable pagetable?
@ 2004-10-10 8:49 Ian Pratt
0 siblings, 0 replies; 6+ messages in thread
From: Ian Pratt @ 2004-10-10 8:49 UTC (permalink / raw)
To: Chengyuan Li, Keir Fraser; +Cc: xen-devel
> As the queue is canceled, it seems that the performance will decline.
Right?
No -- when a pagetable page is 'unhooked' the guest can write to it
freely without incurring further faults. We validate all the entries and
re-hook the page either when a TLB flush occurs, or when we detect a
page fault on the area of VA space the page maps.
The performance is very similar to the batched interface used in 2.4,
but its less invasive to the guest OS an will make SMP guests easier.
Ian
On Sat, 09 Oct 2004 10:11:26 +0100, Keir Fraser
<keir.fraser@cl.cam.ac.uk> wrote:
>
> Advantages are that update snaturally get batched, rather than needong
> to be explicitly maintainbed in a queue and then explicitly flushed.
> The flushes are a problem in Linux 2.4 because they are needed in
> various places in the generic VM code, to avoid races where the kernel
> reads a PTE that it has just written, but where the update is still
> buffered in in the update queue.
>
> A further advantage is that atomic read-modify-write instructions will
> trivially work correctly with writable page tables. e.g., when we
> support SMP guests they will wish to 'CMPXCHG' the contents of a PTE
> to zero them while notg racing against updates of accessed/dirty bits
> by another CPU. Using the old interface with explicit batching. we
> would have to add a new kind of update command to support each kind of
> atomic instruction!
>
> -- Keir
>
>
>
>
> > Hi,
> >
> > Before writable pagetable is enabled, XenLinux use Hypercall to
> > update PTE. After the writable pagetable is enabled, it depends on
> > page fault to update PTE. What's the advantage then?
> >
> >
> > Thanks,
> > Chengyuan
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: IT Product Guide on
> > ITManagersJournal Use IT products in your business? Tell us what you
> > think of them. Give us Your Opinions, Get Free ThinkGeek Gift
> > Certificates! Click to find out more
> > http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/xen-devel
>
>
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give
us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find
out more http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-devel
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-10-11 3:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-09 8:30 What's the advantage of Writable pagetable? Chengyuan Li
2004-10-09 9:11 ` Keir Fraser
2004-10-10 2:44 ` Chengyuan Li
2004-10-10 12:00 ` Mark A. Williamson
2004-10-11 3:04 ` Chengyuan Li
-- strict thread matches above, loose matches on Subject: below --
2004-10-10 8:49 Ian Pratt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.