Date: Wed, 17 Mar 2010 14:11:18 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: freebsd-hackers@freebsd.org Subject: Re: ATA 4K sector issues Message-ID: <201003172111.o2HLBIgJ069873@apollo.backplane.com> References: <alpine.BSF.2.00.1003171114280.74067@mignon.ki.iif.hu> <86tysf58a2.fsf@ds4.des.no> <alpine.BSF.2.00.1003171652260.74067@mignon.ki.iif.hu> <f8e3d83f1003171034m5e75eae4r5e8b31d88d361d3b@mail.gmail.com> <367b2c981003171112n785ea9d4q21d00b533819ca67@mail.gmail.com> <f8e3d83f1003171117k20d553b7y7ce4c3c8ed2f5c96@mail.gmail.com> <201003172023.o2HKNNbj069321@apollo.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I'll note one last thing with regards to write combining within the drive's zone cache. Drive zone caches work very well for combing adjacent sectors when the write zones are perfectly linear (when the writes within each zone being tracked are perfectly linear). But the drive zone caches I've tested tend to break down very quickly when the data is written out of order, even if all the data winds up being present (could be combined into a linear result). I posted a program a while back that showed that. Basically writing 512-byte sectors ordered 0, 1, 2, 3, 4, ... is very fast, but the moment you start writing out of order, e.g. 3, 2, 1, 0, 7, 6, 5, 4, things start to break down very quickly. I would suspect the issue with UFS and a 2K fragment size on a 4K physical sector drive is precisely this. When UFS mixes fragmented writes with full block writes (related to different files), they tend to have locality of reference but they also tend to be NOT perfectly linear. 2K+ gaps will be created during the unpack and filled later on, but the drive cache can't handle it. Having lots of directories with a few small files in each probably doesn't help matters any either but that can't be 'fixed' without messing up UFS's ability to maintain a relatively unfragmented filesystem over long periods of time. This is probably what is tripping the drive up. This implies that you absolutely must use a 4K fragment size (32K block size) and an aligned partition when using UFS with 4K physical sector drives. -Matt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003172111.o2HLBIgJ069873>