Re: [PATCH] scsi_lib.c: continue after MEDIUM_ERROR



On Thu, 2007-02-01 at 15:02 -0500, Mark Lord wrote:
I believe you made the first change in response to my prodding at the time,
when libata was not returning valid sense data (no LBA) for media errors.
The SCSI EH handling of that was rather poor at the time,
and so having it not retry the remaining sectors was actually
a very good fix at the time.

But now, libata *does* return valid sense data for LBA/DMA drives,
and the workaround from circa 2.6.16 is no longer the best we can do.
Now that we know which sector failed, we ought to be able to skip
over it, and continue with the rest of the merged request.

We can ... the big concern with your approach, which you haven't
addressed is the time factor. For most SCSI devices, returning a fatal
MEDIUM ERROR means we're out of remapping table, and also that there's
probably a bunch of sectors on the track that are now out. Thus, there
are almost always multiple sector failures. In linux, the average
request size on a filesystem is around 64-128kb; thats 128-256 sectors.
If we fail at the initial sector, we have to go through another 128-256
attempts, with the internal device retries, before we fail the entire
request. Some devices can take a second or so for each read before they
finally give up and decide they really can't read the sector, so you're
looking at 2-5 minutes before the machine finally fails this one
request ... and much worse for devices that retry more times.

One thing that could be even better than the patch below,
would be to have it perhaps skip the entire bio that includes
the failed sector, rather than only the bad sector itself.

Er ... define "skip over the bio". A bio is simply a block
representation for a bunch of sg elements coming in to the elevator.
Mostly what we see in SCSI is a single bio per request, so skipping the
bio is really the current behaviour (to fail the rest of the request).

I think doing that might address most concerns expressed here.
Have you got an alternate suggestion, James?

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [Q] Bio traversal trouble?
    ... unable to handle kernel paging request at virtual address 8c1d2071 ... Since the last time this driver was posted it changed considerably and as one of the chances it's now requesting just one hardware sector at a time from the drive as requesting multiple didn't actually work -- I seemed to have fouled up earlier tests somehow. ... I'd also simply like to understand it, so this is doing a manual bio traversal, requesting frames from the hardware as it goes along. ...
    (Linux-Kernel)
  • Re: [PATCH] scsi_lib.c: continue after MEDIUM_ERROR
    ... The SCSI EH handling of that was rather poor at the time, ... Now that we know which sector failed, we ought to be able to skip ... request size on a filesystem is around 64-128kb; ... If we fail at the initial sector, we have to go through another 128-256 ...
    (Linux-Kernel)
  • Re: [PATCH] scsi_lib.c: continue after MEDIUM_ERROR
    ... James Bottomley wrote: ... the failed sector, rather than only the bad sector itself. ... bio is really the current behaviour (to fail the rest of the request). ...
    (Linux-Kernel)
  • Re: Overagressive failing of disk reads, both LIBATA and IDE
    ... and returns success for sectors up to that point. ... but so does SCSI without your patch ... ... Each separate request that's merged gets a separate bio, ...
    (Linux-Kernel)
  • Re: about TRIM/DISCARD support and barriers
    ... I just mean writes _to the same sector_. ... My main worry is that this will add considerable overhead to request ... For the rbtree based sorting, we'd have to do a rb_next/rb_prev ... overlap checking if one of the requests is a discard. ...
    (Linux-Kernel)