Re: PROBLEM: Bug in __pollwait() can cause select() and poll() to hang in 2.4.22-pre2 -- second try

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Tue Jul 01 2003 - 00:08:37 EST


In message <Pine.LNX.4.44.0306302114170.2186-100000@home.osdl.org> you write:
>
> On Tue, 1 Jul 2003, Rusty Russell wrote:
> >
> > Linus? See thread below: poll_wait is called with task state !=
> > TASK_RUNNING, but can do a yield on low memory, causing eternal hangs.
>
> Hint: 2.5.x does not have this problem, because the yield() in 2.5.x isn't
> buggy.
>
> So the proper fix is to just fix yield() on 2.4.x.

Thanks Linus.

Um, Ray? 2.4's yield also does:

        void yield(void)
        {
                set_current_state(TASK_RUNNING);
                sys_sched_yield();
                schedule();
        }

So how did the below patch make any difference?

Now thoroughly confused,
Rusty.

--- linux-2.4.22-pre2.orig/mm/page_alloc.c Thu Nov 28 17:53:15 2002
+++ linux-2.4.22-pre2/mm/page_alloc.c Fri Jun 27 13:47:49 2003
@@ -418,6 +418,7 @@
                 return NULL;

         /* Yield for kswapd, and try again */
+ set_current_state(TASK_RUNNING);
         yield();
         goto rebalance;
  }

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 07 2003 - 22:00:12 EST