Re: RE: hw.ata.wc hw.ata.tags softupdates short question
So, to boil everything down, I have 1 question: On a workstation LAPTOP (IDE, low load, etc), does it make more sense to use softupdates, write caching, or both? jm -- My other computer is your windows box. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-stable in the body of the message
Re: hw.ata.wc hw.ata.tags softupdates short question
Date: Fri, 21 Sep 2001 12:18:32 +0930 (CST) From: Daniel O'Connor [EMAIL PROTECTED] Sender: [EMAIL PROTECTED] On 20-Sep-2001 Nuno Teixeira wrote: For what I heard, I concluded that we shouldn't use softupdates with write cache turned on. The first time that I tried this I loose a lot of work due to a power failure. You shouldn't use write caching, period. Well you can but if you lose power you WILL lose data. If you just want speed and care naught about your data go ahead :) (I guess a UPS would increase your confidence) 1. Can I use softupdates with hw.ata.wc=1 and hw.ata.tags=1 safely? 2. Does hw.ata.tags=1 allows write caching to be safely turned on really? No, write caching tells the drive Please lie to me about command completion so when the OS performs a write the drive caches it and says yes that's on disk, when it isn't. OK. I've seen some questionable information in this thread and some that I'm almost sure is simply wrong. I'm going to describe the situation as I understand it and if you are SURE something I say is wrong, please correct it. (Especially if you write disk drivers for FreeBSD. I have written disk drivers, but not in FreeBSD and not for ATA disks, so am not really competent.) 1. IBM drives that do tagging are claimed to be safe. The way tagging works should assure that the critical metadata is always written to disk. And tagging depends on write cache to work, but you don't need to turn it on as turning on tagging DOES turn on write cache as it is used by tagging and attempting to turn it on with the hw.ata.wc sysctl is meaningless and ignored. 2. On a disk that has a lot of writes like a news server is especially susceptible to data loss. If a system is not UPS protected and running software to shutdown cleanly before the UPS dies, write cache on a server is with ATA disks is probably a bad idea. But then again, ATA disks on a server are probably a bad idea. 3. The combination of soft updates and WC is especially risky as you might lose both the last bit of data written to disk, but metadata that can lead to a major corruption. Even then, it's reasonably unlikely, but I don't think reasonably unlikely is reasonable. 4. Some disks always write data (eventually). Some NEVER write out data that is re-written frequently. It's just about impossible to tell which a drive does and the only documentation is the drive's micro-code which you are very unlikely to ever see and less likely to understand unless you write disk code. (I have a friend who does and it is about as opaque a bunch of C++ as I have ever seen unless you REALLY understand disk design.) 5. Many disks seem to make NO attempt to write the data on power outage. I run with WC on my laptop because it's extremely unlikely to lose power. But I also back up the disk (dd mirroring) on a regular basis just in case. It's also worth noting that Soren reversed himself and made wc default a few months after 4.3 was released. I assume it defaults to on in 4.4, although I have not checked. This makes me suspect that he decided that the risk was reasonable. But I really should not speak for him. R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: [EMAIL PROTECTED] Phone: +1 510 486-8634 To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-stable in the body of the message
RE: hw.ata.wc hw.ata.tags softupdates short question
Daniel O'Connor [EMAIL PROTECTED] types: On 20-Sep-2001 Nuno Teixeira wrote: For what I heard, I concluded that we shouldn't use softupdates with write cache turned on. The first time that I tried this I loose a lot of work due to a power failure. You shouldn't use write caching, period. Matt Dillon disagrees. From the tuning(7) man page: There is a new experimental feature for IDE hard drives called hw.ata.tags (you also set this in the bootloader) which allows write caching to be safely turned on. This brings SCSI tagging features to IDE drives. In other words, write caching is safe if the drive and driver supports tagged queuing. For IDE drives, Matt goes on to say: As of this writing only IBM DPTA and DTLA drives support the feature. Warning! These drives apparently have quality control problems and I do not recommend purchasing them at this time. If you need performance, go with SCSI. No, write caching tells the drive Please lie to me about command completion so when the OS performs a write the drive caches it and says yes that's on disk, when it isn't. Tagged queuing allows the writes to complete in a different order than they were issued. This allows the drives to both have an effective write cache, *and* to notify the controller when sectors are actually on the disk. Kevin Oberman [EMAIL PROTECTED] types: 1. IBM drives that do tagging are claimed to be safe. The way tagging works should assure that the critical metadata is always written to disk. To clarify, it isn't the drive that knows about critical metadata. That's softupdates doing it's job. Softupdates has to trust the drive to make sure the critical metadata is on the disk. This is why write caching sans tagged queuing and softupdates are such a bad idea. This is also why a file system with soft updates enabled simply ignore the async flag on any mount request. It's also worth noting that Soren reversed himself and made wc default a few months after 4.3 was released. I assume it defaults to on in 4.4, although I have not checked. This makes me suspect that he decided that the risk was reasonable. But I really should not speak for him. If you wade through the mail lists during the 4.3 beta and release periods, what you'll find is that disk performance took a major hit - some people claimed as much as a factor of 6. No one discussed any change in the risk assessment. I think he turned it back on for the same reason he turned it off: popular demand URL: ttp://www.FreeBSD.org/cgi/getmsg.cgi?fetch=51636+0+/usr/local/www/db/text/2001/freebsd-mobile/20010318.freebsd-mobile . mike -- Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/ Q: How do you make the gods laugh? A: Tell them your plans. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-stable in the body of the message
Re: RE: hw.ata.wc hw.ata.tags softupdates short question
Basically write-caching becomes irrelevant when you have tags, because the host does not have to wait for a write to complete before starting the next one. When IDE tags work, write caching no longer matters. Without IDE tags you have to turn write caching on in order to get similar write performance. Without write caching or tags for IDE, the driver must wait for a write to get completely on the disk and return an acknowledgement before it can begin queueing the next write. Unfortunately IDE drives are driven by the consumer market. They just don't work all that well if write caching is turned off (and tags are a relatively new feature for IDE), which is why we turned write-caching back on by default for IDE. While this theoretically introduces the possibility of out-of-order writes, and while out of order writes have been shown to occur under certain heavy load situations, we do not know of a single case where the IDE write caching feature has actually resulted in any corrupt data. Now with that all said it may seem that IDE + tags is the perfect solution for IDE. Unfortunately IDE is a moving target.. the chances of getting a highly reliable IDE solution are fairly low. Just look at all the problems we have with something as simple as IDE+DMA. SCSI hard drives almost universally have tags so this isn't an issue with SCSI. The simple answer is that if you care at all about reliability, pay the premium for SCSI. -Matt To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-stable in the body of the message