Re: patch: MAX_READAHEAD and 2.0.13 wake_up() misfunction (fwd)

Sergey Ya. Korshunoff (root@p5.f434.n5020.z2.fidonet.org)
Fri, 23 Aug 1996 09:36:52 +0100


Hello!
I don't found my and Linus messages in the kernel mail archive at
linux.ucs.indiana.edu. There is no messages from 11 Aug
to 19 Aug. There was some problems?
Then I repeat some info.

Many Linux CD-ROM drivers incorrect use sleep_on()
function. This include cm206, aztcd, cdu31a, mcd,
mcdx, optcd, sjcd, sonycd535. Why? Because
task may be already on wait queue _before_ do_BLKDRV_request
and driver may be waked up by an external (outside from
driver) wake_up call. In first place this lead to wrong
delay functioning (less delays than driver request). Follow
is the answer from Linus to my mail.

PS: there was no problems in 1.2.13 kernel, problem
was exposed by incrementing MAX_READAHEAD in 1.3.96 kernel.

Regards,
Sergey Korshunoff

---------- Forwarded message ----------
Date: Mon, 19 Aug 96 08:48:11 +0400
From:torvalds@cs.Helsinki.FI
To: Sergey Ya Korshunoff <Sergey.Ya.Korshunoff@p5.f434.n5020.z2.fidonet.org>
Subject: Re: patch: MAX_READAHEAD and 2.0.13 wake_up() misfunction

Received: by mp.aha.ru id NAA11539;
(8.6.11/vak/1.8e) Mon, 19 Aug 1996 13:20:03 +0400
Received: from f128.n50.z2.fidonet.org by aha.msk.su
with FTN (ifmail v.2.8c) id AA11535; Mon, 19 Aug 96 13:20:03 +0400
From: Linus Torvalds <torvalds@cs.Helsinki.FI>
Reply-To: torvalds@cs.Helsinki.FI
Cc: alan@cymru.net, dleeuwe@linux01.gwdg.de, linux-kernel@vger.rutgers.edu

On Sun, 18 Aug 1996, Sergey Korshunoff wrote:
>
> Hello!
> With following patch cm206.c work with 2.0.13 as good as with 1.2.13.
> Patched kernel work fine without problems with:

Looking at the patch, the only thing it does is to make the kernel less
efficient, and avoid having a process on the wait-list for some things
during calls to "run_task_queue()".

It looks like the _real_ bug is in the cm206 driver: instead of always
assuming that it gets woken up by interrupts, it should generally use
something like this:

while (not_ready)
sleep_on(&wait_for_ready);

The above is the correct way to do things like this.

Linus