On 11/27/05, Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote:
> On Sun, 2005-11-27 at 14:06 -0500, Timothy Miller wrote:
>
> > > The "mark pages read-only" trick would work, but I have no idea if that's
> > > feasible (especially when the source data for the texture image is in
> > > shared memory).
> >
> > It also depends on the OS.  A BSD may have an easy way to do this,
> > while Linux doesn't.  I don't know.  But perhaps we can piggyback on
> > the CoW mechanism used by fork().
>
> It's fairly easy to do such tricks on linux, especially recnet kernels
> have a helper to deal with the necessary PTE invalidates that need to
> happen.
>
> For the Cell support, we implement a similar mecanism where the local
> store of the SPUs & some registers can be mapped into user processes.
> When an SPU is context switched, this gets copied to a memory based
> local store and the mappings are invalidates and "redirected" to that
> memory store.

You know, I didn't think about this until just now.  I was thinking
about locking the pages and then blocking if there's a write.  But I
wonder... we could set up CoW so that if the process tries to write to
a page of a texture that is in the process of being uploaded, the page
gets copied, the copy assigned to the process, and the original gets
freed when the upload is done.  This is a compromise between up-front
copying and blocking until the copy is done, because not all of it
will necessarily get copied.  The various performance impacts will
have to be considered.

_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to