#1275 closed defect (fixed)

ATA driver disables task preemption during busy-wait

Reported by: strauman Owned by: Joel Sherrill
Priority: normal Milestone: 4.9
Component: fs Version: 4.7
Severity: major Keywords:
Cc: strauman@…, thomas.doerfler@…, chrisj@… Blocked By:
Blocking:

Description

The ATA driver (libchip/ide/ata.c)
uses (the IMHO very bad practice) of protecting
a critical section by disabling preemption.

This is aggravated by the fact that the critical
section in question here contains a few loops
where the driver busy-waits for the device
to become ready.

I propose to introduce a mutex for protecting
the critical section so that using ATA has
minimal impact on the response time of other
tasks.

(Sidenote: while this is a relatively easy fix
the 'bdbuf' buffer cache implementation suffers
from the same problem (even though critical
sections there are more deterministic))


I strongly discourage the use of disk I/O
(libblock/bdbuf/ata/ide) while real-time critical
tasks execute.

Change History (2)

comment:1 Changed on Jan 10, 2008 at 10:04:51 PM by strauman

Cc: strauman added
Severity: criticalmajor

comment:2 Changed on Aug 6, 2008 at 3:43:14 AM by Chris Johns

Cc: Chris Johns added
Resolution: fixed
Status: newclosed

Added mutex protection rather than disable pre-emption.

Note: See TracTickets for help on using tickets.