All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Glisse <j.glisse@gmail.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: Mon, 19 Mar 2012 13:22:16 -0400	[thread overview]
Message-ID: <1332177736.2986.3.camel@localhost.localdomain> (raw)
In-Reply-To: <CAHcdkt-B6kk2BmwRNT0C5o6VGNZPnT6e+v54CVc+5xVm2cw5cA@mail.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);
> 
>     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;
> 
>     return 0;
> 
> 
> drm_clflush_pages flush cache one time.
> then in the following function
> ttm_tt_set_page_caching->set_memory_wc->change_page_attr_set: in this
> function may flush page cache again.
> 
> Does the code do some abundant flush, or there is some trick to these
> codes?
> 
> Thanks for the answer in advance.

Yes there might be redundant flushing.

Cheers,
Jerome

  parent reply	other threads:[~2012-03-19 17:22 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 [this message]
2012-03-20  2:15   ` Scott Fang
2012-03-20 15:33     ` Konrad Rzeszutek Wilk
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=1332177736.2986.3.camel@localhost.localdomain \
    --to=j.glisse@gmail.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.