From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Scott Fang <donnie.fang@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: Why do flush page cache twice when change TT's cache attribute
Date: Tue, 20 Mar 2012 11:33:39 -0400 [thread overview]
Message-ID: <20120320153339.GB29554@phenom.dumpdata.com> (raw)
In-Reply-To: <CAHcdkt9FDbbaBGJvK4JkYYQjXm=M_9izBgC2x0gBsNhpRBbAzA@mail.gmail.com>
On Tue, Mar 20, 2012 at 10:15:02AM +0800, Scott Fang wrote:
> 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?
So what are you trying to solve? I mean one way to fix this
is to do:
>
> 2012/3/20 Jerome Glisse <j.glisse@gmail.com>
>
> > 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);
goto 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;
> > > }
> > > }
> >
out:
> > > ttm->caching_state = c_state;
> > >
> > > return 0;
Is the problem with calling page change twice making the machine slow?
next prev parent reply other threads:[~2012-03-20 15:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 15:11 Why do flush page cache twice when change TT's cache attribute Scott Fang
2012-03-19 15:13 ` Scott Fang
2012-03-19 17:22 ` Jerome Glisse
2012-03-20 2:15 ` Scott Fang
2012-03-20 15:33 ` Konrad Rzeszutek Wilk [this message]
2012-03-21 1:37 ` Scott Fang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120320153339.GB29554@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=donnie.fang@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.