I am trying to test btrfs on my ssd, i am studying about btrfs and alignment. I have read this old mail: http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg16177.html According to the thread, 3 parameters should be tuned 1. leafsize 2. nodesize 3. sectorsize The first two parameters are easy to understand, but how does "sectorsize" affect the alignment? If the erase block size of my SSD is 16k, and i set leafsize=nodesize=16k, leave the sectorsize=4k (default), will it causes misalignment? -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Sep 13, 2012 at 12:02:04AM -0600, ching lu wrote:> I am trying to test btrfs on my ssd, i am studying about btrfs and alignment. > > I have read this old mail: > http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg16177.html > > According to the thread, 3 parameters should be tuned > > 1. leafsize > 2. nodesize > 3. sectorsize > > The first two parameters are easy to understand, but how does > "sectorsize" affect the alignment? > > If the erase block size of my SSD is 16k, and i set > leafsize=nodesize=16k, leave the sectorsize=4k (default), will it > causes misalignment?So frist leafsize/nodesize will always be the same, so if you set one to 16k mkfs will autmatically set the other to 16k, it''s just way back when we had grand plans of having different sizes for both. Secondly your erase block size is 16k? What kind of drive are you using? But yeah 4k sectorsize will result in misaligned writes to the data area, but your metadata will be aligned. Hopefully the raid5/6 code will be out soon and we''ll be able to do > page size sectorsize and you''ll be able to set leafsize==sectorsize. Btw most normal SSDs have waaaay larger erase blocks, on the order of several MB, so it''s not the worst thing to write to the middle of erase blocks, everybody does it anyway. Thanks, Josef -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 09/13/2012 09:00 PM, Josef Bacik wrote:> On Thu, Sep 13, 2012 at 12:02:04AM -0600, ching lu wrote: >> I am trying to test btrfs on my ssd, i am studying about btrfs and alignment. >> >> I have read this old mail: >> http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg16177.html >> >> According to the thread, 3 parameters should be tuned >> >> 1. leafsize >> 2. nodesize >> 3. sectorsize >> >> The first two parameters are easy to understand, but how does >> "sectorsize" affect the alignment? >> >> If the erase block size of my SSD is 16k, and i set >> leafsize=nodesize=16k, leave the sectorsize=4k (default), will it >> causes misalignment? > So frist leafsize/nodesize will always be the same, so if you set one to 16k > mkfs will autmatically set the other to 16k, it''s just way back when we had > grand plans of having different sizes for both. > > Secondly your erase block size is 16k? What kind of drive are you using? But > yeah 4k sectorsize will result in misaligned writes to the data area, but your > metadata will be aligned. Hopefully the raid5/6 code will be out soon and we''ll > be able to do > page size sectorsize and you''ll be able to set > leafsize==sectorsize. Btw most normal SSDs have waaaay larger erase blocks, on > the order of several MB, so it''s not the worst thing to write to the middle of > erase blocks, everybody does it anyway. Thanks, > > Josef >16k is just a assumption only, thanks for your help anyway. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html