On 07/26/2012 06:07 PM, Peng Tao wrote: > On Thu, Jul 26, 2012 at 10:12 PM, Boaz Harrosh <bharrosh@xxxxxxxxxxx> wrote: >> There is an easy locking solution for DIO which will not cost much >> for DIO and will cost nothing for buffered IO. You use the page-cache >> page lock. >> >> What you do is grab the zero-page of each block lock before/during writing to >> any block. So for your example above they will all be serialized by page-zero >> lock. > Yeah, I agree this can work. But I'd prefer not to mix DIO with buffer > IO, which is often error prone. If in any case I need to serialize > AIODIO, I'd prefer to do it in easier ways like locking invalid > extents etc, without messing with page cache. > Ye, just keep it BLOCK aligned and that's it. Apps will learn fast enough. Simple is always better. Currently I support any alignment but I might do the same in objlayout in the raid5/6 case. and DIO <> > Or maybe somehow through statfs(2), since the blocksize attribute is > actually a file system's attribute instead of block device's. > Good point!! statfs->f_bsize man statfs: long f_bsize; /* optimal transfer block size */ What does NFS return in there now? maybe let LD override on that? I'll support a patch as such we could use it as well. Cheers Boaz -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html