Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-12 Thread Ming Lei
On Tue, May 12, 2015 at 3:24 PM, Christoph Hellwig wrote: > On Mon, May 11, 2015 at 09:02:54PM +0800, Ming Lei wrote: >> > But those would be user pages. Anyone who passes a kernel page doesn't >> >> Inside kernel it is hard to say one page in page cache is kernel or >> user page, :-) > > Inside

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-12 Thread Christoph Hellwig
On Mon, May 11, 2015 at 09:02:54PM +0800, Ming Lei wrote: > > But those would be user pages. Anyone who passes a kernel page doesn't > > Inside kernel it is hard to say one page in page cache is kernel or > user page, :-) Inside the kernel it's easy to say that it's the caller business to make

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-12 Thread Christoph Hellwig
On Mon, May 11, 2015 at 09:02:54PM +0800, Ming Lei wrote: But those would be user pages. Anyone who passes a kernel page doesn't Inside kernel it is hard to say one page in page cache is kernel or user page, :-) Inside the kernel it's easy to say that it's the caller business to make sure

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-12 Thread Ming Lei
On Tue, May 12, 2015 at 3:24 PM, Christoph Hellwig h...@infradead.org wrote: On Mon, May 11, 2015 at 09:02:54PM +0800, Ming Lei wrote: But those would be user pages. Anyone who passes a kernel page doesn't Inside kernel it is hard to say one page in page cache is kernel or user page, :-)

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-11 Thread Ming Lei
On Mon, May 11, 2015 at 3:19 PM, Christoph Hellwig wrote: > On Thu, May 07, 2015 at 08:12:31PM +0800, Ming Lei wrote: >> In case of loop, it is quite specific about dirtying READ pages in >> direct IO because fs over loop has considered dirtying these pages >> already. >> >> For other cases of

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-11 Thread Christoph Hellwig
On Thu, May 07, 2015 at 08:12:31PM +0800, Ming Lei wrote: > In case of loop, it is quite specific about dirtying READ pages in > direct IO because fs over loop has considered dirtying these pages > already. > > For other cases of ITER_BVEC or ITER_KVEC, if the page is > anonymous or mapped,

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-11 Thread Christoph Hellwig
On Thu, May 07, 2015 at 08:12:31PM +0800, Ming Lei wrote: In case of loop, it is quite specific about dirtying READ pages in direct IO because fs over loop has considered dirtying these pages already. For other cases of ITER_BVEC or ITER_KVEC, if the page is anonymous or mapped, dirtying is

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-11 Thread Ming Lei
On Mon, May 11, 2015 at 3:19 PM, Christoph Hellwig h...@infradead.org wrote: On Thu, May 07, 2015 at 08:12:31PM +0800, Ming Lei wrote: In case of loop, it is quite specific about dirtying READ pages in direct IO because fs over loop has considered dirtying these pages already. For other

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-07 Thread Ming Lei
On Thu, May 7, 2015 at 3:16 PM, Christoph Hellwig wrote: > On Thu, May 07, 2015 at 01:08:23AM +0800, Ming Lei wrote: >> When direct IO is submitted from kernel, it is often unnecessary >> to dirty pages, for example of loop, dirtying pages have been >> considered in the upper filesystem(over

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-07 Thread Christoph Hellwig
On Thu, May 07, 2015 at 01:08:23AM +0800, Ming Lei wrote: > When direct IO is submitted from kernel, it is often unnecessary > to dirty pages, for example of loop, dirtying pages have been > considered in the upper filesystem(over loop) side already, and > they don't need to be dirtied again. > >

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-07 Thread Christoph Hellwig
On Thu, May 07, 2015 at 01:08:23AM +0800, Ming Lei wrote: When direct IO is submitted from kernel, it is often unnecessary to dirty pages, for example of loop, dirtying pages have been considered in the upper filesystem(over loop) side already, and they don't need to be dirtied again. So

Re: [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-07 Thread Ming Lei
On Thu, May 7, 2015 at 3:16 PM, Christoph Hellwig h...@infradead.org wrote: On Thu, May 07, 2015 at 01:08:23AM +0800, Ming Lei wrote: When direct IO is submitted from kernel, it is often unnecessary to dirty pages, for example of loop, dirtying pages have been considered in the upper

[PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-06 Thread Ming Lei
When direct IO is submitted from kernel, it is often unnecessary to dirty pages, for example of loop, dirtying pages have been considered in the upper filesystem(over loop) side already, and they don't need to be dirtied again. So this patch introduces IOCB_DONT_DIRTY_PAGE flag for direct IO, and

[PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO

2015-05-06 Thread Ming Lei
When direct IO is submitted from kernel, it is often unnecessary to dirty pages, for example of loop, dirtying pages have been considered in the upper filesystem(over loop) side already, and they don't need to be dirtied again. So this patch introduces IOCB_DONT_DIRTY_PAGE flag for direct IO, and