[lkml]   [1999]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: SCSI access creating lost time
On Sun, 7 Mar 1999, Doug Ledford wrote:

>The races include do_scsi_cmnd() vs. scsi_done() vs. scsi_times_out().

The harm is not the locking overkill, but instead the fact that during the
locked-atomic region we have the cpu __cli()ed.

And the _only_ reason we need the cpu clied in order to do the locking
safe, is that all places are currently looping infinitely on their lock
(in this case a -spin-lock) and not always-taking a fail-safe path.

I think instead that all places that could run in a irq handler should do:

struct semaphore scsi_sem = MUTEX;

if (down_trylock(&scsi_sem))
/* lock held */

and places that can be recalled only from normal kernel context (I
think none in the scsi code though ;) should do:

/* Critical section */

That way we would _never_ need the cpu clied.


Andrea Arcangeli

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:50    [W:0.030 / U:0.504 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site