<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    Am 03.11.23 um 05:04 schrieb Zeng, Oak:[SNIP]<span style="white-space: pre-wrap">
</span>
    <blockquote type="cite" cite="mid:SA1PR11MB69911CED830F657F608BC52392A5A@SA1PR11MB6991.namprd11.prod.outlook.com">
      <pre class="moz-quote-pre" wrap="">
I also want to have a more advanced iterator at some point where we grab
the BO lock for keeping a reference into the LRU list. Not sure how to
do this if we don't have the BO here any more.

Need to think about that further,
</pre>
      <pre class="moz-quote-pre" wrap="">
Don't quite get the what you want to do with the advanced iterator. But with this work, the lru entity is a base class of ttm_resource or any other resource struct in hmm/svm. Lru is decoupled from bo concept - this is why this lru can be shared with svm code which is bo-less.</pre>
    </blockquote>
    <br>
    This is just a crazy idea I had because TTM tends to perform bad on
    certain tasks.<br>
    <br>
    When we start to evict something we use a callback which indicates
    if an eviction is valuable or not. So it can happen that we have to
    skip quite a bunch of BOs on the LRU until we found one which is
    worth evicting.<br>
    <br>
    Not it can be that the first eviction doesn't make enough room to
    fulfill the allocation requirement, in this case we currently start
    over at the beginning searching for some BO to evict.<br>
    <br>
    I want to avoid this by being able to have cursors into the LRU,
    e.g. the next BO which can't move until we have evicted the current
    one.<br>
    <br>
    BTW: How do you handle eviction here? I mean we can't call the evict
    callback with the spinlock held easily?<br>
    <br>
    Christian.<br>
    <br>
    <blockquote type="cite" cite="mid:SA1PR11MB69911CED830F657F608BC52392A5A@SA1PR11MB6991.namprd11.prod.outlook.com">
      <pre class="moz-quote-pre" wrap="">

Oak 

</pre>
    </blockquote>
  </body>
</html>