On Tue, May 29, 2012 at 12:33 AM, Myklebust, Trond <Trond.Myklebust@xxxxxxxxxx> wrote: > On Mon, 2012-05-28 at 00:26 -0400, tao.peng@xxxxxxx wrote: >> > -----Original Message----- >> > From: Myklebust, Trond [mailto:Trond.Myklebust@xxxxxxxxxx] >> > Sent: Monday, May 28, 2012 11:45 AM >> > To: Peng, Tao >> > Cc: bergwolf@xxxxxxxxx; linux-nfs@xxxxxxxxxxxxxxx >> > Subject: RE: [PATCH 3/3] pnfsblock: bail out unaligned DIO >> > >> > On Sun, 2012-05-27 at 22:30 -0400, tao.peng@xxxxxxx wrote: >> > > As explain in the other mail, it is necessary to have pnfs_dio_begin/end, so I prefer to do the test >> > as early as possible, which is in pnfs_dio_begin. >> > >> > There is no pnfs_dio_begin/end. >> OK. I will put DIO alignment tests inside pg_init. >> >> And any comments on for stable patch in the thread ([PATCH] pnfsblock: bail out page unaligned IO)? If you agree, I will base DIO changes on top of it to avoid conflicts. >> There are reasons to test alignment at different place for buffer IO and DIO. For buffer IO, pg_init isn't the right place because we don't have nfs page there. For DIO, pg_test isn't the right place because we need to check cross page boundary. > > Since all pages in the struct nfs_pageio_descriptor are guaranteed to be > contiguous, you really only need to check the first and last page in the > series for alignment. > > pg_init() does take the first nfs_page request as its argument and so it > should be possible to check the alignment of the first page in the > series there. > You can then check the alignment of the last page in your > ->write_pagelist() and return PNFS_NOT_ATTEMPTED if appropriate. > Thanks. Will do it as you suggested. > Note that all applications that use O_DIRECT are expected to use aligned > memory, since that's what the open() manpage implies is the safe option > for all filesystems. Unaligned memory is therefore not something that we > need to optimise for. > do_blockdev_direct_IO() is checking memory alignment for direct IO. Is there any difference between NFS and other FS here? Cheers, Tao -- 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