Messages in this thread | | | Date | Fri, 28 Jan 2005 09:18:14 +0100 | From | Jens Axboe <> | Subject | Re: [PATCH] scsi/sata write barrier support |
| |
On Fri, Jan 28 2005, Jeff Garzik wrote: > Jens Axboe wrote: > >On Thu, Jan 27 2005, Jeff Garzik wrote: > > > >>Doug Maxey wrote: > >> > >>>On Thu, 27 Jan 2005 13:02:48 +0100, Jens Axboe wrote: > >>> > >>> > >>>>Hi, > >>>> > >>>>For the longest time, only the old PATA drivers supported barrier writes > >>>>with journalled file systems. This patch adds support for the same type > >>>>of cache flushing barriers that PATA uses for SCSI, to be utilized with > >>>>libata. > >>> > >>> > >>>What, if any mechanism supports changing the underlying write cache? > >>> > >>>That is, assuming this is common across PATA and SCSI drives, and it is > >>>possible to turn the cache off on the IDE drives, would switching the > >>>cache underneath require completing the inflight IO? > >> > >>[ignoring your question, but it made me think...] > >> > >> > >>I am thinking the barrier support should know if the write cache is > >>disabled (some datacenters do this), and avoid flushing if so? > > > > > >Ehm it does, read the code :) > > > I did. I see nowhere that handles the case where the user uses a util > (hdparm or blktool) to switch off write cache after sd.c has probed the > disk. sd only sets its WCE bit at probe time, and doesn't appear to > notice state changes.
WCE bit should change then, like ->wcache does for ide. It's handled inside sd, there's nothing more it can do. sd_shutdown() and sd_issue_flush() have the same issue, they all rely on ->WCE being correct.
Can't say I'm too fond of command snooping, but I guess it's the only solution.
> Since nobody snoops the MODE SELECT on the caching page, nobody knows > past probe the state of write caching. > > Thus my comment... I think barrier support should know about that sort > of thing :)
So this would mainly be a problem if you boot with write caching disabled, but later turn it on. The other way around will still work safely, at the cost of two noop commands on each write barrier (which I doubt you would notice).
-- Jens Axboe
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |