Meanwhile, set_memory_uc/wc doesn't only do flush page cache, but also change page table attribute, so your solution seems to have some problem.
2012/3/20 Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
On Tue, Mar 20, 2012 at 10:15:02AM +0800, Scott Fang wrote:So what are you trying to solve? I mean one way to fix this
> Can I do the optimization like:
>
> if (ttm->caching_state == tt_cached)
> - drm_clflush_pages(ttm->pages, ttm->num_pages);
> + for (i = 0; i < ttm->num_pages; ++i)
> + if (PageHighMem(ttm->pages[i]))
> + drm_clflush_pages(&ttm->pages[i], 1);
>
> only do flush cache when high memory and leave the linear memory flush in
> function set_memory_uc/wc?
is to do:
>goto out;
> 2012/3/20 Jerome Glisse <j.glisse@xxxxxxxxx>
>
> > On Mon, 2012-03-19 at 23:11 +0800, Scott Fang wrote:
> > > In function ttm_tt_set_caching
> > > ,,,,,,,
> > >
> > > if (ttm->caching_state == tt_cached)
> > > drm_clflush_pages(ttm->pages, ttm->num_pages);
> > >out:
> > > for (i = 0; i < ttm->num_pages; ++i) {
> > > cur_page = ttm->pages[i];
> > > if (likely(cur_page != NULL)) {
> > > ret = ttm_tt_set_page_caching(cur_page,
> > > ttm->caching_state,
> > > c_state);
> > > if (unlikely(ret != 0))
> > > goto out_err;
> > > }
> > > }
> >
> > > ttm->caching_state = c_state;Is the problem with calling page change twice making the machine slow?
> > >
> > > return 0;
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel