[haiku-commits] Re: r40277 - haiku/trunk/src/system/kernel/vm

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 24 Jan 2011 14:37:03 +0100

Am 24.01.2011 13:41, schrieb Ingo Weinhold:

On 2011-01-24 at 08:56:39 [+0100], Stephan Aßmus<superstippi@xxxxxx>  wrote:
Am 24.01.2011 00:12, schrieb anevilyak@xxxxxxxxx:
Modified: haiku/trunk/src/system/kernel/vm/vm.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm.cpp    2011-01-23 23:00:15 UTC
(rev 40276)
+++ haiku/trunk/src/system/kernel/vm/vm.cpp    2011-01-23 23:12:26 UTC
(rev 40277)
@@ -4090,13 +4090,8 @@

           lastCache = cache;

-        for (;;) {
-            page = cache->LookupPage(context.cacheOffset);
-            if (page == NULL || !page->busy) {
-                // Either there is no page or there is one and it is not
busy.
-                break;
-            }
-
+        page = cache->LookupPage(context.cacheOffset);
+        if (page != NULL&&   page->busy) {
               // page must be busy -- wait for it to become unbusy
               context.UnlockAll(cache);
               cache->ReleaseRefLocked();

I looked at the diff with more context, and I am wondering whether the
"return B_OK" was intentional, rather than restarting the loop...

The loop was a left-over. Since all caches are unlocked the whole page fault
handler must be restarted, which the "context.restart = true" is initiating.

Thanks for clarifying!

Best regards,
-Stephan


Other related posts: