RE: [PATCH 3/3] pnfsblock: bail out unaligned DIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux