<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 21, 2018 at 2:15 PM, Christian König <span dir="ltr"><<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><span class="">
    <div class="m_7651348995298833062moz-cite-prefix">Am 21.03.2018 um 19:04 schrieb Marek
      Olšák:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Wed, Mar 21, 2018 at 10:07 AM,
            Christian König <span dir="ltr"><<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF"><span>
                  <div class="m_7651348995298833062m_1741296731872194054moz-cite-prefix">Am
                    21.03.2018 um 14:57 schrieb Marek Olšák:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div class="gmail_extra">
                        <div class="gmail_quote">On Wed, Mar 21, 2018 at
                          4:13 AM, Christian König <span dir="ltr"><<a href="mailto:ckoenig.leichtzumerken@gmail.com" target="_blank">ckoenig.leichtzumerken@gmail.<wbr>com</a>></span>
                          wrote:<br>
                          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                            <div text="#000000" bgcolor="#FFFFFF"><span>
                                <div class="m_7651348995298833062m_1741296731872194054m_-1982752714132975532moz-cite-prefix">Am
                                  21.03.2018 um 06:08 schrieb Marek
                                  Olšák:<br>
                                </div>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div class="gmail_extra">
                                      <div class="gmail_quote">On Tue,
                                        Mar 20, 2018 at 4:16 PM,
                                        Christian König <span dir="ltr"><<a href="mailto:christian.koenig@amd.com" target="_blank">christian.koenig@amd.com</a>></span>
                                        wrote:<br>
                                        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                          <div text="#000000" bgcolor="#FFFFFF">
                                            <div class="m_7651348995298833062m_1741296731872194054m_-1982752714132975532m_4643584645760816653moz-cite-prefix">That's
                                              what I meant with use up
                                              the otherwise unused VRAM.
                                              I don't see any
                                              disadvantage of always
                                              setting GTT as second
                                              domain on APUs.<br>
                                              <br>
                                              My assumption was that we
                                              dropped this in userspace
                                              for displayable surfaces,
                                              but Marek proved that
                                              wrong.<br>
                                              <br>
                                              So what we should do is
                                              actually to add GTT as
                                              fallback to all BOs on
                                              APUs in Mesa and only make
                                              sure that the kernel is
                                              capable of handling GTT
                                              with optimal performance
                                              (e.g. have user huge pages
                                              etc..).<span class="m_7651348995298833062m_1741296731872194054m_-1982752714132975532HOEnZb"><font color="#888888"><br>
                                                </font></span></div>
                                          </div>
                                        </blockquote>
                                        <div><br>
                                        </div>
                                        <div>VRAM|GTT is practically as
                                          good as GTT. VRAM with BO
                                          priorities and eviction
                                          throttling is the true
                                          "VRAM|GTT".<br>
                                          <br>
                                        </div>
                                        <div>I don't know how else to
                                          make use of VRAM
                                          intelligently.</div>
                                      </div>
                                    </div>
                                  </div>
                                </blockquote>
                                <br>
                              </span> Well why not set VRAM|GTT as
                              default on APUs? That should still save
                              quite a bunch of moves even with
                              throttling.<br>
                            </div>
                          </blockquote>
                          <div><br>
                          </div>
                          <div>I explained why: <span class="m_7651348995298833062m_1741296731872194054gmail-">VRAM|GTT
                              is practically as good as GTT.</span><br>
                          </div>
                          <div> </div>
                          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                            <div text="#000000" bgcolor="#FFFFFF"> <br>
                              I mean there really shouldn't be any
                              advantage to use VRAM any more except that
                              we want to use it up as long as it is
                              available.<br>
                            </div>
                          </blockquote>
                          <div><br>
                          </div>
                          <div>Why are you suggesting to use VRAM|GTT
                            then? Let's just only use GTT on all APUs.</div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                  <br>
                </span> Then we don't use the memory stolen for VRAM.<br>
                <br>
                See we want to get to a point where we have any ~16MB of
                stolen VRAM on APUs and everything else in GTT.<br>
                <br>
                But we still have to support cases where we have 1GB
                stolen VRAM, and wasting those 1GB would suck a bit.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            BO priorities and BO move throttling should take care of
            optimal VRAM usage regardless of the VRAM size. We can
            adjust the throttling for small VRAM, but that's about all
            we can do.</div>
        </div>
      </div>
    </blockquote>
    <br></span>
    Well at least on APUs move throttling is complete nonsense. VRAM
    should expose the same performance as GTT.<br>
    <br>
    So the only usage we have for VRAM is for special cases like page
    tables and to allow to actually use the stolen memory.<span class=""><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">VRAM|GTT doesn't guarantee that VRAM
            will be used usefully. In fact, it doesn't guarantee
            anything about VRAM.<br>
          </div>
        </div>
      </div>
    </blockquote>
    <br></span>
    Why not? VRAM|GTT means that we should use VRAM as long as it is
    available and if it is used up fallback to GTT.<br>
    <br>
    When BOs are evicted from VRAM they are never moved back into it. As
    far as I can see that is exactly what we need on APUs.<br></div></blockquote><div><br></div>I see. You don't want to use VRAM usefully. You just want to fill it up with something (anything) so that it's not unused.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Marek<br></div></div></div>