2005-01-07 00:28:34

by Nishanth Aravamudan

[permalink] [raw]
Subject: FW: [KJ] ftape/fdc-io: schedule_timeout() usage

I haven't had any replies so far, and it was suggested that I also fish on LKML
for input.

Thanks,
Nish

----- Forwarded message from Nishanth Aravamudan <[email protected]> -----

Date: Wed, 5 Jan 2005 16:14:00 -0800
From: Nishanth Aravamudan <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [KJ] ftape/fdc-io: schedule_timeout() usage

Hello,

I'm hoping someone here can help me correct some ftape code.
drivers/char/ftape/lowlevel/fdc-io.c::fdc_interrupt_wait() contains the
following code:

set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue((&ftape_wait_intr, &wait);
while (!ft_interrupt_seen && (current->state == TASK_INTERRUPTIBLE)) {
timeout = schedule_timeout(timeout);
}

The problem I have is that after the first iteration of the loop
(schedule_timeout() with TASK_INTERRUPTIBLE), it will become a busy-wait, as
schedule_timeout() will be running with current->state set to TASK_RUNNING. I'm
not sure if this is desired, but it seems weird to me. Any input would be
appreciated.

-Nish

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors


----- End forwarded message -----